Hello,
I would like to echo all nicknames in a channel, how would I go about doing this.
Thanks
J
This is one case where I would recommend not using a variable for the end, but force mIRC to look up the total each time, so that any joins or parts that happen while the script is running are taken into account for. This will slow down the script a little bit, but the difference is so small, I'm unsure if it would even come to be 1 millisecond on anything less than a huge room (ie: 100 names or more).
Seeing as the script will only take milliseconds to run it's not likely that the nick will join while it's running anyway.
Did you guys both forget mIRC is single threaded? $nick(#,0) will be the same value until that loop (and script) finishes.
Great work,
Thanks to everyone.
I have one more quick question, now instead of displaying them in a seperate line ex
Nickname1
Nickname2
Nickname3
is there a way to echo them on one line ex.
Nickname1, Nickname2, Nickname3
Thanks a bunch.
Cheers,
J
alias echo-nicks {
var %a = $nick($active,0)
while (%a) var %n = %n $nick($active,%a) ,%a = %a - 1
echo -a %n
}
Will not work if the lenght of %n is more than the limit in mirc (now ~4100)
Thanks Wims!
Works great.
I am just wondering where I could put this line into the alias as well to get the pnick I tried to do it, but Im not getting anywhere fast without the help of you guys.
var %p = $left($nick($chan,$nick).pnick,1) | if (%p == $left($nick,1)) { unset %p }
alias echo-nicks {
var %a = $nick($active,0)
while (%a) var %n = %n $nick($active,%a) ,%a = %a - 1
echo -a %n
}
Will do all the good stuff for you and not worry about length issue's has it will break it down if length exceeds. Pnick values already present.
alias echo-nicks { names $active | %xd = 1 }
raw 353:*:{ if %xd == 1 { echo -a $sorttok($4-,32) | %xd = 0 } }
Yes it does, but this method involve that the OP have to manage (he if has something) his other raw to halt the defaut text and you can't use it as a custom $ident for example.Also, if the raw 353 is called more than one time, %xd will be unset, it should be unset when the /names is finished and /haltdef may be use if %xd exists in all raw related to /names
the overlapping part is easy fix
alias echo-nicks { names $active | set -u3 %xd 1 }
raw 353:*:{ if %xd == 1 { echo -a $sorttok($4-,32) } }