Posted 24 June 2013 - 11:16 AM
(Yeah this is possible to code already, but it would be nice to be a default feature imo and it shouldn't break anything)
So yeah, give us the ability to add arguments to timers? :3
os.startTimer(float time, …)
then the event just returns the arguments that have been passed as additional params after the timerID?
It just would make some implementations easier and less messy imo, since you don't have to make variables holding the timer ID if you dont need those for some other reason
Example use:
So yeah, give us the ability to add arguments to timers? :3
os.startTimer(float time, …)
then the event just returns the arguments that have been passed as additional params after the timerID?
It just would make some implementations easier and less messy imo, since you don't have to make variables holding the timer ID if you dont need those for some other reason
Example use:
os.startTimer(1,"meow")
while true do
local evData = {os.pullEvent("timer")} -- evData[1] == "timer" -- evData[2] == timerID -- evData[3] == "meow"
if evData[3] == "meow" then
-- do stuff
os.startTimer(1,"meow")
end
end