Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Rainbooows! v2 by Jesusthekiller
- -- Do whatever you want, credit is appreciated
- local ot = term.write
- local oc = term.clear
- local rainbow = {
- colors.red,
- colors.orange,
- colors.yellow,
- colors.lime,
- colors.green,
- colors.cyan,
- colors.blue,
- colors.purple,
- }
- local pointer = 1
- local repl = function(text)
- for i = 1, #text do
- local c = text:sub(i,i)
- if c == ' ' then
- ot(c)
- else
- term.setTextColor(rainbow[pointer])
- ot(c)
- pointer = pointer >= #rainbow and 1 or pointer + 1
- end
- end
- end
- local crepl = function()
- oc()
- local p = 1
- local x, y = term.getSize()
- for i = 1, x + y + 8 do
- paintutils.drawLine(i, 1, 1, i, rainbow[p])
- paintutils.drawLine(i - 8, 1, 1, i - 8, colors.black)
- p = p >= #rainbow and 1 or p + 1
- if p % 2 == 0 then
- sleep(0.05)
- end
- end
- term.setBackgroundColor(colors.black)
- oc()
- end
- term.write = repl
- term.clear = crepl
- term.setCursorPos(1, 1)
- for i = 1, 5*18 do
- write("rainbooows")
- end
- term.setCursorPos(1, 19)
Advertisement
Add Comment
Please, Sign In to add comment