rendered paste bodyalias blist {
if ($1 == add) {
whois $2 | write blist.txt $address($2,2) $3- | write blist.txt $2 $3-
var %x = 1
amsg [Blacklist] Added $qt($address($2,2)) $+($chr(40),Aka:,$chr(32),$2,$chr(41)) to Blacklist, reason: $qt($3-)
while (%x =< $chan(0)) {
if ($2 ison $chan(%x)) {
if ($me isop $chan(%x)) || ($me ishop $chan(%x)) { kick $chan(%x) $2 [Blacklisted] $3- | inc %x
}
}
}
}
elseif ($1 == del) {
whois $2 | write $+(-ds,$address($2,2)) blist.txt | write $+(-ds,$2) blist.txt
var %x = 1
amsg [Blacklist] Removed $qt($address($2,2)) $+($chr(40),Aka:,$chr(32),$2,$chr(41)) from Blacklist, reason: $qt($3-)
while (%x < $chan(0)) {
if ($me isop $chan(%x)) || ($me ishop $chan(%x)) { mode # -bb $2 $address($2,2) | inc %x }
}
}
}
on *:JOIN:#: {
if ($read(blist.txt, s,$address($nick,2))) || ($read(blist.txt, s,$nick)) {
mode # +bb-Q $nick $address($nick,2)
kick # $nick [Blacklisted] $remove($ifmatch,$nick,$address($nick,2))
}
}
on *:OP:#: {
if ($opnick == $me) {
var %op = 1
while (%op < $nick(#,0)) {
if ($read(blist.txt, s,$address($nick(#,%op),2))) || ($read(blist.txt, s,$nick(#,%op) )) {
mode # +bb-Q $nick(#,%op) $address($nick(#,%op),2)
kick # $nick(#,%op) [Blacklisted] $remove($ifmatch,$nick(#,%op),$address($nick(#,%op),2))
inc %op
}
if (!$read(blist.txt, s,$address($nick(#,%hop),2))) && (!$read(blist.txt, s,$nick(#,%hop) )) { inc %op }
}
}
}
on *:HELP:#: {
if ($hnick == $me) {
var %hop = 1
while (%op < $nick(#,0)) {
if ($read(blist.txt, s,$address($nick(#,%hop),2))) || ($read(blist.txt, s,$nick(#,%hop) )) {
mode # +bb-Q $nick(#,%hop) $address($nick(#,%hop),2)
kick # $nick(#,%hop) [Blacklisted] $remove($ifmatch,$nick(#,%hop),$address($nick(#,%hop),2))
inc %hop
}
if (!$read(blist.txt, s,$address($nick(#,%hop),2))) && (!$read(blist.txt, s,$nick(#,%hop) )) { inc %hop }
}
}
}
on *:TEXT:*:#: {
if ($read(blist.txt, s,$address($nick,2))) || ($read(blist.txt, s,$nick)) {
mode # +bb-Q $nick $address($nick,2)
kick # $nick [Blacklisted] $remove($ifmatch,$nick,$address($nick,2))
}
}