Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- credits to:
- -- Clone of JSfPTB51, remove the reactor for earlier game reactor/capacitor pairing.
- -- note however, in a really eary game where gold isn't abundant you can use regular monitors
- -- but you have to remark out the color lines, in either case a regular computer is fine.
- -- https://youtu.be/sHN-KQKUkaY
- -- As a base, modified for my turbine/enderio capacitor bank
- -- 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_42" connected to network
- -- [19:07:24] [Client thread/INFO]: [CHAT] Peripheral "monitor_21" connected to network
- -- [19:07:27] [Client thread/INFO]: [CHAT] Peripheral "BigReactors-Reactor_18" connected to network
- -- [22:15:51] [Client thread/INFO]: [CHAT] Peripheral "tile_blockcapacitorbank_name_8" connected to network
- -- basic setup for this...
- -- reactor has a computer port
- -- there are four modems connected with network cable (per above don't forget to click connect them and note their numbers, and
- -- update the definitions below)
- -- a modem goes on computer port, on any side of the computer, and one on the multi block monitor bank, and one on the capacitor(s)
- -- I use a 2x2 monitor, though if you add more lines (1,8) for example, and run off the bottom you can keep stacking
- -- them down x2 or you can make output wider by going 3x2, etc, it doesn't care it's treated as a single monitor so long as it's
- -- a square or a rectangle (it doesn't do tetris pieces, at that point you'd use different monitor wrappers like mon1 and mon2)
- -- 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.
- while true do
- local reactor1 = peripheral.wrap("BigReactors-Reactor_12")
- local capacitor = peripheral.wrap("tile_blockcapacitorbank_name08")
- local mon = peripheral.wrap("monitor_18")
- -- basic capacitor low, 10k of 100k capacity ( single basic capacitor )
- local low = 10000
- -- adjust this to about 80% of "full" whatever that is (depends on how many capacitors you have)
- local high = 800000
- -- adjust this to whatever max is
- local full = 1000000
- if capacitor.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.setTextColor(colors.white)
- mon.write("Active: ")
- mon.setTextColor(colors.lime)
- mon.write(reactor1.getActive())
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.white)
- mon.write("Casing Heat: ")
- mon.setTextColor(colors.lime)
- mon.write(math.floor(reactor1.getCasingTemperature()))
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.white)
- mon.write("Fuel Heat: ")
- mon.setTextColor(colors.lime)
- mon.write(math.floor(reactor1.getFuelTemperature()))
- mon.setCursorPos(1,6)
- mon.setTextColor(colors.white)
- mon.write("RF: ")
- mon.setTextColor(colors.lime)
- mon.write(math.floor(reactor1.getEnergyStored()))
- mon.setCursorPos(1,7)
- mon.setTextColor(colors.white)
- mon.write("C-RF: ")
- mon.setTextColor(colors.lime)
- mon.write(math.floor(capacitor.getEnergyStored()))
- sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement