mIRC Home    About    Download    Register    News    Help

Print Thread
Select all nicks but not mine #75718 18/03/04 02:37 PM
Joined: Aug 2003
Posts: 50
D
Dylan666 Offline OP
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?

Re: Select all nicks but not mine #75719 18/03/04 02:48 PM
Joined: Jan 2004
Posts: 79
C
cmad Offline
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!
Re: Select all nicks but not mine #75720 18/03/04 03:03 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
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
Re: Select all nicks but not mine #75721 18/03/04 03:56 PM
Joined: Dec 2002
Posts: 29
C
Charlie Offline
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
Re: Select all nicks but not mine #75722 18/03/04 08:34 PM
Joined: Aug 2003
Posts: 50
D
Dylan666 Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Aug 2003
Posts: 50
Your script is interesting but something doesn't work... confused

Re: Select all nicks but not mine #75723 19/03/04 05:07 PM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
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