| View previous topic :: View next topic |
| Author |
Message |
cimeran Voice
Joined: 04 Mar 2011 Posts: 9
|
Posted: Fri Mar 04, 2011 11:56 pm Post subject: Run function every X seconds? |
|
|
Hi folks. New to eggdrop and appreciate any help.
Goal: to monitor an RSS feed and post new items as quickly as possible to a channel.
Found an rss tcl script or two that does what I need, but I'd like to set it to run the required function every x seconds instead of every x minutes (bind time line).
This possible in eggdrop? Of course if anyone has a better idea of how to implement this I'm all ears.
Thanks in advance and I hope this is the correct forum to post to. |
|
| Back to top |
|
 |
cimeran Voice
Joined: 04 Mar 2011 Posts: 9
|
Posted: Sat Mar 05, 2011 12:12 am Post subject: Re: Run function every X seconds? |
|
|
Whoops, found what I needed. From the Eggdrop FAQ I changed...
| Code: |
if {![info exists myproc_running]} {
timer 20 myproc
set myproc_running 1
}
proc myproc {} {
# your stuff here ...
# ...
timer 20 myproc
return 1
}
|
...to use "utimer" instead of timer. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Mar 05, 2011 3:17 am Post subject: |
|
|
How often is that RSS feed being updated? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
cimeran Voice
Joined: 04 Mar 2011 Posts: 9
|
Posted: Sat Mar 05, 2011 3:57 am Post subject: Re: Run function every X seconds? |
|
|
| caesar wrote: | | How often is that RSS feed being updated? |
A few times a minute. The big thing is that we have to get from the rss feed to the room as quickly as we can. The utimer is set to 10 seconds right now and it seems to be running okay. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Mar 05, 2011 4:18 am Post subject: |
|
|
A few times a minute? What's that feed about?
There's no need to fetch the rss if it isn't updated any sooner, cos you will end up stressing out the server that hosts the feed and you will get banned sooner or later (only if it isn't your server).  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Jagg Halfop
Joined: 24 Jan 2004 Posts: 53
|
Posted: Mon Mar 07, 2011 2:34 pm Post subject: |
|
|
@cimeran
How do you check the rss feed for new entries and only let the bot post the new ones? I'm also interested in such a script. Thanks |
|
| Back to top |
|
 |
cimeran Voice
Joined: 04 Mar 2011 Posts: 9
|
Posted: Wed Mar 09, 2011 3:23 pm Post subject: |
|
|
I'm using the rss-synd script on the tcl script archive. It caches the last instance of the file and only posts the new items. Search for it and I'm sure you'll find it.
As for the other question, it's a news feed that needs to be close to instantaneous. We own the server so no possibility of getting banned. |
|
| Back to top |
|
 |
|