Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local peripherals = peripheral.getNames()
- local length = #peripherals
- local singlecapacity = peripheral.wrap("radioactiveWasteBarrel_8").getCapacity()
- local totalstored = 0
- modem = peripheral.wrap("right")
- modem.open(7)
- while true do
- for _, name in ipairs(peripherals) do
- if name ~= "back" then
- if name ~= "right" then
- totalstored = 0 + peripheral.wrap(name).getStored().amount
- end
- end
- end
- if totalstored >= singlecapacity*(length-2) then
- modem.transmit(7,7,"SCRAM")
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.red)
- print("Danger")
- term.setCursorPos(1,2)
- print("Info:".. totalstored .."/"..singlecapacity*(length-2).." of "..length-2 .." barrels" )
- term.setCursorPos(1,3)
- print("PercentageTotalStored", string.format("%.2f",(totalstored * 100) / (singlecapacity*(length-2))).."%")
- else
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.lime)
- print("Safe")
- term.setCursorPos(1,2)
- print("Info:".. totalstored .."/"..singlecapacity*(length-2).." of "..length-2 .." barrels" )
- term.setCursorPos(1,3)
- print("PercentageTotalStored", string.format("%.5f",(totalstored * 100) / (singlecapacity*(length-2))).."%")
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement