Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local b = require("button").monitor
- local maxscale = 0
- local count = 1
- local op = {}
- local m = peripheral.find("monitor")
- local maxitems = 0
- m.clear()
- m.setTextScale(0.5)
- m.setCursorPos(3, 15)
- m.write("counting..")
- local pers = peripheral.getNames()
- for i = 1, #pers do
- if peripheral.getType(pers[i]) == "minecraft:chest" then
- op[count] = pers[i]
- count = count + 1
- end
- end
- for i = 1, #op do
- maxitems = maxitems + peripheral.wrap(op[i]).size() * 64
- end
- local function main()
- while true do
- local curitems = 0
- for i = 1, #op do
- for x = 1, peripheral.wrap(op[i]).size() do
- local item = peripheral.wrap(op[i]).getItemMeta(x) or {count = 0}
- curitems = curitems + item.count
- end
- end
- m.setCursorPos(6, 1)
- m.write("silo")
- b.bar("top", 3, 13, 12, 11, curitems, maxitems, "gray", "red", "white", true, true, "", true, true, true)
- end
- end
- local ok, err = pcall(main)
- if not ok then
- m.clear()
- print("program stopped reason:\n" .. err)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement