This is a script developed by myself and a good friend for our bots. We use it in several channels and it's a great way to minimize the amount of chatter to mod number. You choose the nicks you want to have the ability to use simple mod commands and the rest is very self explanatory. Hope you find it handy for yourselves.
Add into your bots remote
Insert as many allowed USERNAMEs you feel necessary, seperated by a comma, no spaces
Tell your chosen users to type in BOTNAME COMMAND NICK.
I tell them to set it up as a nick menu to make it faster and easier
**Updated with Jethros suggestion. Thanks heaps for the heads up
alias allowednicks return USERNAME,USERNAME
on @*:text:*:#:{
tokenize 32 $strip($1-)
if ($1 == $me) && ($istok($allowednicks,$nick,44)) {
if ($istok(kick boot,$2,32)) && ($3 ison #) { kick # $3 Blame $nick }
elseif (ban == $2) && ($address($3,2) !isban #) { ban # $3 2 }
elseif (voice == $2) && ($3 !isvoice #) { mode # +v $3 }
elseif (unvoice == $2) && ($3 isvoice #) { mode # -v $3) }
elseif (punish == $2) && ($3 ison #) { ban -k # $3 2 }
}
}
Now I agree with you on that matter. Thanks for the input. :-)
Sorps, let's replace this part with this one below instead:
if ($istok(kick boot,$2,32)) && ($3 ison #) { kick # $3 Blame $nick }
elseif (ban == $2) && ($address($3,2) !isban #) { ban # $3 2 }
elseif (voice == $2) && ($3 !isvoice #) { mode # +v $3 }
elseif (unvoice == $2) && ($3 isvoice #) { mode # -v $3) }
elseif (punish == $2) && ($3 ison #) { ban -k # $3 2 }
That may be so if I constructed it this way:> if ($istok(kick boot,$2,32)) { kick # $iif($3 ison #,$3 Blame $nick) }But I made the kick # bit inside the $iif:> if ($istok(kick boot,$2,32)) { $iif($3 ison #,kick # $3 Blame $nick) }So the way I see it, it works pretty much the same thing as:> if ($istok(kick boot,$2,32)) && ($3 ison #) { kick # $3 Blame $nick }
It's a waste of $istok engine when you use it for one word. You should strip all the tokens, not just $me, adapt the use of && operator, use the isvoice and isban check, and lastly, you should make sure the client that runs the code is opped by adding a @ prefix to the event:
alias allowednicks return USERNAME,USERNAME
on @*:text:*:#:{
tokenize 32 $strip($1-)
if ($1 == $me) && ($istok($allowednicks,$nick,44)) {
if ($istok(kick boot,$2,32)) { $iif($3 ison #,kick # $3 Blame $nick) }
elseif (ban == $2) { $iif($address($3,2) !isban #,ban # $3 2) }
elseif (voice == $2) { $iif($3 !isvoice #,mode # +v $3) }
elseif (unvoice == $2) { $iif($3 isvoice #,mode # -v $3) }
elseif (punish == $2) { $iif($3 ison #,ban -k # $3 2) }
elseif (invite == $2) { invite $3 # }
}
}
P.S. Your original code has an error. You put a curly bracket instead of the regular parenthesis for the command punish. And you misused the invite command.
Using those operators diminish the likelihood of mode flood.