Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on = true
- off = false
- local sendRednetSide = "back"
- local monitor = peripheral.wrap("right")
- function writeRednet(colour, OnOrOff)
- if OnOrOff then
- redstone.setBundledOutput(sendRednetSide, colour)
- else
- redstone.setBundledOutput(sendRednetSide, colors.white)
- end
- end
- function MEPower(onOrOff)
- writeRednet(colours.orange, onOrOff)
- end
- -- main
- function clearTerminal()
- term.clear() -- Clears the screen
- term.setCursorPos(1,1)
- end
- function terminateOS()
- print("stopping...")
- os.shutdown()
- end
- function showHelp()
- monitor.print("me on -- turns on the ME system")
- monitor.print("me off -- turns off the ME system")
- monitor.print("-----------------------------------")
- monitor.print("stop/exit/close -- exits the program")
- end
- while true do
- clearTerminal()
- write("carrotOSlol> ")
- local input = read()
- if input == "help" then showHelp() end
- if input == "info" then showHelp() end
- if input == "me on" then MEPower(on) end
- if input == "me off" then MEPower(off) end
- if input == "stop" then terminateOS() end
- if input == "exit" then terminateOS() end
- if input == "close" then terminateOS() end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement