Jump to content




Timer Tokens


  • This topic is locked This topic is locked
1 reply to this topic

#1 Pinkishu

  • Members
  • 484 posts

Posted 24 June 2013 - 10: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:
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


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 24 June 2013 - 11:45 AM

This has been suggested before and falls under "enhancements" in the sticky. Locked.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users