This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Command Flood Protection

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
J
Jue
Voice
Posts: 5
Joined: Tue Jun 30, 2009 5:37 pm

Command Flood Protection

Post by Jue »

I need a script that stops people from flooding the bot with commands.

Say, the bot will only allow a certain person to do 3 commands every 5 seconds or something.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

J
Jue
Voice
Posts: 5
Joined: Tue Jun 30, 2009 5:37 pm

Post by Jue »

Okay, that doesn't exactly do what I want...

A few more things I want the script to do:

Send a notice to the user it ignores. (With the ability to change the message via a small config at the top of the script)
Make the time for the ignore to be kept in place configurable.
And NOT ignore the bot master. (Configurable?)

Thanks in advance.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

are you talking about eggdrop's commands? like the dcc/msg commands. eggdrop.conf has settings that prevent flooding of these commands and settings to ignore users/people that do. As for the sending a notice for this, you could use the flud bind and creat a proc to do this
FLUD (stackable)

bind flud <flags> <type> <proc>
procname <nick> <user@host> <handle> <type> <channel>

Description: any floods detected through the flood control settings (like 'flood-ctcp') are sent here before processing. If the proc returns 1, no further action is taken on the flood; if the proc returns 0, the bot will do its normal "punishment" for the flood. The flood types are: pub, msg, join, or ctcp (and can be masked to "*" for the bind); flags are ignored.

Module: server
:arrow:
set dcc-flood-thr 3 - Specify here the number of lines to accept from a user on the partyline within 1 second before they are considered to be flooding and therefore get booted. (for dcc flood control)
set flood-msg 5:60 - Set here how many msgs in how many seconds from one host constitutes a flood. If you set this to 0:0, msg flood protection will be disabled. (message flood control)
set trigger-on-ignore 0 - If you want Eggdrop to trigger binds for ignored users, set this to 1. (to enable ignoring flooders)
J
Jue
Voice
Posts: 5
Joined: Tue Jun 30, 2009 5:37 pm

Post by Jue »

I have a eggdrop with many scripts...

One of them for example is a counter join script. This counts how many joins there has been and sents a notice to the user telling them they are X person to join.

If someone keeps cycling the channel this will flood the bot and lag it, I want to prevent this from happening...

Other commands are !8ball and .dwhois ect...

Basically ignore ANY commands that are flooded... So after 4 times of ANY of the commands the bot will ignore all commands for about 30 seconds and message the channel with a configurable message.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

In that case, refer to my first post (of this link). If you dont want to take the time to add the "throttle" proc to your scripts, you can try using something like this

Code: Select all

set tf_commands ".dwhois,!dwhois,.8ball,!8ball"
set tf_throttle "30"
set tf_ignoretime "5"
set tf_warning "command/trigger flood detected! You are not being ignored."

proc tf_check:pubm {nick host handle channel text} {
 global tf_commands tf_ignoretime tf_throttle tf_warning botnick
  foreach command [split $tf_commands ,] {
   if {[string match [string tolower [lindex [split $text] 0]] $command]} {
    if {[throttled $host,$channel $tf_throttle]} {
     if {$tf_warning != ""} {
      puthelp "PRIVMSG $channel :$tf_warning"
     }
     newignore [maskhost $host] $botnick "command/trigger flood detected" $tf_ignoretime
     return
    }
   }
  }
}

proc throttled {id time} { 
   global throttled 
   if {[info exists throttled($id)]} { 
      return 1 
   } { 
      set throttled($id) [clock sec] 
      utimer $time [list unset throttled($id)] 
      return 0 
   } 
}

bind pubm -|- "*" tf_check:pubm
As for
One of them for example is a counter join script. This counts how many joins there has been and sents a notice to the user telling them they are X person to join.

If someone keeps cycling the channel this will flood the bot and lag it, I want to prevent this from happening...
I would contact the owner of the script and ask them to add a feature to prevent this, or look for a fly-by/join-part flooding script in the TCL Archive.
Post Reply