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.

Flood Protection addition.

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
D
DJmart
Voice
Posts: 21
Joined: Wed Mar 08, 2006 8:32 pm

Flood Protection addition.

Post by DJmart »

Hey guys, I have this program here:

Code: Select all

 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!
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

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.
D
DJmart
Voice
Posts: 21
Joined: Wed Mar 08, 2006 8:32 pm

Post by DJmart »

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
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Have you ever read "The Manual"?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

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.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Man, your code is beautiful :D
Post Reply