jonassvensson4

Reactor dator 2 - FUNGERAR

Sep 22nd, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- COMMAND LIST
  2. print("Reactor ON/OFF")
  3. print("Turbine ON/OFF")
  4.  
  5. local reactor = peripheral.wrap("BigReactors-Reactor_0")
  6. local turbine = peripheral.wrap("BigReactors-Turbine_0")
  7.  
  8. -- Turn on
  9. while true do
  10.     local message = read()
  11.    
  12.     if message == "reactor on" then
  13.         reactor.setActive(true)
  14.         print("Reactor is now turned on")
  15.     elseif message == "turbine on" then
  16.         turbine.setActive(true)
  17.         print("Turbine is now turned on")
  18.     end
  19. -- Turn off
  20.     if message == "reactor off" then
  21.         reactor.setActive(false)
  22.         print("Reactor is now turned off")
  23.     elseif message == "turbine off" then
  24.         turbine.setActive(false)
  25.         print("Turbine is now turned off")
  26.     end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment