You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However this will lock up the entire program until the sleep function has returned.
If a Timer class or similar would be added, or simply a callback that is called every n seconds it would open up some new ways scripts can interact with the user. In my case I was trying to implement a timeout to WebSocket so that if it hasn't managed to connect yet after 3 seconds it would stop trying to connect and update the UI to allow the user to manually restart the connection process.
Right now the only way to wait for some time in a lua script is to do a busy wait:
However this will lock up the entire program until the sleep function has returned.
If a Timer class or similar would be added, or simply a callback that is called every n seconds it would open up some new ways scripts can interact with the user. In my case I was trying to implement a timeout to WebSocket so that if it hasn't managed to connect yet after 3 seconds it would stop trying to connect and update the UI to allow the user to manually restart the connection process.
API could look something like this:
The text was updated successfully, but these errors were encountered: