This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Pinkishu's profile picture

Timer Tokens

Started by Pinkishu, 24 June 2013 - 09:16 AM
Pinkishu #1
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:
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
Lyqyd #2
Posted 24 June 2013 - 12:45 PM
This has been suggested before and falls under "enhancements" in the sticky. Locked.