alarm event

From ComputerCraft
Jump to: navigation, search
alarm
Event
Returns
  • alarm : number unique alarm number

Source CC:Tweaked

Occurs when a previously set alarm is scheduled to go off.

ExampleExampleSetting an alarm
Set's an alarm at 11 'o clock and tells the player to take the cake out of the oven.
Code
local myAlarm = os.setAlarm(11)
local event, alarmNumber
while alarmNumber ~= myAlarm do
  event, alarmNumber = os.pullEvent("alarm")
end
print("The cake should be taken out of the oven! Watch out, it is hot!")