Advertisement
Guest User

reactor

a guest
Sep 16th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. function quit()
  2.   term.clear()
  3.   term.setCursorPos(1,1)
  4.   error()
  5. end
  6.  
  7. local reactor = peripheral.wrap("back")
  8. if reactor == nil or not reactor.getConnected() then
  9.   print("<Error> Reactor not connected!")
  10.   print("Exiting...")
  11.   os.sleep(2)
  12.   quit()
  13. end
  14.  
  15. print("<> Reactor control up and running")
  16. print()
  17.  
  18. while true do
  19.  
  20.   print()
  21.   term.write("> ")
  22.   local command = read()
  23.   if command == "exit" then
  24.     quit()
  25.   end
  26.  
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement