Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function scroll(str,maxlen)
- str=str:sub(-1,-1)==" " and str or str.." "
- local scrolled=0
- while true do
- scrolled=scrolled%#str+1
- term.setCursorPos(1,1)
- write(str:rep(math.ceil((maxlen+scrolled)/str:len())):sub(scrolled,maxlen+scrolled))
- sleep(0.1)
- end
- end
- scroll("hello, this is a test",10)
Advertisement
Add Comment
Please, Sign In to add comment