Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- moni = peripheral.wrap("left")
- moni2 = peripheral.wrap("right")
- local maxRFT
- local RFT
- local count
- local RFTStore
- local maxRFTStore
- local cool
- local maxCool
- local fuel
- local maxFuel
- local FName1
- local FName2
- while true do
- if rs.getInput("front") then
- p = peripheral.wrap("top")
- t = p.getNamesRemote()
- maxRFT = 0
- RFT = 0
- RFTStore = 0
- maxRFTStore = 0
- count = 0
- fuel = 0
- maxFuel = 0
- cool = 0
- maxCool = 0
- for i = 1, #t do
- local info = p.getMethodsRemote(t[i])
- maxRFT = maxRFT + p.callRemote(t[i], "getMaxEnergyPerTick")
- RFT = RFT + p.callRemote(t[i], "getEnergyPerTick")
- RFTStore = RFTStore + p.callRemote(t[i], "getEnergy")
- maxRFTStore = maxRFTStore + p.callRemote(t[i], "getMaxEnergy")
- local table = p.callRemote(t[i], "getTankInfo","")
- FName1 = "Inv1"
- FName2 = "Inv2"
- if table[2]["amount"] ~= nil then
- cool = cool + table[2]["amount"]
- FName2 = table[2]["name"]
- end
- maxCool = maxCool + table[2]["capacity"]
- if table[1]["amount"] ~= nil then
- fuel = fuel + table[1]["amount"]
- FName1 = table[1]["name"]
- end
- maxFuel = maxFuel + table[1]["capacity"]
- count = count + 1
- moni.clear()
- moni.setCursorPos(1,1)
- local loading = string.format("%01d%%",(i/((#t)/100)))
- moni.write(loading)
- end
- moni.clear()
- moni.setCursorPos(1,1)
- local procent = string.format("Running: %01d%%", (RFT/maxRFT)*100)
- moni.write(procent)
- moni.setCursorPos(1,2)
- moni.write("Power: " ..RFT.."/"..maxRFT .." RF/t")
- moni.setCursorPos(1,3)
- local EneStor = string.format("Store: %01d/%01d KRF", (RFTStore/1000), (maxRFTStore/1000))
- moni.write(EneStor)
- moni.setCursorPos(1,4)
- local cooling = string.format(FName2 ..": %01d%%", (cool/maxCool)*100)
- moni.write(cooling)
- moni.setCursorPos(1,5)
- local fueling = string.format(FName1 ..": %01d%%", (fuel/maxFuel)*100)
- moni.write(fueling)
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement