I have a control system with a text-based GUI displayed on an advanced monitor. Using the "monitor_touch" event, I've created what I think is an Object Oriented GUI system, but thats actually working.
This system will occasionally need to run a series of time delayed commands that can "tie up" the system, leaving it unresponsive to input. I'd like to avoid this if at all possible. IE: using sleep([time]) makes the touch screen stop working while it waits.
I would like to implement a function or API that would allow me to queue a time-delayed event. I could use os.setTimer([time]), but that doesn't allow me to pass on any additional variables like os.queueEvent("event", param1, param2). There could be some instances where more than one time-delayed set of instructions could be running at the same time, so using os.setTimer() could get overly complicated.
Ideally the function would have the following parameters:
apiNameHere.queueDelayEvent("event", time, param1, param2…)
Is this feasible in LUA? Is there some function like this already? Or is there some better method to implement this?