Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fine = true
- targetOutput = 500000
- minShieldPer = 30
- reac = peripheral.wrap("back")
- local inRate
- outGate = peripheral.wrap("right")
- monitor = peripheral.wrap("top")
- if monitor == null then
- monitor = periphSearch("monitor")
- end
- if monitor ~= null then
- term.redirect(monitor)
- end
- if peripheral.wrap("top") then
- monitor = peripheral.wrap("top")
- end
- function periphSearch(type)
- local names = peripheral.getNames()
- local i, name
- for i, name in pairs(names) do
- if peripheral.getType(name) == type and name ~= "right" then
- return peripheral.wrap(name)
- end
- end
- return null
- end
- inGate = periphSearch("flux_gate")
- targetOutput = outGate.getSignalLowFlow()
- minShieldPer = 30
- --start
- term.clear()
- print("Shutting down reactor")
- outGate.setSignalLowFlow(0)
- reac.stopReactor()
- while fine == true do
- sleep(1)
- term.clear()
- local rInfo = reac.getReactorInfo()
- local shieldPer = math.ceil(rInfo.fieldStrength / rInfo.maxFieldStrength * 10000) * .01
- print("Temperature: ",rInfo.temperature)
- print("Shield Percent: ",shieldPer)
- print("Fuel percentage: ",100 - math.ceil((rInfo.fuelConversion / rInfo.maxFuelConversion * 100)))
- inRate = rInfo.fieldDrainRate / (1 - (targetOutput/1000000))
- --inRate = rInfo.fieldDrainRate / (1 - (targetOutput/100))
- print("Input gate set at ",inRate)
- inGate.setSignalLowFlow(inRate)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement