Hi,
how to let the lua code pause for 1ms for example?
Thx!
Hi,
how to let the lua code pause for 1ms for example?
Thx!
I haven't tried this in a while but you can either have the OS do it (https://stackoverflow.com/a/17987723/1373278)
Or it looks like plugins run as coroutines so you can use coroutine.yield(100) for 100ms yielding (sleeping for at least 100ms)
It's obsolete now and I honestly am not sure it still works but I used this in my fadermaster plugin a while back, check like 230 https://github.com/hossimo/GMA…plugins/Fade%20Master.lua
Both Plugins scripts and commandline-embedded Lua scripts are loaded as coroutines into the gma3's Lua-engine, so the proper way to wait/delay would be to use coroutine.yield(), as this would halt your code only, and not block the whole Lua engine, (as some of the hacks suggested on stackoverflow would do)
Please note that yield takes seconds, not milliseconds, as argument e.g. coroutine.yield(0.1) for 100ms yielding