Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- -- Stravides OP Console Station
- --
- m = peripheral.wrap("right")
- os.unloadAPI("button")
- os.loadAPI("button")
- os.unloadAPI("redstone")
- os.loadAPI("redstone")
- local planned
- local emergency
- local timeToRestart
- local duration
- duration="No Restart Requested"
- timeToRestart=0
- rednet.open("bottom")
- wireside="left"
- rs.setBundledOutput(wireside,0)
- function restart(duration,rType)
- timeToRestart=duration
- if rType="P" then
- while not button.check() do
- for i = 1,(duration-1) do
- sleep(1)
- timeToRestart=timeToRestart-1
- screen()
- i=i+1
- end
- end
- end
- function screen()
- m.setCursorPos(15,2)
- m.write("Stravides OP Console")
- m.setCursorPos(2,16)
- m.write("Restarting in:")
- m.setCursorPos(18,16)
- m.write(timeToRestart)
- end
- button.setMon("right")
- button.add("planned","Planned Restart","flash",2,4,20,6,colors.red,colors.green,colors.white,function() restart(60,"P") end)
- button.setState("planned",false)
- button.add("emergency","Emergency Restart","flash",2,8,20,10,colors.red,colors.green,colors.white, function() restart(5,"E") end)
- button.setState("emergency",false)
- button.draw()
- screen()
- while true do
- button.check()
- end
Advertisement
Add Comment
Please, Sign In to add comment