This is a warn system for your bot. If someone is abusing your bot, you can warn them. People get 4 chances before the bot ignores them.
All you have to do is paste this code into your remotes.
After you do that, make sure to type /auser 10 YourNick - This will make it so only you (the bot owner) can warn people.
Then, to warn someone, type !warn
Thanks to Jethro for helping me with this script.
on *:EXIT:save
on *:START:make
on me:*:QUIT:save
on *:CONNECT:make
on *:DISONNECT:save
on me:*:PART:#:save
on 10:TEXT:!warn*:#: {
$iif(!$2,.msg # $nick $+ $chr(44) please enter !warn Nick_Here,hinc -m warn $2)
if ($hget(warn,$2) == 1) {
.msg # 4 $+ $2 $+ , you have been warned for the $ord($v1) time. $&
You have 2 warns left before you will be banned from using me.
}
if ($hget(warn,$2) == 2) {
.msg # 4 $+ $2 $+ , you have been warned for the $ord($v1) time. $&
You have 1 warn left before you will be banned from using me.
}
if ($hget(warn,$2) == 3) {
.msg # 4 $+ $2 $+ , you have been warned for the $ord($v1) time. $&
You have no more warnings remaining, this is your last chance.
}
if ($hget(warn,$2) >= 4) {
msg # 4 $+ $2 $+ , you have been banned. Bye. | ignore $address($2,2) | hdel warn $2
}
}
alias -l make {
if (!$hget(warn)) { hmake warn 100 }
if ($isfile($qt($scriptdirwarn.txt))) { .hload warn $qt($scriptdirwarn.txt) }
}
alias -l save {
hsave warn $qt($scriptdirwarn.txt)
}
hi
"you have been banned. Bye. | ignore $address($2,2)" if banned u have to use /ban not /ignore
and u can do it without repetition
to use only !$2 here is a bad idea if $2 isnot on chan u have to put if $2 ison # and u have to check if $2 is already ignored or not
on 10:TEXT:!warn*:#:{
if ((!$2) || ($2 !ison #)) msg # $nick $+ $chr(44) $iif(!$2,please enter !warn Nick_Here,$2 is not on #)
elseif ($ignore($address($2,2))) msg # $nick $+ $chr(44) $2 is already banned
else {
hinc -m warn $2
var %x $hget(warn,$2),%y 3 - %x
if (%x < 4) msg # 4 $+ $2 $+ , you have been warned for the $ord($v1) time. You have $iif(%y,$iif($v1 == 2,$v1 warns,$v1 warn) left before you will be banned from using me.,no more warnings remaining $+ $chr(44) this is your last chance.)
else {
msg # 4 $+ $2 $+ , you have been banned. Bye.
ignore $address($2,2)
hdel warn $2
}
}
}
If you used somebody else's snippet you must include a URL to the original.
http://www.hawkee.com/phpBB2/viewtopic.php?t=19795&highlight=