on @*:text:*:#:{
if ($nick isop $chan) halt
if ($nick isvoice $chan) halt
var %a 1
while (%a <= $ini($scriptdirswearr.txt,channels,0)) {
if ($chan == $ini($scriptdirswearr.txt,channels,%a)) { .timer- 1 .5 check-words $nick $chan $1- }
inc %a
}
}
alias -l check-words {
var %b 1
while (%b <= $ini($scriptdirswearr.txt,words,0)) {
if ($ini($scriptdirswearr.txt,words,%b) isin $strip($3-)) {
if ($readini($scriptdirswearr.txt,commands,punishment) == Kick/Ban) { ban -u $+ $readini($scriptdirswearr.txt,commands,bantime) $2 $1 3 }
kick $2 $1 $readini($scriptdirswearr.txt,commands,kickmsg))
set %a $ini($scriptdirswearr.txt,words,0)
}
inc %b
}
unset %b
}
alias swearr { if (!dialog(swearr)) { dialog -dmn swearr swearr } | else { dialog -c swearr } }
dialog swearr {
title "Banned Words"
size -1 -1 169 155
option dbu
box "Bad Words", 1, 3 1 80 73
button "Add", 3, 7 60 33 11,flat
button "Delete", 4, 44 60 33 11,flat
list 2, 6 9 72 50, sort size
box "Protected Channels", 5, 86 1 80 73
button "Add", 6, 91 60 33 11,flat
button "Delete", 7, 128 60 33 11,flat
list 8, 90 9 72 50, size
text "Select Punishment", 9, 6 85 44 8
combo 10, 53 84 60 30, size drop
button "Save && Exit", 11, 70 140 37 12, ok,flat
box "Other Options", 13, 3 76 163 55
text "Ban Time:", 14, 6 97 24 8
edit "", 15, 32 95 17 10, right
text "Seconds", 16, 50 97 21 8
text "Kick Msg:", 17, 6 108 24 8
edit "", 18, 32 106 130 10
check "Protect Ops", 12, 19 119 50 10
check "Protect Voiced Users", 19, 78 119 60 10
}
on *:dialog:swearr:init:*:{
did -a $dname 10 Kick Only
did -a $dname 10 Kick/Ban
var %a 1
while (%a <= $ini($scriptdirswearr.txt,words,0)) {
did -a $dname 2 $ini($scriptdirswearr.txt,words,%a)
inc %a
}
var %b 1
while (%b <= $ini($scriptdirswearr.txt,channels,0)) {
did -a $dname 8 $ini($scriptdirswearr.txt,channels,%b)
inc %b
}
if ($readini($scriptdirswearr.txt,commands,punishment) === Kick Only) { did -c $dname 10 1 | did -b $dname 14,15,16 }
if ($readini($scriptdirswearr.txt,commands,punishment) === Kick/Ban) { did -c $dname 10 2 | did -e $dname 14,15,16 }
did -ra $dname 15 $readini($scriptdirswearr.txt,commands,bantime)
did -ra $dname 18 $readini($scriptdirswearr.txt,commands,kickmsg)
if ($readini($scriptdirswearr.txt,protect,ops)) { did -c $dname 12 }
if ($readini($scriptdirswearr.txt,protect,voice)) { did -c $dname 19 }
}
on *:dialog:swearr:sclick:*:{
if ($did == 3) { var %word $?="Enter a bad word" | if (%word == $null) { halt } | did -a $dname 2 %word | writeini $scriptdirswearr.txt words %word is }
if ($did == 4 && $did(2).sel) { var %word $did(2).seltext | did -d $dname 2 $did(2).sel | remini $scriptdirswearr.txt words %word }
if ($did == 6) {
var %chan $?="Enter a channel"
if (%chan == $null ) { halt }
if ($left(%chan,1) != $chr(35)) { set %chan $chr(35) $+ %chan | did -a $dname 8 %chan | writeini $scriptdirswearr.txt channels %chan is | unset %chan | halt }
else { did -a $dname 8 %chan | writeini $scriptdirswearr.txt channels %chan is | unset %chan }
}
if ($did == 7 && $did(8).sel) { var %chan $did(8).seltext | did -d $dname 8 $did(8).sel | remini $scriptdirswearr.txt channels %chan }
if ($did == 10) { if ($did(10).sel == 1) { writeini $scriptdirswearr.txt commands punishment Kick Only | did -b $dname 14,15,16 } | if ($did(10).sel == 2) { writeini $scriptdirswearr.txt commands punishment Kick/Ban | did -e $dname 14,15,16 } }
if ($did == 11) {
if ($did(15) != $null && $readini($scriptdirswearr.txt,commands,punishment) == Kick/Ban) { writeini $scriptdirswearr.txt commands bantime $did(15) }
if ($did(18) != $null) { writeini $scriptdirswearr.txt commands kickmsg $did(18) }
dialog -x $dname
}
if ($did == 12) { if ($ini($scriptdirswearr.txt,protect,ops)) { remini $scriptdirswearr.txt protect ops | write -l6 $script ;if ( $+ $chr(36) $+ nick isop $chr(36) $+ chan) { halt } | .reload -rs $script } | else { writeini $scriptdirswearr.txt protect ops is | write -l6 $script if ( $+ $chr(36) $+ nick isop $chr(36) $+ chan) halt | .reload -rs $script } }
if ($did == 19) { if ($ini($scriptdirswearr.txt,protect,voice)) { remini $scriptdirswearr.txt protect voice | write -l7 $script ;if ( $+ $chr(36) $+ nick isvoice $chr(36) $+ chan) { halt } | .reload -rs $script } | else { writeini $scriptdirswearr.txt protect voice is | write -l7 $script if ( $+ $chr(36) $+ nick isvoice $chr(36) $+ chan) halt | .reload -rs $script } }
}