simple global blacklist for a bot
!blacklist add/del/list nick/mask
nick when adding
mask when deleting
will ban the nick on any channel you are op on
if ($nick == YOUR_NICK) {
on *:text:*:*: {
if ($nick == YOUR_NICK) {
if ($strip($1) == !blacklist) {
if ($2 == $null) { msg $chan Usage: $1 add/del/show <nick> }
if ($2 == add) { set -u5 %bannick $3 | globalban | .msg $chan Blacklisting $address($3,2) | write blacklist.txt $address($3,2) }
if ($2 == del) { set %bannick $3 | globalunban | .msg $chan Deleting $3 | write -dw $+ * $+ $3 $+ * blacklist.txt }
if ($2 == list) { showblacklist }
}
}
}
alias showblacklist {
var %a = $lines(blacklist.txt)
while (%a) {
.msg $chan %a $read(blacklist.txt, %a)
dec %a
}
}
alias globalban {
var %a = $chan(0)
while (%a) {
if ($me isop $chan(%a)) { mode $chan(%a) +b $address($($+(%,bannick),2),2) Global BlackList | dec %a }
else { dec %a }
}
}
alias globalunban {
var %a = $chan(0)
while (%a) {
if ($me isop $chan(%a)) { mode $chan(%a) -b $($+(%,bannick),2) | dec %a }
else { dec %a }
}
}
there is but if you add this to a bot that uses something like
if ($nick == %owner) {
or user levels even, then i would have to add that into the bot
as there is thousands of bots and everyone uses a different method for recognising the owner, its easier to make a code this way.
also if $nick was used then anyone would be able to access the command
which is not recommended