Menu

Timers?

Help
Anonymous
2003-01-08
2003-01-08
  • Anonymous

    Anonymous - 2003-01-08

    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!

     
    • Mirco Bauer

      Mirco Bauer - 2003-01-08

      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

       
      • Nobody/Anonymous

        great, thanks!

         

Log in to post a comment.