timer event

timer
Event
Returns
  • timer : number unique timer number

Source CC:Tweaked

Occurs when a previously set timer has elapsed.

ExampleUsing the Timer event
Sets a timer at 5 seconds, then waits for it to finish.
Code
<nowiki>
local myTimer = os.startTimer(5)
local event, timerNumber
while timerNumber ~= myTimer do
  event, timerNumber = os.pullEvent("timer")
end
print("A timer has finished!")
    </nowiki>
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.