Minecraft Reactor


SUBMITTED BY: Guest

DATE: Jan. 24, 2015, 4:40 p.m.

FORMAT: Lua

SIZE: 1.7 kB

HITS: 1335

  1. local Reactor = peripheral.find("BigReactors-Reactor")
  2. local Turbine1 = peripheral.find("BigReactors-Turbine")
  3. local RodsInsertion = 95
  4. local RodInsertion = 95
  5. function RodSetting()
  6. while Reactor.getHotFluidProducedLastTick() > 1999 do
  7. RodsInsertion = RodsInsertion +1
  8. Reactor.setAllControlRodLevels(RodsInsertion)
  9. os.sleep(1)
  10. end
  11. os.sleep(3)
  12. while Reactor.getHotFluidProducedLastTick() < 1900 do
  13. RodsInsertion = RodsInsertion -1
  14. Reactor.setAllControlRodLevels(RodsInsertion)
  15. os.sleep(1)
  16. end
  17. RodInsertion = RodsInsertion
  18. while Reactor.getHotFluidProducedLastTick() < 2000 and RodInsertion > 0 do
  19. RodInsertion = RodInsertion -1
  20. Reactor.setControlRodLevel(0,RodInsertion)
  21. os.sleep(1)
  22. end
  23. RodInsertion = RodInsertion + 1
  24. Reactor.setControlRodLevel(0,RodInsertion)
  25. end
  26. if Reactor.getConnected() and Turbine1.getConnected() then
  27. else
  28. error()
  29. end
  30. Reactor.setAllControlRodLevels(95)
  31. Reactor.setActive(true)
  32. Turbine1.setInductorEngaged(true)
  33. local flow
  34. os.sleep(10)
  35. flow = Reactor.getHotFluidProducedLastTick()
  36. RodsInsertion = 20000/flow
  37. Reactor.setAllControlRodLevels(RodsInsertion)
  38. os.sleep(5)
  39. flow = Reactor.getHotFluidProducedLastTick()
  40. RodSetting()
  41. while true do
  42. if Turbine1.getRotorSpeed() > 1825 then
  43. Reactor.setActive(false)
  44. elseif Turbine1.getRotorSpeed() < 1775 then
  45. Reactor.setActive(true)
  46. end
  47. if redstone.getAnalogInput("back") > 8 then
  48. Turbine1.setInductorEngaged(false)
  49. elseif redstone.getAnalogInput("back") < 5 then
  50. if Turbine1.getRotorSpeed() > 1700 then
  51. Turbine1.setInductorEngaged(true)
  52. end
  53. end
  54. os.sleep(3)
  55. end

comments powered by Disqus