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 

rss synd trigger flood protection

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


Joined: 22 Nov 2012
Posts: 2

PostPosted: Thu Nov 22, 2012 9:07 pm    Post subject: rss synd trigger flood protection Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Nov 23, 2012 11:07 am    Post subject: Reply with quote

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
View user's profile Send private message
seiji
Voice


Joined: 22 Nov 2012
Posts: 2

PostPosted: Fri Nov 23, 2012 7:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sat Nov 24, 2012 5:23 am    Post subject: Reply with quote

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. Smile
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
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