Advertisement
Scarjit

Spacechecker V1.3

Apr 27th, 2014
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. m = peripheral.wrap('monitor_0')
  2. m.setTextScale(4)
  3. while true do
  4. remainICount = 0
  5. storedICount = 0
  6. percentage = 0
  7.         p = peripheral.wrap('me_drive_8')  
  8.         remainICount = remainICount + p.getRemainingItemCount()
  9.         storedICount = storedICount + p.getStoredItemCount()
  10.         percentage = storedICount / remainICount
  11.         percentage = percentage * 100
  12.         percentage = math.floor(percentage + 0.5)
  13. print("remainICount: "..remainICount)
  14. print("storedICount: "..storedICount)
  15. print("Percentage: "..percentage)
  16. m.clear()
  17. m.setCursorPos(1,1)
  18. m.setTextColor(colors.green)
  19. m.write("Free Space: ")
  20. m.setCursorPos(1,2)
  21. m.write(tostring(remainICount))
  22. m.setCursorPos(1,3)
  23. m.setTextColor(colors.red)
  24. m.write("Stored Items: ")
  25. m.setCursorPos(1,4)
  26. m.write(tostring(storedICount))
  27. m.setTextColor(colors.blue)
  28. m.setCursorPos(1,5)
  29. m.write(tostring(percentage.." %"))
  30. os.sleep(1)
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement