bobmarley12345

carrotoslmaostupidname

Jun 15th, 2020
888
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on = true
  2. off = false
  3. local sendRednetSide = "back"
  4. local monitor = peripheral.wrap("right")
  5.  
  6. function writeRednet(colour, OnOrOff)
  7.     if OnOrOff then
  8.         redstone.setBundledOutput(sendRednetSide, colour)
  9.     else
  10.         redstone.setBundledOutput(sendRednetSide, colors.white)
  11.     end
  12. end
  13.  
  14. function MEPower(onOrOff)
  15.     writeRednet(colours.orange, onOrOff)
  16. end
  17.  
  18. -- main
  19.  
  20. function clearTerminal()
  21.     term.clear() -- Clears the screen
  22.     term.setCursorPos(1,1)
  23. end
  24.  
  25. function terminateOS()
  26.     print("stopping...")
  27.     os.shutdown()
  28. end
  29.  
  30. function showHelp()
  31.     monitor.print("me on   --  turns on the ME system")
  32.     monitor.print("me off  --  turns off the ME system")
  33.     monitor.print("-----------------------------------")
  34.     monitor.print("stop/exit/close -- exits the program")
  35. end
  36. while true do
  37.     clearTerminal()
  38.  
  39.     write("carrotOSlol> ")
  40.  
  41.     local input = read()
  42.  
  43.     if input == "help" then showHelp() end
  44.     if input == "info" then showHelp() end
  45.  
  46.     if input == "me on" then MEPower(on) end
  47.     if input == "me off" then MEPower(off) end
  48.  
  49.     if input == "stop" then terminateOS() end
  50.     if input == "exit" then terminateOS() end
  51.     if input == "close" then terminateOS() end
  52. end
RAW Paste Data