Oh [censored],
I had no idea that I posted twice! I have the habit of getting on the mIRC msg boards, first thing when I get up, so that I waken up whilst browsing the boards, before studying.
Maybe in the future I should do something else first, and check the boards in the afternoon or something.
Indeed, I used the echo -a for testing purposes cuz I didn't connect to a server, but I did wanted to see if the code works.
Btw I only posted that as a means to help you, no need to be offensive. And if you (and your tone implies it) feel that you are l33t enough to script something like that yourself, then why don't you...
As for the continuous tokenizing: you ought to benchmark things first (I thank qwerty for pointing that out) before saying things. I've benchmarked the two alias following, and the result is that they are equally fast (or a neglictable difference):
test1 {
var %t = $ticks
tokenize 32 $str(lol $chr(32),50)
while ($0) { echo -a $1 | tokenize 32 $2- }
echo -a $calc($ticks - %t)
}
[color:red] [/color]
test2 {
var %t = $ticks, %string = $str(lol $chr(32),50), %x = $numtok(%string,32)
while (%x) { echo -a $gettok(%string,%x,32) | dec %x }
echo -a $calc($ticks - %t)
}
Result for both aliases: 62
I'm not saying there wouldnt be a difference if you would benchmark it for like 10000 items or something, but that isn't an issue in this case, since we are making an alias that sends a msg to a number of channels. And I think 50 channels is already way more than whatever amount of channels will be used with this alias. Besides you'd end up with *string too long* anyways if the amount of channels gets too big.
Now to stop my rant, the line of code that Online posted is the most efficient of all, nice
However , by using that method, he is inable to check whether the words in the tokenized string are actually channels. So when a person forgets to put the #, itwill try to msg to a nickname, rather than a channel, whereas in my example it will ignore it and move on to the next channel.
Greetz