Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sides = { "left", "right", "top",
- "bottom", "front", "back" }
- local mon = peripheral.wrap("back")
- os.loadAPI("ProgressBar")
- ProgressBar.SetPeripheral("back")
- function checkIsSide(str)
- for i=1, #sides do
- if str == sides[i] then return true end
- end
- return false
- end
- local num = 0
- mon.setTextScale(2)
- while true do
- peripherals = peripheral.getNames()
- num = 0
- for i=1, #peripherals do
- local name = peripherals[i]
- local displayName = peripherals[i]
- if checkIsSide(name) == false then
- num = num + 1
- if string.find(name, "tank") then
- tank = peripheral.wrap(name)
- info = tank.getTankInfo("unknown")
- local max = 0
- local current = 0
- for u, v in pairs(info) do
- for column,data in pairs(v) do
- print(column..
- ": "..data)
- if column == "capacity" then
- max = data
- elseif column == "amount" then
- current = data
- elseif column == "rawName" then
- mod = data.." "
- displayName = mod
- end
- end
- end
- mon.setCursorPos(1, num)
- mon.write(displayName)
- ProgressBar.SetTable(name, max, current, 15, 25, num)
- ProgressBar.DrawToPeripheral()
- end
- end
- end
- break
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement