Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local s = peripheral.wrap('speaker_2')
- local mc = peripheral.wrap('monitor_2')
- local ml = peripheral.wrap('monitor_1')
- local mr = peripheral.wrap('monitor_0')
- local tl = peripheral.wrap('BigReactors-Turbine_0')
- local tr = peripheral.wrap('BigReactors-Turbine_1')
- -- These two peripherals aren't used yet?
- local nb = peripheral.wrap('noteBlock_0')
- local cb = peripheral.wrap('chatBox_1')
- mc.setTextColor(32768)
- mc.setBackgroundColor(colors.green)
- mc.setTextScale(3)
- tl.setActive(false)
- ml.setBackgroundColor(colors.red)
- ml.clear()
- tr.setActive(false)
- mr.setBackgroundColor(colors.red)
- mr.clear()
- local function off()
- mc.setBackgroundColor(colors.red)
- mc.clear()
- ml.setBackgroundColor(colors.red)
- ml.clear()
- mr.setBackgroundColor(colors.red)
- mr.clear()
- end
- s.speak("System Engaged")
- while true do
- mc.clear()
- mc.setCursorPos(1,1)
- if rs.getInput("left") then mc.write("Sealed") else mc.write("Unsealed") end
- write("Enter command (? for help): ")
- local input = io.read():lower() -- Convert the result of the read command to lowercase to make matching simpler.
- if input == "restart" then
- s.speak("restarting")
- off()
- sleep(5)
- os.reboot()
- elseif input == "shutdown" then
- s.speak("Shutting Down")
- off()
- sleep(0)
- break
- elseif input == "startup left" then
- ml.setBackgroundColor(colors.green)
- ml.clear()
- tl.setActive(true)
- elseif input == "startup right" then
- mr.setBackgroundColor(colors.green)
- mr.clear()
- tr.setActive(true)
- elseif input == "shutoff left" then
- ml.setBackgroundColor(colors.red)
- ml.clear()
- tl.setActive(false)
- elseif input == "shutoff right" then
- mr.setBackgroundColor(colors.red)
- mr.clear()
- tr.setActive(false)
- elseif input == "?" then
- print()
- print("Commands")
- print()
- print("?")
- print("Shutdown")
- print("Restart")
- print("Startup Left")
- print("Startup Right")
- print("Shutoff Left")
- print("Shutoff Right")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment