Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap( "left" )
- readout = "Monitoring"
- readout2 = "Monitoring"
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function rnd() --reset and display
- mon.clear()
- mon.setCursorPos(1,1)
- clear()
- sunrise = os.setAlarm(6.00)
- sunset = os.setAlarm(18.00)
- print("Press Q to exit.")
- print(readout2)
- mon.write(readout)
- end
- rnd()
- while true do
- event, input = os.pullEvent()
- if (event=="alarm") and (input==sunrise) then
- redstone.setOutput("back", false)
- readout = "Good Morning."
- readout2 = "lights out."
- rnd()
- sleep(1)
- elseif (event=="alarm") and (input==sunset) then
- redstone.setOutput("back", true)
- readout = "Good Night."
- readout2 = "lights on."
- rnd()
- sleep(1)
- elseif (event=="key") and (input==16) then -- elseif (event=="char") and ((input=="q") or (input=="Q")) then -- possible change change
- readout2 = "Shutting Down."
- readout = "System standby."
- rnd()
- sleep(1)
- break
- end
- end
- clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement