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 ProgressBar[name] == nil then
- ProgressBar[name] = {}
- ProgressBar[name]["XMin"] = 10
- ProgressBar[name]["XMax"] = 40
- ProgressBar[name]["YVal"] = num * 5
- end
- if string.find(name, "tank") then
- tank = peripheral.wrap(name)
- info = tank.getTankInfo("unknown")
- for u, v in pairs(info) do
- for column,data in pairs(v) do
- print(column..
- ": "..data)
- if column == "capacity" then
- ProgressBar[name]["Max"] = data
- elseif column == "amount" then
- ProgressBar[name]["Current"] = data
- elseif column == "rawName" then
- mod = data.." "
- displayName = mod
- end
- end
- end
- end
- --mon.setCursorPos(1, num)
- --mon.write(displayName)
- ProgressBar.DrawToPeripheral()
- end
- end
- break
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement