Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local speaker = peripheral.wrap("back")
- local last_hour = -100.0
- while true do
- local current_time = os.time()
- if current_time >= (last_hour + 1) or math.abs(current_time - last_hour) > 3 then
- for i=1, math.floor(current_time) % 12 do
- if current_time >= 12 then
- speaker.playNote("cow_bell", 1.0, math.floor(current_time) % 12)
- else
- speaker.playNote("bit", 1.0, math.floor(current_time))
- end
- sleep(0.3)
- end
- last_hour = math.floor(current_time)
- end
- term.clear()
- print("Time: " .. tostring(current_time))
- sleep(1)
- end
Add Comment
Please, Sign In to add comment