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 

Run function every X seconds?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
cimeran
Voice


Joined: 04 Mar 2011
Posts: 9

PostPosted: Fri Mar 04, 2011 11:56 pm    Post subject: Run function every X seconds? Reply with quote

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


Joined: 04 Mar 2011
Posts: 9

PostPosted: Sat Mar 05, 2011 12:12 am    Post subject: Re: Run function every X seconds? Reply with quote

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


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

PostPosted: Sat Mar 05, 2011 3:17 am    Post subject: Reply with quote

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


Joined: 04 Mar 2011
Posts: 9

PostPosted: Sat Mar 05, 2011 3:57 am    Post subject: Re: Run function every X seconds? Reply with quote

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


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

PostPosted: Sat Mar 05, 2011 4:18 am    Post subject: Reply with quote

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). 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
Jagg
Halfop


Joined: 24 Jan 2004
Posts: 53

PostPosted: Mon Mar 07, 2011 2:34 pm    Post subject: Reply with quote

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


Joined: 04 Mar 2011
Posts: 9

PostPosted: Wed Mar 09, 2011 3:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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