Anti Bad Word Dialog

By AmyOUfan on Jan 08, 2009

This is alot like my anti spam dialog but it is WORD spacific. Add the words you do not allow in your room like raceist words & etc. And this script will warn people two times before kicking them with a 1 min ban.

menu {
Bad Words Kick: { dialog -m BwordKick BwordKick }
}
dialog BwordKick {
title "Bad Word Kicker"
size -1 -1 197 111
option dbu
icon pictures\RedAlert.ico, 0
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.
Jethro   -  Jan 16, 2010

I know one way you can do is create a custom text event as such, but this method has a drawback: this only works for people with the script installed, those who don't will still see the bad words being said.

on ^*:TEXT:*:#: {
  var %x = word1 word2 word3 word4 word5 word6 word7
  var %y = $numtok(%x,32)
  while (%y) {
    if ($gettok(%x,%y,32) isin $strip($1-)) {
      echo -mt # < $+ $nick($chan,$nick).pnick $+ > <censored>
      haltdef
    }
    dec %y
  }
}

Plus this will block the whole sentence instead of masking the bad words themselves. So overall, it's not a good approach.

sukhbira  -  Jan 17, 2013

good

Sign in to comment

Klasic Kumputerz   -  Jan 15, 2010

The part that doesn't seem to work is the ban. It just kicks. I changed from kick to ban, but the timer doesn't work no matter how I set the "u30" setting to. Can this be set so that the bad word said is masked over like ?

 Respond  
Klasic Kumputerz   -  Jan 15, 2010

This doesn't seem to be working.

 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.