Bad Word Kick/Ban

By gooshie on Dec 28, 2009

This is an op script to auto-kick/ban if someone uses forbidden words in a channel or private message. The word list is regex and editable through a simple input dialog box. An on load event will set the initial list of words to global variable %bwkb and by using command /bwkb you may access the forbidden word list editor. Includes auto-ignore for same length of time.

Image

on @*:TEXT:*:#:bwkb 0 $1-
on @*:ACTION:*:#:bwkb 0 $1-
on @*:NOTICE:*:#:bwkb 0 $1-
on ^*:OPEN:?:bwkb 1 $1-
on *:TEXT:*:?:bwkb 1 $1-
on *:ACTION:*:?:bwkb 1 $1-
on *:NOTICE:*:?:bwkb 1 $1-
alias bwkb {
  if $regex($2-,%bwkb) {
    var %c,%i 1
    while $comchan($nick,%i) {
      %c = $v1
      if $nick(%c,$me,~&@%) {
        ban -ku600 %c $nick 2 Ten minute ban for foul $+(language,$iif($1,$chr(32) in private message),!)
      }
      inc %i
    }
    .ignore -pntidu600 $nick 2
  }
  elseif ($1 = $null) $iif($input(/word1|\bword2\b|wo?rd3/iS,e,RegEx for BadWord Kick/Ban,%bwkb),set %bwkb $!)
}
on 1:load:{ set %bwkb /bitch|bastard|cunt|cock|fuc?k|h[o0]rn(ie|y)| $&
  $+ nigger|\btwat\b|whore|penis|shit|\bcibai\b|dick|pussy|slut/iS }

Comments

Sign in to comment.
Jethro   -  Nov 13, 2011

chachin, that's because this snippet doesn't have an exclusion check for ops. You need to implement one to keep it from kicking and banning ops.

 Respond  
chachin   -  Nov 13, 2011

this thing kickbans other ops now im in trouble D:
cus im not owner of the channel im using this script

 Respond  
napa182   -  Jul 03, 2011

gooshie, you are welcome an yes I still linger around this site. lol...
Yes please post that way we can get Hawkee.com out of its pastebin funk that it has sank into once again.
It seems like every so often people use it like a pastebin/trashcan an post snippets that are just not worth sharing.
So its nice to come on the site an see snippets that are worth clicking on to read, test, an whatnot.
Again nice work.

 Respond  
gooshie   -  Jul 03, 2011

napa,
Thanks, a Like from you has more meaning than most.
I've been checking in but haven't been motivated to post for awhile.
I need to put up some more code one day.
Good to see you are still around.

 Respond  
napa182   -  Jul 03, 2011

Another nice snippet that I didn't see. Well done as usual gooshie. 9/10 +Like
also nice to see you around hawkee again. ;x

 Respond  
gooshie   -  Jul 03, 2011

@chachin yvmw

 Respond  
chachin   -  Jun 23, 2011

yay thanks for this awsome snippet :D

 Respond  
MuttCowboy   -  Dec 31, 2009

Nice! Just tried it and it works great!

 Respond  
gooshie   -  Dec 30, 2009

well if someone says mthrfckr (spelled correctly)
they also have said f*ck (spelled correctly)
hence no need for the (m(0|o)th(e|3)r)? or (er)?

 Respond  
Master-Of-Death   -  Dec 30, 2009

btw congratz on the 100+ commenmts and the stupid blocker ironically blocked the example I tried to show you.

 Respond  
Master-Of-Death   -  Dec 30, 2009

on my server people use slang aswell as normal swear words so if you said mofo in full they'd say m0th3rfuck3r hence why i used (x|y) alot.

 Respond  
gooshie   -  Dec 30, 2009

Don't really need (m(0|o)th(e|3)r)? or (er)?
just gonna make it do more work..

 Respond  
Master-Of-Death   -  Dec 30, 2009

works perfectly just tried it.

 Respond  
gooshie   -  Dec 30, 2009

Master-Of-Death
I see a problem in here: |((m(0|o)th(e|3)r)?co|di|fu)ck(er)?|
I think you may be getting a tad carried away with the (x|y)
You say you have little time to test but
I can't really test and learn for you..

 Respond  
Master-Of-Death   -  Dec 30, 2009

query was my regex right? I have little time to test such things.

 Respond  
gooshie   -  Dec 30, 2009

Master-Of-Death
Thanks, but I was just putting the few in the on load event to give it a start.. I put the few diff types of matches with like \b(o|0)\b? to sorta give examples for those usefull flags it includes a simple little $input editor to modify the regex string the way you want by using the command /bwkb

 Respond  
Master-Of-Death   -  Dec 30, 2009

@Gooshie
I thought that may be useful as it covers a few more insults. It may be altered by the built in filter system that hawkee uses to remove swear words, if so i'll pm it to you if that is ok?

Don't be harsh it is my first attempt at regular expressions, lol I did it after a five minute crash course tutorial, so I hope it meets yours and Jethro_'s standards and helps.


on 1:load:{ set %bwkb /bia?tch|bastard|c(un)t|((m(0|o)th(e|3)r)?co|di|fu)ck(er)?|h.rn(ie|i3|y)|nigg(e|3)r|\btw(a|i)t\b|wh(0|o)r(e|3)|p(e|3)nis|(sh|g|cl)it|pussy|sl(ut|ag)/iS }

EDITED TO INCLUDE ALL SWEAR WORDS HENCE:

|c(un)t|

NOT A TYPO.

 Respond  
gooshie   -  Dec 29, 2009

Yup Jethro_ I got tired of trying to get them to post their alternative vaporware solution and just brought mine over here and posted it.. Like I could have done written what they were suggesting/hinting at and been done but I think I was being a real sport to post as much of a solution that I did.. for all their babbling about what they suggest they could have either created their solution or at the very least made a list of all the words that we really need to check for so we don't even need some elaborate editor to add/change the forbidden word list... I sorta like using a set variable for this since I so seldomly use global variables that I only have about 3-4 of them being used.. like this is one of the few times I was gonna be ok with using a global variable and along comes someone wanting to use hash lol..

 Respond  
Master-Of-Death   -  Dec 29, 2009

looks good, wish I understood regex, works great. 10/10 gooshie master of regex ;) + like!

 Respond  
Jethro   -  Dec 29, 2009

Very good, just as you've done it at mirc.com forum request.

 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.