Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- credits to:
- -- https://youtu.be/sHN-KQKUkaY
- -- Modified for early game non advanced computer, no turbine, 2x1 monitor...
- -- This program will later be replaced by a late early game version when I get a enderio capacitor...
- -- A previous version had color and a 2x2 monitor, this version currently replaces that version.
- -- when you connect the periphrials, check the log, these values should match what's in the code, if not
- -- you need to change it...
- -- [19:07:21] [Client thread/INFO]: [CHAT] Peripheral "computer_12" connected to network
- -- [19:07:24] [Client thread/INFO]: [CHAT] Peripheral "monitor_4" connected to network
- -- [19:07:27] [Client thread/INFO]: [CHAT] Peripheral "BigReactors-Reactor_6" connected to network
- -- basic setup for this...
- -- reactor has a computer port
- -- This isn't complex, but that's what I like about it. It doesn't auto configure or do anything fancy, it just monitors
- -- what you tell it, and turns the reactor on and off to conserve fuel...
- -- for an api reference, I use and recommend:
- -- http://ftbwiki.org/Reactor_Computer_Port
- -- http://ftbwiki.org/Turbine_Computer_Port
- -- I've further decided to stop treating the reactor like a reactor, instead of messing with the control rods the
- -- turbine works best with the rods set to 20%, so I'll just leave it at 20%, and shut it off when it's full.
- local reactor1 = peripheral.wrap("BigReactors-Reactor_6")
- local mon = peripheral.wrap("monitor_4")
- while true do
- -- basic capacitor low, 10k of 100k capacity
- local low = 10000
- -- turbine high 800k 1000000 capacity
- local high = 800000
- -- reactor full at 10M
- local full = 10000000
- if reactor1.getEnergyStored() <= low then
- reactor1.setAllControlRodLevels(20)
- if reactor1.getActive() == false then
- reactor1.setActive(true)
- end
- end
- if reactor1.getEnergyStored() == full then
- reactor1.setActive(false)
- else
- if reactor1.getEnergyStored() >= high then
- reactor1.setAllControlRodLevels(90)
- reactor1.setActive(true)
- end
- end
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("Active: ")
- mon.write(reactor1.getActive())
- mon.setCursorPos(1,2)
- mon.write("Casing Heat: ")
- mon.write(math.floor(reactor1.getCasingTemperature()))
- mon.setCursorPos(1,3)
- mon.write("Fuel Heat: ")
- mon.write(math.floor(reactor1.getFuelTemperature()))
- mon.setCursorPos(1,4)
- mon.write("RF: ")
- mon.write(math.floor(reactor1.getEnergyStored()))
- sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement