Advertisement
Guest User

Untitled

a guest
Mar 29th, 2023
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. function comma_value(amount)
  2. local formatted = amount
  3. while true do
  4. formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
  5. if (k==0) then
  6. break
  7. end
  8. end
  9. return formatted
  10. end
  11.  
  12. function sleep(_nTime)
  13. local timer = os.startTimer(_nTime)
  14.  
  15. repeat
  16. local sEvent, param = os.pullEvent("timer")
  17. until param == timer
  18. end
  19.  
  20. x = peripheral.wrap("bottom")
  21. term.setBackgroundColor(colors.black)
  22. term.setTextColor(colors.red)
  23. term.clear()
  24.  
  25. while true do
  26. data = x.getHeatedCoolant()
  27. data2 = x.getHeatedCoolantCapacity()
  28. term.setCursorPos(1, 1)
  29. print(math.floor((data.amount/data2)*100).."% Capacity.", comma_value(data.amount).."mb", data.name)
  30. sleep(0.1)
  31. end
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement