I dont know if token is the best way to do this? If i type
/join #one,#two,#three
and i want a delay between the join of the channels, but i cant figure out the best way to do this, since you use "," between the channel names any of $gettok() , $matchtok() , $findtok() will return a error. So how would i do this the best way?
You can use $gettok() but you need to set #one,#two,#three to a variable first.
$gettok(#one,#two,#three,1,44) - this won't work.
var %chans = #one,#two,#three | echo -a $gettok(%chans,1,44) - this will work.
Let me know if you need help with the rest of the script now that you know how to get the token identifiers working.
Just one small comment: rather than call $numtok() repeatedly, you should set the value to a variable:
var %i = 1, %count = $numtok(%chans,44)
while (%i !> %count) {
...
}
Performance. Granted, for the number of loops you're talking about, it's such a minimal performance increase that it really doesn't matter. I think the main reason for the suggestion is to get in the habit of using the best performing code every time, even if the difference is negligible.
Exactly that. In this case there's not going to be a big performance overhead, but if you were calling something like $com() in a loop rather than setting the result to a variable it would cause a massive delay.