mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2021
Posts: 87
Simo Offline OP
Babel fish
OP Offline
Babel fish
Joined: Nov 2021
Posts: 87
i have been using this alias for a while wich outputs all regular nicks in a channel with spaces and wanted to have output nicks seperated with comma instead of space i have been messing with it for a while but couldnt get it to work as desired perhaps somebody has an idea how to edit this:

Code

alias nicks {
  var %x = 1 , %index = 1  
  while ($nick(#,%x)) {
    var %nick = $v1 , %CurrentVal = $var($+(%,ListK.,%index),1).value
    if (!$nick(#,$nick(#,%x),@&~%+) && !$regex(%nick,/^((oper|admin|nick|chan|memo)Serv|global| $+ $me $+ )$/i) ) {
      if ($numtok(%CurrentVal,32) >= 4) { var %index = %index + 1 , %CurrentVal = $null }
      set -l $+(%,ListK.,%index) %nick %CurrentVal
    }
    inc %x
  }
  var %x = 0 , %y = $var(%ListK.*,0).local
  while (%x < %y) {
    inc %x
    echo # $sorttok($var(%ListK.*,%x).value,32)  
  }
}




Much apreciated,

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Change this line:
Quote
set -l $+(%,ListK.,%index) %nick %CurrentVal
by this line:
Quote
set -l $+(%,ListK.,%index) %nick $+ $chr(44) $+ %CurrentVal

And this line:
Quote
echo # $sorttok($var(%ListK.*,%x).value,32)
by this line:
Quote
echo # $sorttok($var(%ListK.*,%x).value,44)


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2021
Posts: 87
Simo Offline OP
Babel fish
OP Offline
Babel fish
Joined: Nov 2021
Posts: 87
thanks wims this is what i have so far and i tested it it doesnt seem to output in stacks of 4 tho and it seems to freeze temporary

Code

nicks {
  var %x = 1 , %index = 1 
  while ($nick(#,%x)) {
    var %nick = $v1 , %CurrentVal = $var($+(%,ListK.,%index),1).value
    if (!$nick(#,$nick(#,%x),@&~%+) && !$regex(%nick,/^((oper|admin|nick|chan|memo)Serv|global| $+ $me $+ )$/i) ) {
      if ($numtok(%CurrentVal,32) >= 4) { var %index = %index + 1 , %CurrentVal = $null }
      set -l $+(%,ListK.,%index) %nick $+ $chr(44) $+ %CurrentVal
    }
    inc %x
  }
  var %x = 0 , %y = $var(%ListK.*,0).local
  while (%x < %y) { 
    inc %x 
    echo # $sorttok($var(%ListK.*,%x).value,44)
  }
}


Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
There is another '32' that needs to become a 44 in the if ($numtok()), missed that one tired


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2021
Posts: 87
Simo Offline OP
Babel fish
OP Offline
Babel fish
Joined: Nov 2021
Posts: 87
Thank you Wims that seems to do it


Link Copied to Clipboard