View difference between Paste ID: fVWPp88e and nKuRW4gj
SHOW: | | - or go back to the newest paste.
1-
local cols = "087f78"
1+
-- pastebin get fVWPp88e wipe
2-
local length = 9
2+
local doWipe = function()
3-
local scr_x, scr_y = term.getSize()
3+
	local scr_x, scr_y = term.getSize()
4-
4+
	local cols = "f7"
5-
local render = function(col1,col2,prog)
5+
	local length = scr_x/2
6-
    term.setCursorPos(1,1)
6+
	local render = function(col1,col2,prog,forwards)
7-
    local screen = (col1:rep(prog)..col2:rep(length-prog)):rep(scr_x*scr_y):sub(1,(scr_x*scr_y))
7+
	    term.setCursorPos(1,1)
8-
    local line
8+
	    local screen = (col1:rep(prog)..col2:rep(length-prog)):rep(scr_x*scr_y):sub(1,(scr_x*scr_y))
9-
    for a = 1, scr_y do
9+
	    local line
10-
        line = screen:sub((a-1)*scr_x+1,a*scr_x)
10+
	    for a = forwards and 1 or scr_y, forwards and scr_y or 1, forwards and 1 or -1 do
11-
        term.setCursorPos(1,a)
11+
	        line = screen:sub((a-1)*scr_x+1,a*scr_x)
12-
        term.blit(("L"):rep(#line),line,line)
12+
	        term.setCursorPos(1,a)
13-
    end
13+
	        term.blit(("L"):rep(#line),line,line)
14
	    end
15-
15+
	end
16-
local pos1 = 2
16+
	local pos1 = 2
17-
local pos2 = pos1 - 1
17+
	local pos2 = pos1 - 1
18-
while true do
18+
	local forwards = true
19-
    for a = 1, length do
19+
	local reverse = false
20-
        render(cols:sub(pos1,pos1),cols:sub(pos2,pos2),a)
20+
	while true do
21-
        sleep(0.05)
21+
	    for a = reverse and length or 1, reverse and 1 or length, reverse and -1 or 1 do
22-
    end
22+
	        render(cols:sub(pos1,pos1),cols:sub(pos2,pos2),a,forwards)
23-
    pos1 = (pos1 + 1)
23+
	        sleep(0.0)
24-
    pos2 = (pos2 + 1)
24+
	    end
25-
    if pos1 > #cols then pos1 = 1 end
25+
		   forwards = not forwards
26-
    if pos2 > #cols then pos2 = 1 end
26+
	   	reverse = not reverse
27-
end
27+
	    pos1 = (pos1 + 1)
28
	    pos2 = (pos2 + 1)
29
	    if pos1 > #cols then pos1 = 1 end
30
	    if pos2 > #cols then pos2 = 1 end
31
	end
32
end
33
local mon = peripheral.find("monitor")
34
if mon then
35
	term.redirect(mon)
36
	mon.setTextScale(0.5)
37
end
38
doWipe()