Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --CONFIG--
- side = "bottom"
- --FUNCTIONS--
- function Clear()
- term.clear()
- term.setCursorPos(1, 1)
- end
- function saveState()
- file = fs.open("state", "w")
- file.writeLine((colors.test(rs.getBundledOutput(side), colors.white)))
- file.writeLine((colors.test(rs.getBundledOutput(side), colors.orange)))
- file.writeLine((colors.test(rs.getBundledOutput(side), colors.magenta)))
- file.writeLine((colors.test(rs.getBundledOutput(side), colors.lightBlue)))
- file.close()
- end
- function loadState()
- file = fs.open("state", "r")
- shell.run("redset", side, "white", file.readLine())
- shell.run("redset", side, "orange", file.readLine())
- shell.run("redset", side, "magenta", file.readLine())
- shell.run("redset", side, "lightBlue", file.readLine())
- file.close()
- end
- --CODE--
- Clear()
- print("N1ghtK1n9's Computer")
- loadState()
- term.setCursorPos(1, 3)
- write"> "
- input = read()
- if input == ("engines") then
- shell.run("redset", side, "white", tostring(not colors.test(rs.getBundledOutput(side), colors.white)))
- Clear()
- outE = rs.testBundledInput(side, colors.white)
- if outE == true then
- print("Turning Engines Off")
- rs.setBundledOutput(side, colors.white)
- elseif outE == false then
- print("Turning Engines On")
- rs.setBundledOutput(side, colors.white)
- end
- saveState()
- sleep(1)
- os.reboot()
- elseif input == ("refineries") then
- shell.run("redset", side, "orange", tostring(not colors.test(rs.getBundledOutput(side), colors.orange)))
- Clear()
- outR = rs.testBundledInput(side, colors.orange)
- if outR == true then
- print("Turning Refineries Off")
- rs.setBundledOutput(side, colors.orange)
- elseif outR == false then
- print("Turning Refineries On")
- rs.setBundledOutput(side, colors.orange)
- saveState()
- sleep(1)
- os.reboot()
- end
- elseif input == ("geothermal") then
- shell.run("redset", side, "magenta", tostring(not colors.test(rs.getBundledOutput(side), colors.magenta)))
- Clear()
- outG = rs.testBundledInput(side, colors.magenta)
- if outG == true then
- print("Turning Geothermal Generators Off")
- rs.setBundledOutput(side, colors.magenta)
- elseif outG == false then
- print("Turning Geothermal Generators Off")
- rs.setBundledOutput(side, colors.magenta)
- saveState()
- sleep(1)
- os.reboot()
- end
- elseif input == "enginecoolant" then
- shell.run("redset", side, "lightBlue", tostring(not colors.test(rs.getBundledOutput(side), colors.lightBlue)))
- Clear()
- outEC = rs.testBundledInput(side, colors.lightBlue)
- if outEC == true then
- print("Warning!! Are you sure you want to do this?")
- input = read()
- if input == "yes" then
- print("Turning Engine Coolant Off")
- rs.setBundledOutput(side, colors.lightBlue)
- elseif input == "no" then
- print("Leaving Coolant On")
- Clear()
- end
- elseif outEC == false then
- print("Turning Engine Coolant On")
- rs.setBundledOutput(side, colors.lightBlue)
- saveState()
- sleep(1)
- os.reboot()
- end
- elseif input == "reboot" then
- os.reboot()
- end
Advertisement
Add Comment
Please, Sign In to add comment