This is a Blacklist script I coded out, and decided to post it here too.
Commands: !blist add [Nick] [Reason]; !blist del [Nick] and !blist list
To use this script, add in:
if (!$readini(Blacklist.ini, $chan, $address($nick,2))) {
To any snippet you wish to not let one use whilst added to the Blacklist!
Example:
on *:TEXT:*:#:{
if ($1 == !example) {
if (!$readini(Blacklist.ini, $chan, $address($nick,2))) {
Whatever your script is goes here... I'm sure you get the point. xD
}
else { msg # You can't use this as you're added to the Blacklist. }
}
}
Any suggestions or thoughts are welcome. :)
And, one last thing... Enjoy the snippet!
on *:TEXT:*:#:{
if ($1-2 == !blist add) {
var %address = $address($3,2)
if ($readini(Blacklist.ini, $+($network,$chan), $address($3,2))) {
msg # $nick $+ , the address $qt(%address) is already added to the blacklist! Reason: $readini(Blacklist.ini, $+($network,$chan), %address)
}
else {
if ($3) && ($4) {
writeini Blacklist.ini $+($network,$chan) $address($3,2) $4- $+($chr(40),Added by $nick on $fulldate,$chr(41))
var %BlacklistReason = $readini(Blacklist.ini, $+($network,$chan), %address)
msg # $qt(%address) has been added to the blacklist! Reason: %BlacklistReason
}
else { msg # $nick $+ $chr(44) you need to specify the name/reason of the person to add to the blacklist! !blist add [Nick] [Reason] }
}
}
if ($1-2 == !blist del) {
if ($readini(Blacklist.ini, $+($network,$chan), $address($3,2))) {
remini Blacklist.ini $+($network,$chan) $address($3,2)
msg # $qt($address($3,2)) has been removed from the blacklist by $nick
}
else { msg # $nick $+ , $qt($address($3,2)) is not on the blacklist to remove. }
}
if ($1-2 == !blist list) {
var %a = 1
if (!$readini(Blacklist.ini, $+($network,$chan), $ini(Blacklist.ini, $+($network,$chan), %a))) msg # There is currently no-one added to the blacklist!
else {
while (%a <= $ini(Blacklist.ini, $+($network,$chan), 0)) {
inc %number 1
msg # $+($chr(35),%number) $qt($ini(Blacklist.ini, $+($network,$chan), %a)) Reason: $readini(Blacklist.ini, $+($network,$chan), $ini(Blacklist.ini, $+($network,$chan), %a)))
inc %a
}
}
}
}
It works with multiple channels but I'm sure I can update it to work with server too. I will do that shortly and post a code update.
Edit: Code has been updated to work with different networks! :)