Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function marqueeRight(side, text, ypos, sleep)
- if peripheral.isPresent(side) then
- term.redirect(peripheral.wrap(side))
- local sx, sy = term.getSize()
- text = string.rep(" ", sx - 1)..text..string.rep(" ", sx - 1)
- for i = 1,string.len(text) - (sx - 1) do
- term.clearLine()
- displayString = string.sub(text, -math.min(string.len(text), i + sx - 2), -i)
- term.setCursorPos(1, ypos)
- write(displayString)
- os.sleep(sleep)
- end
- term.clearLine()
- term.restore()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment