With this script i kick chaters with public comand in the channel. When i add in the bot an user, and when he wants to kick me with the command
!kick Insectora ,the bot doesnt do this.Good. But the problem is when he wants to kick the bot with the command !kick Vees . And the bot kicks its self:((( And i don't want this off course ! Help me! What i should to edit to the script so the bot dont kick itself with the command !kick Vees ??
proc pub:kick {nick host hand chan text} {
set whom [lindex $text 0]
set reason [lrange $text 1 end]
if {[matchattr $whom f|f]} {return 0}
putserv "KICK $chan $whom :$reason"
putlog "#$hand# has kicked $whom from $chan"
}
Sorry boys but doesn't work the edition you gave me:( The bot is still kicking itself with the command:(( !kick Vees .But why the script is not working well?
Any other commens??? pls help
i dont think its necessary, cause the bot usally always has the chans in the same capitalation on it .
you only need the tolower check in nick this time, because if the bot sends KICK #chan VeEs, server kicks vees or Vees or any else, but if the bots nick is Vees VeEs == Vees will be untrue .
1. it uses a variable $channel without it being defined,
2. the [matchattr] lacks the $chan,
3. it uses [lindex] and [lrange] on a string (see Tcl FAQ 1).
Well, not exactly. Is the same thing as the nick. #cHaNnEl is not the same as #channel or #Channel or even #ChanneL. Do some tests and you will see what I'm talking about.
Once the game is over, the king and the pawn go back in the same box.
caesar wrote:Well, not exactly. Is the same thing as the nick. #cHaNnEl is not the same as #channel or #Channel or even #ChanneL. Do some tests and you will see what I'm talking about.
What tests should be done to see what you are talking about?
yeah, but this will probably NEVER become a problem, because the msg was send on exact that channel the bot should kick. so if the bot is on #Channel, $chan will never be #channel for the bot. it would be a diffrent if it is a bind on msg and not on pub .