Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tpm = peripheral.wrap("back")
- local monitors = {
- peripheral.wrap("top"),
- }
- while true do
- local file = fs.open("max_storage.txt", "r")
- local max_storage = tonumber(file.readLine())
- file.close()
- local total_used = 0
- for i, item in ipairs(tpm.listAvailableItems()) do
- total_used = total_used + item.count
- end
- for i, mon in ipairs(monitors) do
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("Storage Used")
- mon.setCursorPos(1,2)
- mon.write(tostring(total_used) .. "/" .. tostring(max_storage))
- end
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement