Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --os.loadAPI("button")
- r = peripheral.wrap("BigReactors-Reactor_0")
- m = peripheral.wrap("monitor_0")
- t = peripheral.wrap("BigReactors-Turbine_0")
- t1 = peripheral.wrap("BigReactors-Turbine_1")
- local turnOnAt = 75
- local turnOffAt = 90
- local energy = 0
- local energyStored = 0
- local energyMax = 0
- local energyStoredPercent = 0
- local RFProduction = 0
- local fuelUse = 0
- local coreTemp = 0
- local energy1 = 0
- local energyStored1 = 0
- local energyMax1 = 0
- local energyStoredPercent1 = 0
- local RFProduction1 = 0
- local fuelUse1 = 0
- local coreTemp1 = 0
- local timerCode
- local reactorOnline = true
- local turbinaOnline = false
- function online()
- r.setActive(true)
- --button.flash("Online")
- end
- function offline()
- r.setActive(false)
- --button.flash("Offline")
- end
- function comma_value(amount)
- local formatted = amount
- local swap = false
- if formatted < 0 then
- formatted = formatted*-1
- swap = true
- end
- while true do
- formatted, k = string.gsub(formatted, "^(%d+)(%d%d%d)", '%1,%2')
- if k == 0 then
- break
- end
- end
- if swap then
- formatted = "-"..formatted
- end
- return formatted
- end
- function displayEn()
- m.clear()
- m.setCursorPos(1,1)
- --print("Energy Use: "..energy)
- m.write("Energie v T: ")
- if energy < 0 then
- m.setTextColor(colors.red)
- else
- m.setTextColor(colors.green)
- end
- m.write(comma_value(math.floor(energy)).. "RF/t")
- m.setTextColor(colors.white)
- m.setCursorPos(1,2)
- m.write("Rotor speed: "..rotorspeed.."RPM")
- m.setCursorPos(1,3)
- m.write("Turbina je: ")
- if turbinaOnline then
- m.setTextColor(colors.green)
- m.write("Online")
- else
- m.setTextColor(colors.red)
- m.write("Offline")
- end
- m.setTextColor(colors.white)
- m.setCursorPos(1,5)
- --print("Energy Use: "..energy1)
- m.write("Energie v T1: ")
- if energy1 < 0 then
- m.setTextColor(colors.red)
- else
- m.setTextColor(colors.green)
- end
- m.write(comma_value(math.floor(energy1)).. "RF/t")
- m.setTextColor(colors.white)
- m.setCursorPos(1,6)
- m.write("Rotor speed: "..rotorspeed1.."RPM")
- m.setCursorPos(1,7)
- m.write("Turbina1 je: ")
- if turbinaOnline1 then
- m.setTextColor(colors.green)
- m.write("Online")
- else
- m.setTextColor(colors.red)
- m.write("Offline")
- end
- m.setTextColor(colors.white)
- m.setCursorPos(1,9)
- m.write("Reaktor je: ")
- if reactorOnline then
- m.setTextColor(colors.green)
- m.write("Online")
- else
- m.setTextColor(colors.red)
- m.write("Offline")
- end
- m.setTextColor(colors.white)
- m.setCursorPos(1,10)
- m.write("Voda v R: "..reactorVoda.." mB")
- m.setTextColor(colors.white)
- m.setCursorPos(1,11)
- m.write("Para v R: "..reactorPara.." mB")
- m.setTextColor(colors.white)
- m.setCursorPos(23,1)
- m.write("RF/Tik: ")
- m.setTextColor(colors.green)
- m.write(comma_value(math.floor(RFProduction)).."RF/T")
- m.setTextColor(colors.white)
- m.setCursorPos(23,2)
- m.write("Voda ven: "..math.floor(coreTemp).." mB")
- m.setCursorPos(23,3)
- m.write("Fuel Use: "..fuelUse.." MB/t")
- m.setTextColor(colors.white)
- m.setCursorPos(23,5)
- m.write("RF/Tik: ")
- m.setTextColor(colors.green)
- m.write(comma_value(math.floor(RFProduction1)).."RF/T")
- m.setTextColor(colors.white)
- m.setCursorPos(23,6)
- m.write("Voda ven: "..math.floor(coreTemp1).." mB")
- m.setCursorPos(23,7)
- m.write("Fuel Use: "..fuelUse1.." MB/t")
- end
- function checkEn()
- local tempEnergy = 0
- energyStored = t.getEnergyStored()
- energyMax = t.getFluidAmountMax()
- rotorspeed = math.floor(t.getRotorSpeed())
- RFProduction = t.getEnergyProducedLastTick()
- fuelUse = t.getInputAmount()
- coreTemp = t.getOutputAmount()
- turbinaOnline = t.getActive()
- tempEnergy = t.getEnergyStored()
- -- t1
- local tempEnergy1 = 0
- energyStored1 = t1.getEnergyStored()
- energyMax1 = t1.getFluidAmountMax()
- rotorspeed1 = math.floor(t1.getRotorSpeed())
- RFProduction1 = t1.getEnergyProducedLastTick()
- fuelUse1 = t1.getInputAmount()
- coreTemp1 = t1.getOutputAmount()
- turbinaOnline1 = t1.getActive()
- tempEnergy1 = t1.getEnergyStored()
- -- t1konec
- sleep(0.1)
- energy = t.getEnergyStored()
- energy1 = t1.getEnergyStored()
- reactorVoda = r.getCoolantAmount()
- reactorPara = r.getHotFluidAmount()
- end
- function displayScreen()
- -- repeat
- checkEn()
- displayEn()
- end
- while true do
- displayScreen()
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement