Posted 14 December 2012 - 05:04 PM
It would be nice if os.startTimer accepted more arguments that will not be interpreted but will be added to the timer event's arguments.
Currently, no more than 4 arguments could be added (see Events are limited to 5 parameters)
For example, so that:
prints in 5 seconds:
It could possibly include the ability to change the event name, although this could require a new function:
Currently, no more than 4 arguments could be added (see Events are limited to 5 parameters)
For example, so that:
os.startTimer(5, "asdf", "jkl", "xyz")
evt = {os.pullEvent("timer")}
print(table.concat(evt, " "))
prints in 5 seconds:
timer (timer ID goes here) asdf jkl xyz
It could possibly include the ability to change the event name, although this could require a new function:
-- simulate a keypress in 5 seconds
os.startEventTimer(5, "key", keys.up)