Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: malfacine on May 31, 2016, 07:54:08 PM

Title: Command Loop
Post by: malfacine on May 31, 2016, 07:54:08 PM
Need help for script

every 10 seconds for example the function execute command....

I had an idea for a new plugin
Title: Re: Command Loop
Post by: liquid8d on May 31, 2016, 09:42:20 PM
you can use add_ticks_callback something like:

Code: [Select]
fe.add_ticks_callback( my_timer );
local timer = 0;

function my_timer(ticks) {
   timer += ticks;
   if ( timer >= 10000 ) {
      //do something
      timer = 0;
   }
}