Badword Filter

By Jamiie on Aug 06, 2008

This is from boredom one day, thanks to Typo for helping with majority of it!

Triggers:
/badon (turns badword filter on.)
/badoff (turns badword filter off.)
/addw (adds badword to list)
/badwchan (adds a channel to the badword protection list)

on *:text:*:#: {
  if ($chan == $eval($+(%,badwchan,.,$chan),2)) {
    if (%badw == on) {
      var %nbw $lines(badw.txt)
      while (%nbw) {
        if ($read(badw.txt, %nbw) isin $1-) {
          inc $+(%,badwnick,.,$nick) 1
          if ($($+(%,badwnick,.,$nick),2) == 1) { .notice $nick First warning, do not say that badword again. }
          if ($($+(%,badwnick,.,$nick),2) == 2) {
            cs kick $chan $nick
            .notice $nick Warned you the first time, this is your last. Next time will be a kickban/akick.
        }
          if ($($+(%,badwnick,.,$nick),2) >= 3) {
            ban -k $chan $nick
            .notice $nick That was your last warning.
        }
      }
        dec %nbw
      }
    }
  }
}
alias badon {
  if (%badw == on) {
    echo -a Badword filter is already on!
  }
  else {
    set %badw on
    echo -a Badword filter is now on!
  }
}
alias badoff {
  if (%badw == off) {
    echo -a Badword filter is already off!
  }
  else {
    set %badw off
    echo -a Badword filter is now off!
  }
}
alias addw {
  if ($1 == $read(badw.txt,w,$1)) {
    echo -a That word is already on the badword list!
  }
  else {
    write badw.txt $1
    echo -a Badword has been added to the badword list!
  }
}
alias remban {
  unset $+(%,badwnick,.,$1)

}
alias badwchan {
  if ($1 == $read(badwchan.txt,w,$1)) {
    echo -a That channel is already on the list!
  }
  else { 
    set $+(%,badwchan,.,$1)
    write badwchan.txt $1
    echo -a  Channel: $1 is now on channel protection list!
  }
}

Comments

Sign in to comment.
worldwide7477   -  May 15, 2012

This would be nice if someone would let me know how to get this to work through a bot it works for mirc but not on the channel for my chat I tried to change the first line for channel but nothing please help.....on @:text::#channel: {

 Respond  
AHBARAR   -  Aug 07, 2008

i think it work on hell* if u add hell as swear word check that to be sure and would this work on multi words as fu ck .. etc

 Respond  
napa182   -  Aug 06, 2008

on ur ban line how about setting a banmask to it cuz they can just change nicks so maybe
for ircd

ban -k $chan $nick 2

for Chatspace

ban -k $chan $nick 4

i dont see why you add a var for the channel and then write it to a txt file.. just add the channel to a var then use tokens to check the channel maybe like this

alias badwchan { 
  if (!$istok(%badwchan,$1,44)) {
    echo -a Channel: $1 is now on channel protection list!
    set %badwchan $addtok(%badwchan,$1,44)
  }
  else { echo -a That channel is already on the list! }
}

and then use this line to check for the channel on ur on text

if ($istok(%badwchan,$chan,44) && %badw == on) {

another thing is that it warns/kick/ban\'s for wildcard matches like say i add hell for a bad word it triggered on hello =/

[12:20 am] hello
[12:20 am] -sick0- First warning, do not say that badword again.
[12:20 am] hello
[12:20 am] -sick0- Warned you the first time, this is your last. Next time will be a kickban/akick.
=/

 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.