Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("left")
- mon.setTextScale(5)
- mon.clear()
- pos = mon.getSize()
- term.setTextColor(colors.red) -- Red
- print("Text to display:")
- term.setTextColor(colors.white) -- White
- text = read()
- repeat
- term.setTextColor(colors.red) -- Red
- print("Delay (leave blank for default):")
- term.setTextColor(colors.white) -- White
- delay = read()
- if delay == "" then
- delay = 0.2
- valid = true
- elseif tonumber(delay) < 0 then
- term.setTextColor(colors.orange)-- Orange
- print("Delay must be a positive number")
- valid = false
- elseif tonumber(delay) >= 0 then
- delay = tonumber(delay)
- valid = true
- end
- until valid
- term.setTextColor(colors.green)
- print("Now displaying: " .. '"' .. text .. '"')
- while true do
- pos2 = pos + text:len()
- mon.setCursorPos(pos, 1)
- mon.write(text)
- mon.setCursorPos(pos2, 1)
- mon.write(" ")
- sleep(delay)
- if pos == 0 - text:len() then
- pos = mon.getSize()
- else
- pos = pos - 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement