Advertisement
Mordrack

Rayonnage

Sep 27th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. m1 = ""
  2. m2 = ""
  3. m3 = ""
  4. --m4 = ""
  5. --m5 = ""
  6. --m6 = ""
  7. --m7 = ""
  8.  
  9. t1 = ""
  10. t2 = ""
  11. t3 = ""
  12. --t4 = ""
  13. --t5 = ""
  14. --t6 = ""
  15. --t7 = ""
  16.  
  17. local function centerText(text,monitor)
  18.  
  19.   m = peripheral.wrap(monitor)
  20.   m.clear()
  21.   m.setCursorPos(1,2)
  22.   m.setTextScale(1.5)
  23.  
  24.   x,y = m.getSize()
  25.   x1,y1 = m.getCursorPos()
  26.   m.setCursorPos((math.floor(x/2) - (math.floor(#text/2)) + 1), y1)
  27.   m.write(text)
  28.    
  29. end
  30.  
  31. centerText(t1,m1)
  32. centerText(t2,m2)
  33. centerText(t3,m3)
  34. --centerText(t4,m4)
  35. --centerText(t5,m5)
  36. --centerText(t6,m6)
  37. --centerText(t7,m7)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement