PDA

View Full Version : LUA timer question



mhund
July 11th, 2016, 12:57 PM
Hello

just doing some LUA stuff again. One question you may know an answer:

I would like to have a function which combines scheduler and timer in a way, that I can define a callback function instead of sending an event (like timer does) at a specific time (like midnight) instead of an offset timer (like scheduler does). Is this possible?

thanks in advance,

Martin

Ron
July 11th, 2016, 02:15 PM
Hmm, well the scheduler is accessible from Lua but works with events as callbacks. You could combine gir.addEventHandler with the scheduler to make this by creating a random eventstring. Does that make sense? Either that or I could investigate adding a callback to the scheduler.

mhund
July 11th, 2016, 03:20 PM
I mean - if you don't mind - I think a callback solution is more consistent because as a "lua kid" I can stay in the scripting world. Within my lua scripts I don't work with events. Only "outside" of the lua world.