Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap('monitor_0')
- m.setTextScale(4)
- while true do
- remainICount = 0
- storedICount = 0
- percentage = 0
- p = peripheral.wrap('me_drive_8')
- remainICount = remainICount + p.getRemainingItemCount()
- storedICount = storedICount + p.getStoredItemCount()
- percentage = storedICount / remainICount
- percentage = percentage * 100
- percentage = math.floor(percentage + 0.5)
- print("remainICount: "..remainICount)
- print("storedICount: "..storedICount)
- print("Percentage: "..percentage)
- m.clear()
- m.setCursorPos(1,1)
- m.setTextColor(colors.green)
- m.write("Free Space: ")
- m.setCursorPos(1,2)
- m.write(tostring(remainICount))
- m.setCursorPos(1,3)
- m.setTextColor(colors.red)
- m.write("Stored Items: ")
- m.setCursorPos(1,4)
- m.write(tostring(storedICount))
- m.setTextColor(colors.blue)
- m.setCursorPos(1,5)
- m.write(tostring(percentage.." %"))
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement