Advertisement
ksaw000

REACTOR AUTOMATION

Jan 8th, 2025 (edited)
5
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. laser = peripheral.wrap("right")
  2. reactor = peripheral.wrap("fusionReactorLogicAdapter_0")
  3.  
  4. local function reactorIsReady()
  5. while true do
  6. if reactor.getHohlraum().count>0 and reactor.isFormed() and not reactor.isIgnited() then
  7. break
  8. end
  9. end
  10. end
  11.  
  12. local function laserIsCharged()
  13. while true do
  14. if laser.getEnergy()/2.5 >= 400000000 then
  15. break
  16. end
  17. end
  18. end
  19.  
  20. local function recharge()
  21. while laser.getEnergy()/2.5 < 400000000 do
  22. redstone.setOutput("left",true)
  23. end
  24. redstone.setOutput("left",false)
  25. end
  26.  
  27. local function fire()
  28. redstone.setOutput("right",true)
  29. sleep(1)
  30. redstone.setOutput("right",false)
  31. end
  32.  
  33. parallel.waitForAll(reactorIsReady,laserIsCharged)
  34. fire()
  35. recharge()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement