Advertisement
TJtheDJ701

Untitled

Sep 27th, 2021
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. cube = peripheral.wrap("left")
  2.  
  3. energy = cube.getEnergy()
  4.  
  5. PrintCentered(energy .. " RF")
  6.  
  7. function PrintCentered(sText)
  8. local w, h = term.getSize()
  9. local x, y = term.getCursorPos()
  10. x = math.max(math.floor((w / 2) - (#sText / 2)), 0)
  11. term.setCursorPos(x, y)
  12. print(sText)
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement