mIRC Homepage

Select all nicks but not mine

Posted By: Dylan666

Select all nicks but not mine - 18/03/04 02:37 PM

To select all nicks I found this simple script:

Code:
 [script] 
= alias list { 
= var %i = 1 
= while (%i <= $nick(#,0)) { 
= echo -a $nick(#,%i) 
= inc %i 
= } 
= } 
= 
= menu status,channel,query { 
= - List nicks - :/$list 
= }


How can I exclude my nick in this selection?
Posted By: cmad

Re: Select all nicks but not mine - 18/03/04 02:48 PM

alias listnicks {
set %i 1
while (%i <= $nick(#,0)) {
set %nickname $nick(#,%i)
if (%nickname != $me)
echo -a %nickname
}
}
Posted By: tidy_trax

Re: Select all nicks but not mine - 18/03/04 03:03 PM

alias listnicks {
var %i 1
while $nick(#,%i) {
if $nick(#,%i) != $me { echo -a $nick(#,%i) }
inc %i
}
}
Posted By: Charlie

Re: Select all nicks but not mine - 18/03/04 03:56 PM

Code:
alias listnicks {
  var %nicks, %i 1
  while ($nick(#,%i)) {
    if ($ifmatch != $me) { set %nicks %nicks $ifmatch }
    inc %i
  }
  return %nicks
}
Posted By: Dylan666

Re: Select all nicks but not mine - 18/03/04 08:34 PM

Your script is interesting but something doesn't work... confused
Posted By: Hammer

Re: Select all nicks but not mine - 19/03/04 05:07 PM

The best way to do this is to simply add all the nicks to a variable, then use $remtok(%var, $me, 1, 32) to remove your own nick afterwards. This saves all the comparisons each time through the loop.

alias listnicks {
  • var %nicks, %i = 1
    while ($nick(#,%i)) var %nicks = %nicks $ifmatch, %i = %i + 1
    return $remtok(%nicks, $me, 1, 32)
}

The only real limitation is the string length. If the length of all the nicks goes much over 930 characters, you will have problems. Otherwise, this will work fine. smile
© 2021 mIRC Discussion Forums