ban on certain words

By Stewie1k94 on May 09, 2011

this is a script that will auto ban someone if they use a certain word

where is says word1 word2 and word3 u can change to whatever word u want the bot to ban someone on and when they say the word set it will ban and kick them

on $*:text:/(word1|word2|word3)/Si:#:{
  ban -ku900 $chan $address($nick,2)
  kick $chan $nick 4(automatic 15 min ban)we dont use that word here now GTFO
}

Comments

Sign in to comment.
Stewie1k94   -  May 12, 2011

thanks for your comment and i will see what i can do

 Respond  
Zmodem   -  May 11, 2011

Why not make an INI file that allows you to add the words to? This will make adding TONS of words easier. So, in an ini file, you have it laid out as:

[words]
badword=kick
badderword=kick,ban

Etc. You could set the option to kick and ban the users, just kick, warn, etc, depending on the level. Then, all you need is a loop to scan and make sure that the word is not in the file. You would want to load the INI into an active hash so that way scanning is easier. Anyways, just my 2 cents ;)

 Respond  
Stewie1k94   -  May 09, 2011

just ive never used forums not sure how lol

 Respond  
Stewie1k94   -  May 09, 2011

sorry whateva

 Respond  
Conscious   -  May 09, 2011

Help should be asked for in the forums not on unrelated snippets..

 Respond  
Stewie1k94   -  May 09, 2011

and thanksfor ur suggestion before jethro_ on the ban script

 Respond  
Jethro   -  May 09, 2011

The way you have it, for instance:> blah blah blah word1 blah <- This won't trigger.

word1 <- this will trigger, but on a one-word basis. In other words, it'll trigger when nothing attaches to or follows it.

Take out the ^ and $ so the bad words will be matched in a sentence.

It's ok if you need to watch out for a few bad words using the on text regex approach. It's not recommendable if you want to look out for more bad words or add or delete more of them.

The best method I've known is using a hash table and

$hfind(badwords,$strip($1-),1,w).data

to match against words added in it. You can also use the -r switch for regex. word1|word2|word3|etc.. to be stored in hash table's data.

I won't go into detail of the hash table if you don't know about it. Read up on it at your leisure.

 Respond  
Stewie1k94   -  May 09, 2011

so having it like

on @$*:text:/^(word1|word2|word3)$/Si:#:{

is better or summat?

 Respond  
Jethro   -  May 09, 2011

Since you've used the ^ caret and $ symbol, it'll mean that every bad word has to be masked in the beginning of a sentence and ends as it is. In other words, this code won't trigger if those bad words of your choice are scolded within a sentence.

P.S. you can shorten your kick/ban operation as such:

ban -ku900 # $nick 2 4(automatic 15 min ban)we dont use that word here now GTFO

, which does the exactly same thing as yours. You should also make sure the client running the code is opped in channel by prefixing @ to the text event. You don't want mIRC to return an error if it's not opped before kicking/banning. > on @$*:text:

 Respond  
Stewie1k94   -  May 09, 2011

lmao but what i said istn really offensive im using this for really offensive words

 Respond  
Conscious   -  May 09, 2011

Also don't you find it ironic that you swear at them in the kick message for using "bad words"?

 Respond  
Stewie1k94   -  May 09, 2011

i could try sort that out

 Respond  
Conscious   -  May 09, 2011

What if someone says: Hello nick, you are a word1 - it wouldn't trigger for that -.-

 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.