Advertisement
IsCactus

Computer Craft Scrolling Display

Apr 22nd, 2024 (edited)
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | Gaming | 0 0
  1. local monitor = peripheral.find("monitor")
  2. local sign = "TEXT - "
  3. local length = #sign
  4. local speed = 0.3
  5.  
  6. function loop(text)
  7.     start = string.sub(text, 1, 1)
  8.     tail = string.sub(text, 2, length)
  9.     return tail .. start
  10. end
  11.  
  12. monitor.setTextColour(colours.white)
  13. monitor.setTextScale(1.8)
  14.  
  15. while (true) do
  16.     monitor.clear()
  17.     monitor.setCursorPos(1, 3)
  18.     monitor.write(sign)
  19.    
  20.     sign = loop(sign)
  21.     sleep(speed)
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement