Jump to content

Long Text Kick Help


CharmedOne

Recommended Posts

Ok this works but it kicks people who type long sentence's rather than someone using a long text like a flooder i seen that did lololololololololololololololololololololololol. I hate to have it kick the wrong people what did i do wrong :pizza:

 

 

on @!*:text:*:#:{ 
;LongText
  if ($readini($settings(chanoptions.txt),$iif($ini($settings(chanoptions.txt),#,0) != 0,#,Default),LongText)) {
    if ( $me isop # ) {
      var %length = $len($1-)
      if ( %length > 15 ) {
        /access $chan add deny $+(*!*, $Ial($nick).addr) 1 :Long-Text
        /kick # $nick No Long Text One min Ban 
      }
    }
  }
}

Link to comment
Share on other sites

ok... for starters...

    if ( $me isop # ) {

is not needed because you have used the prefix @. In mIRC help file, look up "prefixes".

 

and you should combine if statements if possible. with your code, you have nested statements, but no alternatives within the nested loops so you can join it using &&.

 

now, we can use regular expression for this, saves having to divide the string up and find out each word's length.

 

your final code should look like this...

on @!*:text:*:#:{ 
;LongText
  if ($readini($settings(chanoptions.txt),$iif($ini($settings(chanoptions.txt),#,0) != 0,#,Default),LongText) && $regex($1-, /([^ ]{15,})/g) > 0) {
    /access $chan add deny $+(*!*, $Ial($nick).addr) 1 :Long-Text
    /kick # $nick No Long Text One min Ban 
  }
}

the regex will return how many words longer than 15 in length.

 

for convention, you should stick to one coding style. use # or $chan, try not to cross between.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...