Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- modified to work with draconic rf storage (trying to determine actual 'gain' from reactor)
- --local stabilizer = peripheral.wrap("right")
- local storage = peripheral.find("draconic_rf_storage")
- local monitor = peripheral.wrap("bottom")
- local core = peripheral.wrap("right")
- term.redirect(monitor)
- local x=0
- local y=0
- local cf=0
- local lcf=0 -- last containment field strength
- local es=0
- local les=0 -- last energy saturation
- while true do
- monitor.clear()
- --for key,value in pairs(storage) do
- --print("key: "..key..", value: "..value)
- --end
- --for _,method in pairs(storage) do
- y=x
- x=storage.getEnergyStored()
- --end
- local stab = core.getReactorInfo()
- --for _, method in pairs(stabilizer) do
- --print(method)
- --end
- print(" status: "..stab.status)
- print(" generationRate: "..stab.generationRate.." RF/t")
- print(" temperature: "..stab.temperature)
- print(" fieldStrength: "..stab.fieldStrength)
- print(" maxFieldStrength: "..stab.maxFieldStrength)
- print(" fieldDrainRate: "..stab.fieldDrainRate)
- print("Fuel Conversion Rate: "..stab.fuelConversionRate.." nb/t")
- print(" maxFuelConversion: "..stab.maxFuelConversion)
- local fuelConversionPercent=stab.fuelConversion*100/stab.maxFuelConversion
- print(" fuelConversion: "..stab.fuelConversion.."("..fuelConversionPercent.."%)")
- local energySaturationPercent=stab.energySaturation*100/stab.maxEnergySaturation
- print(" energySaturation: "..stab.energySaturation.."("..energySaturationPercent.."%)")
- print(" maxEnergySaturation: "..stab.maxEnergySaturation)
- local fieldStrengthPercent=stab.fieldStrength*100/stab.maxFieldStrength
- print(" Cont. fieldStrength: "..fieldStrengthPercent.."%")
- print(" --- ")
- print(" Energy Core Storage: "..x)
- print(" Energy Core RF/t: "..((((x-y)/1000/1000)/2)*20).."MRF/t"..", "..(x*100/2140000000000).."%")
- if (fieldStrengthPercent<51 or energySaturationPercent<51) then
- -- if it's < than some kill switch probably have it scram the reactor
- redstone.setOutput("back", not redstone.getOutput("back"))
- redstone.setOutput("top",false)
- end
- if (fieldStrengthPercent>51 and energySaturationPercent>51) then
- redstone.setOutput("back",false)
- redstone.setOutput("top",true) -- redstone.getOutput("top"))
- end
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement