egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Command Flood Protection

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Jue
Voice


Joined: 30 Jun 2009
Posts: 5

PostPosted: Tue Jul 21, 2009 1:50 pm    Post subject: Command Flood Protection Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Wed Jul 22, 2009 1:32 pm    Post subject: Reply with quote

see This post
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Jue
Voice


Joined: 30 Jun 2009
Posts: 5

PostPosted: Wed Jul 22, 2009 5:54 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Thu Jul 23, 2009 12:42 pm    Post subject: Reply with quote

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
Quote:
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)
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Jue
Voice


Joined: 30 Jun 2009
Posts: 5

PostPosted: Thu Jul 23, 2009 1:00 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Fri Jul 24, 2009 1:01 pm    Post subject: Reply with quote

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:
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
Quote:
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.
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber