Regex Caps kicker

By FLCL on Oct 24, 2007

Code that kicks a user with more than 65 percent caps and ten characters.

Probably done a million times before but I decided to use hash tables in this so it has a bit of original quality to it.

on @!*:text:*:#:{ 
  if ($nick isreg $chan && $len($remove($1-,$chr(32))) > 10) { 
    if ($calc($regex($1-,/[A-Z]/g) / $v2 * 100) > 65) {
      if (!$hget(capshash)) { hmake capshash }  
      hinc capshash $+(caps,.,$nick,.,$wildsite) 1
      if ($hget(capshash,$+(caps,.,$nick,.,$wildsite)) < 3) { 
        msg $chan $nick $+ , this is your $ord($v1) time you have used excessive capital letters. No more of this conduct or you will be banned.
      }
      if ($hget(capshash,$+(caps,.,$nick,.,$wildsite)) = 3) { 
        ban -ku300 $chan $nick Your text contains $calc($regex($1-,/[A-Z]/g) / $len($remove($1-,$chr(32))) * 100)  percent caps. You have been warned $ord($v1) times. 
        hdel capshash $+(caps,.,$nick,.,$wildsite)
      }
    }
  }
}

Comments

Sign in to comment.
FullMetalAlchemist   -  Nov 20, 2010

THANK YOU!

 Respond  
Jethro   -  Nov 19, 2010

How would you modify this so that it wouldnt active on certain words like..(www./youtube.com/.com/http://)Just add an if check under the text event:

if (!$regex($$1-,/(http\72\/\/|w{3}\.)youtube\.com.*/iS)) {
 Respond  
FullMetalAlchemist   -  Nov 19, 2010

How would you modify this so that it wouldnt active on certain words like..(www./youtube.com/.com/http://)

 Respond  
Klasic Kumputerz   -  Jan 14, 2010

Kewl, Thanks for the help and undertanding! It's much appriciated!

 Respond  
Jethro   -  Jan 14, 2010

Well, that is the author of the script to blame, not the text event. There're lots of them, try another one. Or better yet, ask a script to be made for your under the forum.

 Respond  
Klasic Kumputerz   -  Jan 14, 2010

This one doesn't seem to work as stated by "fahadbalboa" Even after taking the "!" out.

 Respond  
Jethro   -  Jan 14, 2010

Your example this time is correct, but you don't need the exclamation mark. The reason being, you can't possibly trigger your own text. To make it multiple channel specifics, just add more channel names with a comma like so:

on @*:text:*:#channelanme,#channelname2,#channelname3:{

etc...

 Respond  
Klasic Kumputerz   -  Jan 14, 2010

How do you make this script channel specific?

Example:

on @!:text::#channelanme:{

 Respond  
fahadbalboa   -  Mar 01, 2009

didnt work for me :(

 Respond  
FLCL   -  Oct 24, 2007

Comments? Feedback?

 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.