Advertisement
henoireil

Untitled

Oct 23rd, 2015
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. m = peripheral.wrap("right")
  2. m.clear()
  3. m.setCursorPos(1,1)
  4.  
  5. local function centerText(text)
  6. x,y = m.getSize()
  7. x1,y1 = m.getCursorPos()
  8. m.setCursorPos((math.floor(x/2) - (math.floor(#text/2))), y1)
  9. m.write(text)
  10. end
  11.  
  12. --Call function "centerText("")" to set text
  13. --Use m.setCursorPos(1,y) to choose placement on screen
  14.  
  15. y2 = 1
  16.  
  17.  
  18. while true do
  19. if pos = 10 then
  20. pos = 1
  21. end
  22.  
  23. m.clear()
  24. m.setCursorPos(1, y2)
  25. m.setTextColor(colors.yellow)
  26. centerText("Welcome to TheSommer's Base!")
  27. m.setCursorPos(1, y2 + 1)
  28. centerText("If you need anything, you're welcome to borrow.")
  29. m.setCursorPos(1, y2 + 3)
  30. m.setTextColor(colors.lightBlue)
  31. centerText("youtube.com/TheSommersMC")
  32. m.setCursorPos(1, y2 + 5)
  33. m.setTextColor(colors.lime)
  34. centerText("<3 Sommer")
  35. y2 = y2 + 1
  36. os.sleep(1)
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement