-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lua sleep/timeout/join #1588
Comments
The gui.script module is a wrapper around Lua coroutines, which aren't really the same as threads. There isn't a way to tell if one is "done", as far as I know, so detecting when exportlegends has finished would be pretty hard. If you're interested in waiting for a world to load, test/main.lua does something a bit hacky that works for the title screen - Lines 94 to 112 in 5d05cfc
Just like exportlegends, test/main will return without waiting for coroutines to finish. It does support running another command when tests have finished, though. Maybe exportlegends could do this too. |
Assuming this was figured out in DFHack/scripts#152 |
From a Lua script is it possible to sleep/wait on the main thread for something to be loaded?
I know it is possible to use:
But this returns the main thread back (don't know if it is handled by threads or something else be still the same).
If I want to wait for some loadingscreen to be done loading I have to do some recursive waiting in order to make this work.
The other solution is apparently to use:
But is there some way of doing a thread.join() for the main thread to wait for the execution of the script until it is done?
It is related to: http://www.bay12forums.com/smf/index.php?topic=176439.msg8151854#msg8151854
The text was updated successfully, but these errors were encountered: