Hmmm... well you are correct on the break; command. I did not have that in there. Thanks for that. I had an oversight there. However it is still 8 rather than 7.
As for the nick problem, it definitely has to do with string matching on an element of $cv_bannednicks. What would you suggest from here?
Perhaps I should throw another nick in the list for test sake.
set cv_bannednicks {[xxx]
[fastshit]-}
...
set nick "[lindex [split $args " "] 6]"
set cv_host($nick) "[lindex [split $args " "] 8]"
foreach s $cv_bannednicks {
if {[string match -nocase *$s* $nick]} {
putlog "debug: would have banned *@$cv_host($nick) based on $s with $nick"
break;
}
}
The output resulted with:
[01:34] (Botnickhere): [05:37] debug: would have banned *@censored.host.tmns.net.au based on [xxx] with mZ[SXCRXY]sad
[01:34] (Botnickhere): [05:37] debug: would have banned *@censored.host.gte.net based on [xxx] with cxhdxaes
haha, omg.... we are all stupid to not notice this one earlier! we should be doomed!
you must escape the [] braces, but not because TCL tries to execute them, but because string match uses it like regexp, [fastshit] matchs any string containing a single f OR a OR s OR t OR h OR i . Just the - at the end prevents matching a bit, because it must match with a following - ^.^.