PeachGaming

Untitled

May 23rd, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. local m = peripheral.wrap("monitor_24")
  2. local m2 = peripheral.wrap("monitor_25")
  3. m.clear()
  4. m.setCursorPos(1,1)
  5.  
  6. local function writeCentered( text )
  7.   local x, y = term.getSize()
  8.   local centerYPos = y / 2
  9.   local centerXStartingPos = ( x - string.len(text) ) / 2
  10.   term.setCursorPos( centerXStartingPos, centerYPos )
  11. m2.setCursorPos( centerXStartingPos, centerYPos )
  12.   write( text )
  13.   m2.write(text)
  14. end
  15.  
  16. term.redirect(m)
  17.  
  18. term.setBackgroundColor(colors.cyan)
  19. term.clear()
  20. m2.setBackgroundColor(colors.cyan)
  21. m2.clear()
  22. while true do
  23. f = fs.open("show", "r")
  24. local data = {}
  25. for line in f.readLine do
  26.  
  27. writeCentered(line)
  28. sleep(8)
  29. term.clear()
  30. m2.clear()
  31. sleep(4)
  32.  
  33. end
  34. f.close()
  35.  
  36.  
  37. end
Advertisement
Add Comment
Please, Sign In to add comment