Advertisement
henoireil

Untitled

Oct 24th, 2015
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. m = peripheral.wrap("right")
  2. ae = peripheral.wrap("left")
  3. m.clear()
  4. m.setCursorPos(1,1)
  5.  
  6. local function centerText(text)
  7. x,y = m.getSize()
  8. x1,y1 = m.getCursorPos()
  9. m.setCursorPos((math.floor(x/2) - (math.floor(#text/2))), y1)
  10. m.write(text)
  11. end
  12.  
  13. --Call function "centerText("")" to set text
  14. --Use m.setCursorPos(1,y) to choose placement on screen
  15.  
  16. y2 = 1
  17.  
  18.  
  19. while true do
  20. m.clear()
  21. m.setCursorPos(1, y2)
  22. m.setTextColor(colors.yellow)
  23. centerText(ae.countOfItemType(4, 0))
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement