Thats why I specified:
Although this script can be further corrected as it not yet in the best shape, but as it works for multiple channels so I suggest you use it.
I know there are many logics which can be improved. Everyone has their own way of doing things, because we don't think alike. Anyway this was a very old script when I was starting to learn and haven't changed it since then.
It can be improved, alot with new functions and remove some unnecessary commands which have no use, but then again the script works fine, so I guess the user has been helped with. I may update and release this for public use, so all small things like this would have been taken care off!
Code: Select all
if {([lsearch -exact [split [string tolower $badrcheck]] [string tolower $chan]] != -1)
Both variables have been set to lower case because we want to match them, lsearch -exact is case-sensitive and, I don't think lsearch has a nocase function as the string manipulation commands.
This will check if the channel joined by the user is mentioned in the working channel list or not. If the channel is mentioned and a user joins on that then only that person will be whois'ed.
As for string equal -nocase $botnick $nick, it will mainly work the same for isbotnick $nick, even I've seen scripts coded with == comparators for strings $botnick == $nick, still they work fine. Only they happen with very rare occasions, exceptions we might call them, one out of a hundred.
Even if you check in your previous version you are using strlwr $bla1 == strlwr $bla2 heh.
As for the uhost yes there are many ways to get it. You can split the string $arg and get it from there. There are many ways to do the same things and everyone has their own likings and dislikings. Getchanhost might be a bit slower in milliseconds than just splitting the string and getting the uhost. But then again this is only for performance, for the script to be the fastest as possible!
Suggestion:
I would personally add a scanner to to get who of the channel match all the raws and kick/ban out all users with badrealnames. Suppose this can happen when the bot joins a channel or when it is oped, maybe users with badrealnames are present before the bot arrived in the channel or was deoped and just got oped.
Fear not caesar I will update this script to be an asskicking one, in soon time.
