menu * {
BadWords Dialog: { /BwdI }
}
alias BwdI {
{ .dialog -m Bwordignore Bwordignore | .splay zip.wav }
}
dialog Bwordignore {
title "Bad Word Ignore"
size -1 -1 244 104
option dbu
list 1, 7 11 125 77, sort size vsbar
box "", 2, 3 3 183 98
button "Add WORD", 3, 142 12 37 12
button "Delete WORD", 4, 142 28 37 12
button "Ok/Cancel", 5, 142 76 37 12, ok cancel
button "Turn On", 6, 142 44 37 12
button "Turn Off", 7, 142 60 37 12
edit $group(#badwords), 10, 154 89 14 10
edit "Bad Word Kicker - [/BwdK]", 11, 31 89 70 10, center
}
on *:dialog:Bwordignore:init:*: {
/loadbuf -ro Bwordignore 1 badwords.txt
did -ra $dname 10 $group(#badwords)
dll $mdx SetMircVersion $version
dll $mdx MarkDialog $dname
dll $mdx SetFont $dname
dll $mdx SetColor $dname
dll mdx.dll SetBorderStyle 10 14 50 Georgia Bold
dll mdx.dll SetColor $dname 10 text $rgb(%list1colour,%list2colour,%list3colour)
dll $mdx SetFont $dname 10 14 40 Georgia Bold
dll $mdx SetColor 10 text $rgb(255,0,0)
}
alias badwords {
set %badwords $$?="Add Kick Words Here"
write badwords.txt %badwords
loadbuf -ro Bwordignore 1 badwords.txt
}
on *:Dialog:Bwordignore:sclick:1: { set %sel.text $did(1).seltext }
on *:Dialog:Bwordignore:sclick:3: { badwords }
on *:Dialog:Bwordignore:sclick:4: { write -ds $+ %sel.text badwords.txt | loadbuf -ro Bwordignore 1 badwords.txt }
on *:Dialog:Bwordignore:sclick:*:{
if ($did == 6) { if (False isin %badwords) { halt }
if ($input(Are you sure you want to Enable Bad Words Kick?,y)) { .enable #badwords | did -ra $dname 10 $group(#badwords) | .echo $active 0,4Bad Words Kick 0,12Enabled } }
}
if ($did == 7) { if (False isin %badwords) { halt }
if ($input(Are you sure you want to Disable Bad Words Kick?,y)) { .disable #badwords | did -ra $dname 10 $group(#badwords) | .echo $active 0,12Bad Words Kick 0,4Disabled | unset %badwords | unset %sel.text }
}
#badwords off
on @*:TEXT:*:#:{
if ($nick isop $chan) { return }
var %i = $lines(badwords.txt)
while (%i) {
if ($read(badwords.txt,%i) isin $1-) {
set -u30 %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] $calc( %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] + 1)
if (%rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] >= 1) {
{ .ignore -p $+(*!*, $Ial($nick).addr) | .closemsg $nick }
unset %rl.*
}
}
dec %i
}
}
on *:ACTION:*:#: {
if ($nick isop $chan) { return }
var %i = $lines(badwords.txt)
while (%i) {
if ($read(badwords.txt,%i) isin $1-) {
set -u30 %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] $calc( %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] + 1)
if (%rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] >= 1) {
{ .ignore -p $+(*!*, $Ial($nick).addr) | .closemsg $nick }
unset %rl.*
}
}
dec %i
}
}
on *:CTCPREPLY:*:#: {
if ($nick isop $chan) { return }
var %i = $lines(badwords.txt)
while (%i) {
if ($read(badwords.txt,%i) isin $1-) {
set -u30 %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] $calc( %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] + 1)
if (%rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] >= 1) {
{ .ignore -p $+(*!*, $Ial($nick).addr) | .closemsg $nick }
unset %rl.*
}
}
dec %i
}
}
on !*:part:#: {
if ($nick isop $chan) { return }
var %i = $lines(badwords.txt)
while (%i) {
if ($read(badwords.txt,%i) isin $1-) {
set -u30 %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] $calc( %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] + 1)
if (%rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] >= 1) {
{ .access $chan add deny $+(*!*, $Ial($nick).addr) 0 : BadWords }
unset %rl.*
}
}
dec %i
}
}
on !*:TEXT:*:?: {
if ($nick isop $chan) { return }
var %i = $lines(badwords.txt)
while (%i) {
if ($read(badwords.txt,%i) isin $1-) {
set -u30 %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] $calc( %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] + 1)
if (%rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] >= 1) {
{ .ignore -p $+(*!*, $Ial($nick).addr) | .closemsg $nick }
unset %rl.*
}
}
dec %i
}
}
#badwords end