Page 1 of 1

nick search

PostPosted: Mon Feb 08, 2010 4:42 am
by PuNkTuReD
Open by pressing F1

When the dialog opens it will list all the nicks,
which are in channels you are in.

When you start typing a nick into the edit field,
it will list nicks matching the given nick.

If you double click a nick in the list,
it will open a query window.

Code: Select all
/*
Nick Search
By PuNkTuReD
http://www.sassirc.com
*/

alias F1 dialog -dm _nick.center _nick.center
dialog _nick.center {
  title "Nick Search"
  size -1 -1 70 117
  option dbu
  edit "", 1, 5 5 60 10, autohs
  list 2, 5 17 60 100, autohs
}
on *:dialog:_nick.center:*:*: {
  if ($devent == INIT) { _get.match }
  if ($devent == EDIT) {
    if ($did == 1) { _get.match $did(_nick.center,1) }
  }
  if ($DEVENT == DCLICK) {
    if ($did == 2) { query $did(_nick.center,2).seltext }
  }
}
alias _get.match {
  did -r _nick.center 2
  write -c tempnicks.txt
  var %a $1, %b $chan(0)
  while (%b) {
    var %c $nick($chan(%b),0)
    while (%c) {
      if ($left($nick($chan(%b),%c),$len(%a)) == %a) {
        if ($read(tempnicks.txt,w,$nick($chan(%b),%c))) {  }
        else { write tempnicks.txt $nick($chan(%b),%c) }
        dec %c
      }
      else { dec %c }
    }
    dec %b
  }
  _fill.list
}
alias _fill.list {
  var %a $lines(tempnicks.txt)
  while (%a) { did -a _nick.center 2 $read(tempnicks.txt,%a) | dec %a }
}