Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- reactor = {peripheral.find("BigReactors-Reactor")}
- bank = {peripheral.find("tile_blockcapacitorbank_name")}
- mon = peripheral.wrap("right")
- turbine = {peripheral.find("BigReactors-Turbine")}
- local function keepRPM()
- for i = 1,#turbine do
- if turbine[i].getRotorSpeed() < 1830 then
- for i =1,#reactor do
- reactor[i].setActive(true)
- end
- elseif turbine[i].getRotorSpeed() > 1800 then
- for i = 1,#reactor do
- reactor[i].setActive(false)
- end
- end
- end
- end
- local function waste()
- for i= 1,#reactor do
- print("Reactor "..i.." Curr. Waste : "..reactor[i].getWasteAmount().." mB")
- end
- end
- local function fuel()
- for i= 1,#reactor do
- print("Reactor "..i.." Curr. fuel : "..reactor[i].getFuelAmount().." mB")
- end
- end
- local function steamOutput()
- for i=1,#reactor do
- print("Reactor "..i.." Steam produced : "..reactor[i].getHotFluidProducedLastTick().." mB")
- end
- end
- local function bkInfo()
- --term.setCursorPos(1,10)
- print("Currently Stored: ".. bank[1].getEnergyStored().." / ".. bank[1].getMaxEnergyStored())
- end
- local function onOff()
- if bank[1].getEnergyStored() > bank[1].getMaxEnergyStored()*0.8 then
- for i = 1,#reactor do
- reactor[i].setActive(false)
- keepRPM()
- end--for
- elseif bank[1].getEnergyStored() < bank[1].getMaxEnergyStored()*0.5 then
- for i = 1,#reactor do
- reactor[i].setActive(true)
- end--for
- end--if
- end--func
- local function isOn()
- for i = 1,#reactor do
- print("Reactor "..i.." Currently on/off: ".. tostring(reactor[i].getActive()))
- end
- end
- term.redirect(mon)
- for i = 1,#reactor do
- reactor[i].setActive(true)
- end
- while true do
- term.setBackgroundColor(colors.blue)
- onOff()
- term.clear()
- term.setCursorPos(1,1)
- print("Reactor info")
- isOn()
- fuel()
- waste()
- steamOutput()
- bkInfo()
- sleep(.5)
- end
- term.native()
Add Comment
Please, Sign In to add comment