this is a feature in SmartIRC see the FEATURES file (timeevents), you just have to register one like this:
$irc->registerTimehandler(60, $mybot, 'timer_60s');
this will register a timer that is called every 60 seconds, the method that will be called is named timer_60s()
one note, the method in your bot class has to be declared like this:
function timer_60s( &$irc );
there is no &$ircdata... because its a timer.
btw: I forgot to put an example for the timers in the 0.5.0 release, I am sorry about that... 0.5.1 will include it
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
Is their any way of doing timers with phpSmartIRC?
example:
http://phpwizard.net/projects/phpIRC/
like an action handler but its called every x number of seconds. If not, could you possibly add this feature to the next version?
Thanks!
this is a feature in SmartIRC see the FEATURES file (timeevents), you just have to register one like this:
$irc->registerTimehandler(60, $mybot, 'timer_60s');
this will register a timer that is called every 60 seconds, the method that will be called is named timer_60s()
one note, the method in your bot class has to be declared like this:
function timer_60s( &$irc );
there is no &$ircdata... because its a timer.
btw: I forgot to put an example for the timers in the 0.5.0 release, I am sorry about that... 0.5.1 will include it
great, thanks!