Advertisement
Guest User

ComputerCraft Scrolling Text (Refined)

a guest
Feb 28th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Settings
  2. mon = peripheral.wrap("back") --Screen Side
  3. mon.setTextScale(4)           --Text Size
  4. strtpos = 18                  --Start position on screen
  5. speed = 0.2                   --Scroll Speed (Seconds)
  6. text = "This is some Text"    --Displayed Text
  7.  
  8. pos = strtpos
  9. poslimit = string.len(text)
  10.  
  11. while true do
  12.  mon.clear()
  13.  mon.setCursorPos(pos, 1)
  14.  mon.write(text)
  15.  sleep(speed)
  16.  if pos*-1 >= poslimit then
  17.   pos = strtpos
  18.  else
  19.   pos = pos - 1
  20.  end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement