Advertisement
Guest User

reactor

a guest
Jan 17th, 2022
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. local component = require("component")
  2. local RUNNING = true
  3. local reactor = component.reactor_logic_adapter
  4. local laser = component.laser_amplifier
  5. local sides = require ("sides")
  6.  
  7. while RUNNING do
  8.  
  9.     term.clear()
  10.     user = nil
  11.     user = io.read()
  12.    
  13.     if user == "start" then
  14.     print("starting the reactor")
  15.    
  16.     if reactor.isIgnite() == "true" then
  17.     print("reactor is already running!!")
  18.    
  19.     else
  20.    
  21.     if reactor.canIgnite() == "false" then
  22.  
  23.     print("reactor is unable to start reason unknown")
  24.  
  25.     else
  26.  
  27.     if laser.getEnergy() =< "1000" then
  28.    
  29.     component.redstone.setOutput(sides.down,15)
  30.     os.sleep(1)
  31.     component.redstone.setOutput(sides.down,0)
  32. end
  33. end
  34. end
  35. end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement