mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 50
D
Babel fish
OP Offline
Babel fish
D
Joined: Aug 2003
Posts: 50
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?

Joined: Jan 2004
Posts: 79
C
Babel fish
Offline
Babel fish
C
Joined: Jan 2004
Posts: 79
alias listnicks {
set %i 1
while (%i <= $nick(#,0)) {
set %nickname $nick(#,%i)
if (%nickname != $me)
echo -a %nickname
}
}


My ally is the compiler, and a powerful ally it is!
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
alias listnicks {
var %i 1
while $nick(#,%i) {
if $nick(#,%i) != $me { echo -a $nick(#,%i) }
inc %i
}
}


New username: hixxy
Joined: Dec 2002
Posts: 29
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Dec 2002
Posts: 29
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.

Charlie
Joined: Aug 2003
Posts: 50
D
Babel fish
OP Offline
Babel fish
D
Joined: Aug 2003
Posts: 50
Your script is interesting but something doesn't work... confused

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


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard