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.

rss synd trigger flood protection

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
seiji
Voice
Posts: 2
Joined: Thu Nov 22, 2012 8:19 pm

rss synd trigger flood protection

Post by seiji »

Hello!
I'm looking for a trigger flood protection for the rss synd script.
http://code.google.com/p/rss-synd/
Is there an easy way to add this for the following scenario.

nick1>!trigger
bot>rss news
nick2>!trigger
bot>rss news
nick 5>!trigger
bot>rss news
nick1>!trigger

Is there an easy way to make the bot do this instead:

nick1>!trigger
bot>rss news
nick2>!trigger
bot silant ignore for the next 5 minutes
nick3>!trigger
nick5>!trigger
nick8>!trigger
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Hi,

user created a throttled function that you can use to achieve what you want.

Check out his topic as there's even an easy example.
Once the game is over, the king and the pawn go back in the same box.
s
seiji
Voice
Posts: 2
Joined: Thu Nov 22, 2012 8:19 pm

Post by seiji »

Well, thanks but I don't have a clue how to apply that code to the tcl.

I got it to execute, but.
First time it executes, !trigger shows the news, then on a new line it says "allowed (wait 30 seconds)"

Second, third, and so on, times it still executes the !trigger and shows the RSS news, and then says "denied. (wait or try a different channel)" but it continues to execute on !trigger.Never stops.

Is there another RSS script for eggdrop that has !trigger protection?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

If you have 0.4 then at line 250 and 253 you will see:
proc ::rss-synd::pub_trigger {nick user handle chan text} {

proc ::rss-synd::pub_trigger {nick user handle chan text} {
add after each:

Code: Select all

if {![throttled $nick,$chan 30]}
replace 30 with how many seconds you wish, then write in a file called throttled.tcl for instance, one of the codes user made, either the one with the time bind or with timers to do the cleanup.

Don't forget to load this file before the source scripts/rss-synd.tcl or whatever you have in your eggdrop's configuration file, then rehash and that's it. It should have this protection working.

If you happen to use the latest version (v0.5b1 at this time) then after the line 281:
set text [lindex $args $i]
add:

Code: Select all

if {[llength $chan]} {
	if {[throttled $nick,$chan 30]} return
} else {
	if {[throttled $nick,$user 30]} return
}
haven't tested anything, but in theory at least, it should work. :)
Once the game is over, the king and the pawn go back in the same box.
Post Reply