mIRC Home    About    Download    Register    News    Help

Print Thread
D
Dylan666
Dylan666
D
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?

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

Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
alias listnicks {
var %i 1
while $nick(#,%i) {
if $nick(#,%i) != $me { echo -a $nick(#,%i) }
inc %i
}
}

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

Last edited by Charlie; 18/03/04 03:58 PM.
D
Dylan666
Dylan666
D
Your script is interesting but something doesn't work... confused

Joined: Dec 2002
Posts: 1,253
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,253
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


Link Copied to Clipboard