Advertisement
Shterman

LoopingTextCC2

Apr 3rd, 2024 (edited)
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local monitor = peripheral.wrap("right")
  2. local monitorSize = monitor.getSize()
  3. local currentCursorPos = 0
  4. local text = "Warning"
  5. local c1 = 0
  6. local c2 = 1
  7. local offset = 1
  8.  
  9. monitor.clear()
  10. monitor.setTextScale(3)
  11. monitor.setCursorPos(1,1)
  12. currentCursorPos = 0 - #text + 1
  13.  
  14. while true do
  15.     c2 = offset
  16.  
  17.     while c1 <= monitorSize do
  18.         if c2 <= #text then
  19.             monitor.write(strsub(text, c2, c2))
  20.             c2 = c2 + 1
  21.             print(c2)
  22.         else
  23.             c2 = 1
  24.         end
  25.         c1 = c1 +1
  26.         print (c1)
  27.         sleep (1)
  28.     end
  29.  
  30.     sleep (1)
  31.     offset = offset + 1
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement