Flood Protection

By jackster35-1 on Jul 25, 2010

This is a quick snippet I made. It flood protects your channel.
It only works if the channel has it enabled.

Commands:
!flood on -- Turns flood protection on for that channel.
!flood off -- Turns flood protection off for that channel.

Thanks, enjoy!

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;    Made By Jackster35     ;;;;;;;
;;;;;;;;; http://jackster35.co.uk/  ;;;;;;;
;;;;;;;;;       DO NOT COPY!        ;;;;;;;
;;;;;;;;; Hawkee user: Jackster35-1 ;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

on *:TEXT:*:#:{
  if (%flood. [ $+ [ $chan ] ] == on) {
    inc -u5 %flood. [ $+ [ $nick ] ] 1
    if (%flood. [ $+ [ $nick ] ] >= 5) {
      /mode $chan +b $address($nick,0)
      /kick $chan $nick Flood Protection activated! This ban will expire in 10 minutes.
      .timer 1 600 /mode $chan -b $address($nick,0)
    }
  }
}
on *:TEXT:!flood *:#:{
  if ($nick isop $chan) {
    if ($2 == on) {
      set %flood. [ $+ [ $chan ] ] on
      msg $chan Flood protection now on. People will now be kick with 5 lines or more.
    }
    if ($2 == off) {
      unset %flood. [ $+ [ $chan ] ]
      msg $chan Flood protection now off.
    }
  }
  else {
    msg $chan Error: Only ops can use this command.
  }
}

Comments

Sign in to comment.
TMFKSOFT   -  Jul 27, 2012

The reason '!flood on' is not working is because "on :TEXT::#:{" is define before "on :TEXT:!flood :#:{" so all text is captured by "on :TEXT::#:{", put simply swap the two on *:TEXT sections around then it will work!

 Respond  
Person   -  Aug 11, 2011

coolbeans :)

 Respond  
Jethro   -  Aug 10, 2011

Yes Person, when people engage in a text flood and enter more than or equal to 5 lines within 5 seconds, they get three warnings each time until they get kicked/banned at the 4th offense.

 Respond  
Person   -  Aug 10, 2011

So the script that jethro just posted up there ^ , if you copy that and paste it in remotes, does that mean when people flood ,they will get a notice first from the person who is using that script?

 Respond  
Jethro   -  Jul 19, 2011

tttwebsite wrote:> can you put in warnings please so that it will send a notice to stop doing it like give three warnings thin kick then ban please

on @*:text:*:#: warn $1-
on @*:action:*:#: warn $1-
on @*:notice:*:#: warn $1-
alias -l warn {
  if (%flood. [ $+ [ # ] ] == on) {
    inc -u5 %flood. [ $+ [ $wildsite ] ]
    if (%flood. [ $+ [ $wildsite ] ] >= 5) {
      hinc -m w $wildsite
      if ($hget(w,$wildsite) > 3) {
        ban -ku600 # $nick 2 Flood Protection activated! $&
          This ban will expire in 10 minutes. | hdel w $wildsite | return
      }
      goto $v1
      :3 | notice $nick Please get your act together. This is your last warning! | halt
      :2 | notice $nick Please stop flooding. This is your 2nd warning! | halt
      :1 | notice $nick No flooding please!
    }
  }
}
 Respond  
tttwebsite   -  Jul 19, 2011

can you put in warnings please so that it will send a notice to stop doing it like give three warnings thin kick then ban please

 Respond  
Pass   -  Dec 17, 2010

No, never once even thought about using twitter. I personally am not a fan of that jazz. :P

 Respond  
Jethro   -  Dec 17, 2010

Pass, out of curiosity, do you tweet? :/

 Respond  
Pass   -  Dec 17, 2010

Jethro_, contrary to what you may think, my comment was quite self-explanatory. The code snippet would just be holding someone's hand through the coding process that obviously already knows a little bit about what they're doing. As for a constructive comment- it's better to explain one's thoughts/ideas out thoroughly, instead of using terms that don't appeal to the masses.
If you find the need to continue this senseless game of comment-tag, just send me a private message. Thanks

 Respond  
Jethro   -  Dec 16, 2010

Why is that not constructive? You use a generic term to introduce it to those who don't know. Every one of us surely wasn't born to know something until we learn something, correct? God forbid, it's a different story to melodramatically sensitive folks who can't take good comments for bad ones...

Moreover, it's always a good idea to include a code demonstration to show what you mean by what you've said. Many times we say a bunch of things trying to decipher a topic, but only to result misunderstanding or confusion to those who read our posts. As they say, a picture is worth a thousand words.

 Respond  
Pass   -  Dec 16, 2010

Jethro_, because if i simply said "Use dynamic variables" it would defeat the purpose of posting constructive comments, especially if not all users understand the concept. Thanks for the concern though. :)

 Respond  
Jethro   -  Dec 15, 2010

Okie doke...point taken. :-)

 Respond  
jaytea   -  Dec 15, 2010

$network isn't guaranteed to be unique; $cid is. and $site is recommended over $wildsite since it's slimmer :P

 Respond  
Jethro   -  Dec 15, 2010

Pass, why don't you just refer to it as dynamic variable? :P Yeah it's a nice suggestion $+(%,flood,.,#,.,$cid,.,$site) $site is recommended over $nick.

Edited as per jaytea's suggestion

 Respond  
Pass   -  Dec 15, 2010

I'd suggest looking into making the (%flood.#chan (and/or %flood.nick)) variable(s) server-specific, instead of just channel/user specific. This will prevent problems if, for example, you're on the channel #Help on two different servers or there's a user on each server with the same nick.

 Respond  
Jethro   -  Dec 15, 2010

Bielie:

if ($1-2 == !flood on) {
 Respond  
Bielie   -  Dec 15, 2010

couldve used
if ($1 == !flood) && ($2 == on) {

 Respond  
Jethro   -  Aug 13, 2010

You can also use regex in the match text section and use the /S modifier.

P.S. I really don't see the point of having two text events when one will do.

 Respond  
WorldDMT   -  Aug 13, 2010

that's because of Ctrl+K Ctrl+B and other so you have to use $strip()

 Respond  
jackster35-1   -  Aug 13, 2010

I know. Sometimes it doesn't reply to another user. That's what I'm trying to figure out. :)

 Respond  
WorldDMT   -  Aug 13, 2010

When I say !flood on nothing happens.

if the code was loaded in your mIRC that wont play this is ON TEXT event so it's execuse only for other user not u

 Respond  
jackster35-1   -  Aug 12, 2010

Yeah Tannn3r. I have the same problem, I'm trying to resolve it. I'll keep you posted. :)
Thanks for the nice comment AlmerC. :)

 Respond  
Tannn3r   -  Aug 11, 2010

When I say !flood on nothing happens.

 Respond  
AlmerC   -  Jul 26, 2010

lol nice i agree with WorlDMT but overall this is pretty good. Love ur avatar btw :3

 Respond  
WorldDMT   -  Jul 25, 2010

no need to put "1" after /inc and no need to evaluate the identifier when u set a variable just set %var $+ $identifer
u can regroup on text event and use $wildsite is better than $address($nick,0)
remember mode +m and/or +i

 Respond  
jackster35-1   -  Jul 25, 2010

Comment/rate/like please :D

 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.