Welcome

User: Pass:   register


This code snippet allows you to find matching nicks and does not require the IAL to be enabled. The only drawback is that it only works on the active channel, but could easily be extended to have a "channel" parameter.

;Usage: $nc.nick(text) -or- $nc.nick(text,N)
alias nc.nick {
  var %nc.nick = $$1, %nc.loop = 1
  while ($nick(#,%nc.loop)) {
    ;check if the nick matched the input
    if (%nc.nick == $left($nick(#,%nc.loop),$len(%nc.nick))) {
      ;if it does, set it to a var
      var %nc.match = %nc.match $nick(#,%nc.loop)
      inc %nc.loop
    }
    else {
      inc %nc.loop
    }
  }
  ;return the result, return all matching nicks if no N is specified, otherwise return Nth match
  return $iif($2 == $null,%nc.match,$gettok(%nc.match,$2,32))
}






© 1996-2010 hdesk.org and dalnethelpdesk.com