Racism Filter - Version 1.0

By dezzertv on Dec 11, 2011

Screenshots

since i won't advertise racism replace word 1 - 9 with common racist words (You can add more if you wish)

this can also be used to make a swear filter :).

on *:TEXT:*:#: { 
  if ($me isop #) {
    if ($nick !isop $chan) && ($regex($1-,/(word1|word2|word3|word4|word5|word6|word 7|word8|Word9)/g)) { 
      kick $chan $nick | msg $chan --> $nick $+ , We don't support racism here be gone >( 
    } 
  }
}

Comments

Sign in to comment.
dezzertv   -  Dec 11, 2011

yeah guys im a newb to regex and ty for the advice jethro :) > liked your advice.

 Respond  
Jethro   -  Dec 11, 2011

That's when the $& aka line break identifier comes in handy:

var %w = /word1|word2|word3|word4|word5|$&
$+ word6|word 7|word8|Word9|...|...|...|...|...|$&
$+ .../iS
if ($regex($1-,%w)) {

this allows you to break up a long line of code into the next one and so on...

The downside is that $& cannot apply to on text regex. ^^ I'm fairly certain that you can do it through the $regex() without using a temp variable as shown, but I have yet to give it a whirl.

 Respond  
Frenetic   -  Dec 11, 2011

Yeah..but by the time that's done it'd be too big to fit into mIRC's remotes, well without it cutting off at least. Lol.

 Respond  
Jethro   -  Dec 11, 2011

It's a no-brainer really that the way of using regex to look for bad words is that you have to keep on adding them until you have everything covered...

 Respond  
Frenetic   -  Dec 11, 2011

It's all very nice & well but what if they say something not on the "filter" lol

 Respond  
Jethro   -  Dec 11, 2011

You can "simplify" it a tad:

on $@*:text:/word1|word2|word3|word4|word5|word6|word 7|word8|Word9/iS:#:{ 
  if ($nick !isop #) { 
    kick # $nick We don't support racism here be gone >( 
  } 
}
 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.