| View previous topic :: View next topic |
| Author |
Message |
DJmart Voice
Joined: 08 Mar 2006 Posts: 21
|
Posted: Thu Dec 21, 2006 10:14 pm Post subject: Flood Protection addition. |
|
|
Hey guys, I have this program here:
| Code: | bind pub - !rules my:example
proc my:example {nick uhost hand chan text} {
set url "http://testurl.com"
set token [::http::geturl $url]
set content [::http::data $token]
::http::cleanup $content
foreach line [split $content \n] {
putserv "PRIVMSG $nick :$line"
}
} |
I was just looking to have this, so a user cannot say "!rules" 32x and flood my bot. How can I add a configureable flood protection option to this program?
Thank you! |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Fri Dec 22, 2006 2:23 am Post subject: |
|
|
| I would just change the putserv with puthelp, that will automatically send the text at a slower rate (like 1 line per half-second) and it won't flood off. |
|
| Back to top |
|
 |
DJmart Voice
Joined: 08 Mar 2006 Posts: 21
|
Posted: Fri Dec 22, 2006 8:11 am Post subject: |
|
|
That won,t stop anyone from doing "!rules !rules !rules" etc... it will just send the messages out much slower, but still sending mass messages out.
right?
-DJ |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Fri Dec 22, 2006 12:37 pm Post subject: |
|
|
| If people wanna see the rules 32x in their own privmsg, I don't see the problem. They're just annoying themselves. In any case, if they are spamming xx lines per minute, eggdrop already has the ability to kick flooders off, so use those features. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Dec 22, 2006 1:13 pm Post subject: |
|
|
| user wrote: | | http://forum.egghelp.org/viewtopic.php?t=9009#45537 |
Man, your code is beautiful  _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|