just another little snippet I made to kick pretty self explanitory for a bot. Uses are !kon nick !koff nick
on *:text:!kon*:#: { if ($nick isop $chan) {
set %kick $2
msg $chan $2 next time you get talk you will be kicked
}
}
on *:text:!koff:#: { if ($nick isop $chan) {
msg $chan %kick you have been taken off the kick list
unset %kick
}
}
on *:text:*:#: { if ($nick == %kick) { kick # %kick
}
}
One thing nobody realizes is that a user can change his or her nickname to avoid being kicked. Here is my take on yours:
on @*:text:*:#:{
tokenize 32 $strip($1-)
if ($nick == %kick) {
kick # $v1
}
if ($nick isop #) && ($regex($1,/^!ko(n|ff)/iS)) {
if ($regml(1) == n) && ($$2 ison #) {
set %kick $2
msg # $2 next time you get talk you will be kicked
halt
}
msg # %kick you have been taken off the kick list
unset %kick
}
}
As Savage_CL has pinpointed that this script can only watch one nickname at a time, so you may want to consider using $addtok() / $istok() and $remtok() to match more than one nickname.
You might want to change your code to:
on *:text:!kon *:#: {
if ($nick isop $chan && $$2 ison $chan) {
set %kick $2
msg $chan $2 next time you get talk you will be kicked
}
}
Hence the space between !kon and the *, and the $$2. This makes sure $2, the nickname, is set and that it is in your channel.
You should also combine those three text events.
This would be a great place to explore the wonders of token identifiers. Use of $addtok, $remtok, and $istok would allow for multiple nicks to be monitored at the same time. Also, and this is just an anal thing for me, don't put your first if statement in the same line as an event. Space it out. space is your friend.
Happy Scripting :)
-Savage_CL