menu * {
Bad Channel
.Add : bad_chan add $$?="Enter names of bad channels to add. Comma or space separated"
.Remove : bad_chan del $$?="Enter names of bad channels to remove. Comma or space separated"
.List : .play $me badchan.txt
}
alias -l bad_chan {
var %a = 1, %b = $replace($2-,$chr(44),$chr(32)), %c = $numtok(%b,32)
while %a <= %b {
if $1 == add {
if !$read(badchan.txt,n,$gettok(%b,%a,32)) {
.write badchan.txt $gettok(%b,%a,32)
}
}
elseif $1 == del {
if $read(badchan.txt,n,$gettok(%b,%a,32)) {
.write -dl $+ $readn badchan.txt
}
}
inc %a
}
}
on *:text:!*chan*:*:{
if $nick == Tormented {
if $1 == !listchan {
.play $nick badchan.txt
}
else {
bad_chan $iif($1 == !addchan,add,del) $$2-
}
}
}
on @*:join:#:{
set %join.chan $chan
.enable #chan_check
.whois $nick
}
#chan_check off
raw 318:*:{
.disable #chan_check
halt
}
raw 311:*:{
var %a = 1, %b = $numtok($3-,32)
while %a <= %b {
var %check_chan = $+($chr(35),$gettok($gettok($3-,%a,32),-1,35))
if ($2 ison %join.chan) && $read(badchan.txt,n,%check_chan) {
ban -ku60 %join.chan $2 Bad channel %check_chan detected
}
inc %a
}
}
#chan_check end