mIRC Homepage
Posted By: DJ_Sol isin vs. findtok - 25/02/07 04:36 AM
Im curious what people's opinions are on this.

Lets say I want a hopflood protection on for 3 rooms.
$hget(prot,hopflood) = $chan1 $chan2 $chan3

What do you think is better?

if ($chan isin $hget(prot,hopflood))

if ($findtok($hget(prot,hopflood),$chan,1,32))

And please explain why you feel that way. Thank You!!
Posted By: RusselB Re: isin vs. findtok - 25/02/07 04:46 AM
In this case, I would use $findtok, since the usage of isin could match partials.
For example:
Chan 1 = #Testing
Chan 2 = #testicles

If the current channel was #Test, then using isin would match both of the channels listed, even though the specific channel isn't listed.

Using $findtok would check the entire channel name in the list and compare that to the channel being used, and return no match (which in this example would be correct)

Posted By: starbucks_mafia Re: isin vs. findtok - 25/02/07 05:12 AM
If you just want to check for the presence of the channel name I'd use the hidden third answer: $istok. You shouldn't use isin for the reasons RusselB mentioned.
Posted By: Riamus2 Re: isin vs. findtok - 25/02/07 04:53 PM
Right, $istok is much better than $findtok for something like that.
© mIRC Discussion Forums