Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. local sText = "plug walk!" -- You can change the text
  2. local sSide = "top" -- you can change the side of the monitor
  3.  
  4. local function printCenter(mon, txt)
  5. local w, h = mon.getSize()
  6. local x = math.floor((w / 2) - (#txt / 2))
  7. local y = math.floor((h / 2))
  8. mon.setCursorPos(x, y)
  9. mon.write("plug walk!")
  10. sleep(.2)
  11. mon.setTextColor(red)
  12. sleep(.2)
  13. mon.setTextColor(magenta)
  14. sleep(.2)
  15. mon.setTextColor(red)
  16. sleep(.2)
  17. mon.setTextColor(magenta)
  18. sleep(.2)
  19. mon.setTextColor(red)
  20. sleep(.2)
  21. mon.setTextColor(magenta)
  22. sleep(.2)
  23. mon.setTextColor(red)
  24. sleep(.2)
  25. mon.setTextColor(magenta)
  26. sleep(.2)
  27. end
  28.  
  29. local monitor = peripheral.wrap(sSide)
  30. printCenter(monitor, sText)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement