Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Requires PeripheralsPlusOne.
- --Designed to work with a computer with a monitor on top and a diamond chest in front.
- chest = peripheral.wrap("front")
- monitor = peripheral.wrap("top")
- x = 1
- y = 1
- while true do
- monitor.clear()
- monitor.setCursorPos(x, y)
- chestList = chest.list()
- chestCount = 0
- for slot, item in pairs(chestList) do
- chestCount = chestCount + item.count
- end
- if chestCount > 9999 then
- fontSize = 0.5
- elseif chestCount > 999 then
- fontSize = 2
- elseif chestCount > 99 then
- fontSize = 2.5
- elseif chestCount > 9 then
- fontSize = 4
- else
- fontSize = 5
- end
- monitor.setTextScale(fontSize)
- monitor.write(string.format("%.0f",chestCount))
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement