Timed ban/mute for bot
Platform: mIRC
Published Jul 27, 2008
Updated Jul 28, 2008
I was looking for a timed ban for my bot, but they were all the nicklist type, so I made this one.
to use it:
!tb nick time reason
the time is in minutes, and a reason is optional
Being one of my first scripts, constructive criticism is welcomed.
I updated it to include a gag. You might see that I used two timers. This is because when I used one, the second command got executed immediately, instead of waiting for the timer. You are free to take it out if you can make it work.
On @10:Text:!tb *:#: {
if (!$2) || ($2 !ison $chan) { msg $chan $iif(!$2,You did not specify a nick to ban.,They aren't in this channel. }
elseif (!$3) || ($3 !isnum 1-120) { msg $chan Please enter a number between 1 and 120. This will be the number of minutes they are banned. }
else {
msg $chan $2 has been banned for $3 minutes. $iif($4,Reason: $4-)
ban -ku $+ $calc($3 * 60) $chan $2 5
}
}
On @10:Text:!tm *:#: {
if (!$2) || ($2 !ison $chan) { msg $chan $iif(!$2,You did not specify a nick to gag.,They aren't on this channel. }
elseif (!$3) || ($3 !isnum 1-120) { msg $chan Please enter a number between 1 and 120. This will be the number of minutes they are gagged. }
else {
msg $chan $2 has been gagged for $3 minutes. $iif($4,Reason: $4-)
set %tmaddress ~q: $+ $address($2,5)
mode $chan +b %tmaddress
/timergag 1 $calc($3 * 60) /mode $chan -b %tmaddress
/timergag2 1 $calc(($3 * 60) + 1 ) msg $chan $2 may now speak again.
}
}