$findtok(text,token,N,C)
Example 1:
$findtok(a b b c d,b,0,32)
Will return the total times that b is found in a b b c d (which is 2)
(32 is the ascii number of space character)
Example 2:
$findtok(a b b c d,b,2,32)
will return the place of the 2nd b found in a b b c d (which is 3) cause the 2nd b in a b b c d is the 3rd word (token)
but for what you want you'll need the first example.
in mIRC type /help on text
and
/help $findtok
for more help