PDA

View Full Version : Implementing a wait/sleep within an extension using Lua.



Ken L
April 21st, 2016, 23:53
From what I can scratch at the surface, it doesn't seem that LUA has a native wait function. Some programs work around this by suppling a clock callback of somekind.

I write functionality and delayed work and queuing of it is part of my design padagrim. How can I replicate this?

Moon Wizard
April 22nd, 2016, 00:30
There's no mechanism in the FG API to provide timer or sleep support.

Some creative souls use the existing events triggered by network messages or user interface events to trigger delayed actions.

Regards,
JPG

damned
April 22nd, 2016, 04:36
Have a look at the Combat Tracker Timer that was posted about a week ago. That uses the client connection monitoring timer....

Ken L
April 22nd, 2016, 06:58
I guess that's another suggestion. This would allow things such as animations and timed events. I've looked at time combat tracker by mortgarra , I just wanted to confirm that there is indeed no native solution at the root level (sleep/wait/timeout)

damned
April 22nd, 2016, 10:30
Thats what the Wizard is saying in his reply - there is no timer or sleep support at the root level...

Ken L
April 24th, 2016, 00:26
No need for an ellipsis, I was re-stating the purpose for my original post as to why I didn't look at other extensions. Wiz answered it in a single post.