Anti Bad Words Kick

By AmyOUfan on Jan 05, 2009

This IS WORD spacific, if you want to ban raciest words or ANY word you do not allow in the room it will warn the chatter 2 times , 3rd time they do it it kicks them. With a 1 min ban. id like to thank Jethro_ for helping me correct a simple problem with it.

menu {
Bad Words Kick: { dialog -m BwordKick BwordKick }
}
dialog BwordKick {
title "Bad Word Kicker"
size -1 -1 197 111
option dbu
list 1, 7 11 125 77, sort size vsbar
box "", 2, 3 3 183 94
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
}
on
:dialog:BwordKick:init:: {
loadbuf -ro BwordKick 1 badwords.txt
}
alias badwords {
set %badwords $$?="Add Kick Words Here"
write badwords.txt %badwords
loadbuf -ro BwordKick 1 badwords.txt
}
on
:Dialog:BwordKick:sclick:1: { set %sel.text $did(1).seltext }
on :Dialog:BwordKick:sclick:3: { badwords }
on
:Dialog:BwordKick:sclick:4: { write -ds $+ %sel.text badwords.txt | loadbuf -ro BwordKick 1 badwords.txt }
on :Dialog:BwordKick:sclick::{
if ($did == 6) { .enable #badwords | echo -a Bad Word Kick Enabled }
if ($did == 7) { .disable #badwords | echo -a Bad Word Kick Disabled | unset %badwords | unset %sel.text }
}

badwords off

on :TEXT::#: {
if ($nick !isop $chan) && ($nick !isowner $chan) {
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) {
.msg $chan No Bad Words $nick $+ ! first warning!
}
if (%rl. [ $+ [ $+(!, $Ial($nick).addr) ] ] == 2) {
.msg $chan Second warning, No Bad Words $nick second warning $+ .
}
if (%rl. [ $+ [ $+(!, $Ial($nick).addr) ] ] >= 3) {
kick # $nick :No Bad Words | .raw access # add deny $+(!, $Ial($nick).addr) 1 : $+ %Nick banned by $Me
unset %rl.
}
}
dec %i
}
}
}
on
:ACTION::#: {
if ($nick !isop $chan) && ($nick !isowner $chan) {
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) {
.msg $chan No Bad Words $nick $+ ! first warning!
}
if (%rl. [ $+ [ $+(
!, $Ial($nick).addr) ] ] == 2) {
.msg $chan Second warning, No Bad Words $nick second warning $+ .
}
if (%rl. [ $+ [ $+(
!, $Ial($nick).addr) ] ] >= 3) {
kick # $nick :No Bad Words | .raw access # add deny $+(
!, $Ial($nick).addr) 1 : $+ %Nick banned by $Me
unset %rl.

}
}
dec %i
}
}
}
on :CTCPREPLY::#: {
if ($nick !isop $chan) && ($nick !isowner $chan) {
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) {
.msg $chan No Bad Words $nick $+ ! first warning!
}
if (%rl. [ $+ [ $+(!, $Ial($nick).addr) ] ] == 2) {
.msg $chan Second warning, No Bad Words $nick second warning $+ .
}
if (%rl. [ $+ [ $+(!, $Ial($nick).addr) ] ] >= 3) {
kick # $nick :No Bad Words | .raw access # add deny $+(!, $Ial($nick).addr) 1 : $+ %Nick banned by $Me
unset %rl.*
}
}
dec %i
}
}
}

badwords end

Comments

Sign in to comment.
jaystew   -  Jan 20, 2012

I like this script - i edited so it would do 1st warn 2nd kick and 3rd 15min ban - It would be better if you could have it set so it only triggers in a certains channels not all.

Also i noticed if you told it to wach for the word ... post if you said unpostit then it would still trigger it.

 Respond  
AmyOUfan   -  Jan 08, 2009

well i dont know about how other servers work just ones i go to.

 Respond  
AnDyWong   -  Jan 07, 2009

raw access # add deny $+(!, $Ial($nick).addr) 1 : $+ %Nick banned by $Me
ACCESS add Parameter invalid ??

 Respond  
napa182   -  Jan 05, 2009

hmm maybe add so it will only work on channels you want it to.

Maybe instead of useing this

dialog -m BwordKick BwordKick

you can use this so you wont get an error

dialog $iif($dialog(BwordKick),-v,-md) BwordKick BwordKick

also if you have no txt file named badwords.txt it will give an error when you open the dialog

so you may want to add a check if the file is there so instead of

loadbuf -ro BwordKick 1 badwords.txt

you can do

if ($file(badwords.txt)) { loadbuf -ro BwordKick 1 badwords.txt }

but keep up the coding 4/10

 Respond  
Aucun50   -  Jan 05, 2009

Maybe when they rejoin if they do it can say you are being watched because of previous things you have said, then if they do it again it will ban for a longer time.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.