| View previous topic :: View next topic |
| Author |
Message |
seiji Voice
Joined: 22 Nov 2012 Posts: 2
|
Posted: Thu Nov 22, 2012 9:07 pm Post subject: rss synd trigger flood protection |
|
|
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 |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Nov 23, 2012 11:07 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
seiji Voice
Joined: 22 Nov 2012 Posts: 2
|
Posted: Fri Nov 23, 2012 7:39 pm Post subject: |
|
|
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? |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Nov 24, 2012 5:23 am Post subject: |
|
|
If you have 0.4 then at line 250 and 253 you will see:
| Quote: |
proc ::rss-synd::pub_trigger {nick user handle chan text} {
proc ::rss-synd::pub_trigger {nick user handle chan text} {
|
add after each:
| Code: |
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:
| Quote: |
set text [lindex $args $i]
|
add:
| Code: |
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. |
|
| Back to top |
|
 |
|