mIRC Home    About    Download    Register    News    Help

Print Thread
Output nicks seperated by comma $chr(44) #270589 30/07/22 02:10 AM
Joined: Nov 2021
Posts: 35
Simo Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Nov 2021
Posts: 35
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,

Re: Output nicks seperated by comma $chr(44) [Re: Simo] #270592 30/07/22 08:13 PM
Joined: Jul 2006
Posts: 3,930
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,930
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
Re: Output nicks seperated by comma $chr(44) [Re: Wims] #270595 31/07/22 06:08 PM
Joined: Nov 2021
Posts: 35
Simo Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Nov 2021
Posts: 35
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)
  }
}


Re: Output nicks seperated by comma $chr(44) [Re: Simo] #270596 31/07/22 06:45 PM
Joined: Jul 2006
Posts: 3,930
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,930
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
Re: Output nicks seperated by comma $chr(44) [Re: Wims] #270598 31/07/22 08:38 PM
Joined: Nov 2021
Posts: 35
Simo Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Nov 2021
Posts: 35
Thank you Wims that seems to do it