Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- randomScatter
- local tArgs = {...}
- local x = tonumber(tArgs[1])
- local y = tonumber(tArgs[2])
- local screen = tArgs[3]
- local width = 0
- for i=1,#screen,1 do
- if string.len(screen[i]) > width then width = string.len(screen[i]) end
- end
- local errChars = {"%","#","?","$","/","\\","="}
- local nums = {}
- for cX=1,width,1 do
- for cY = 1, #screen, 1 do
- table.insert(nums,{cX,cY})
- end
- end
- local c=0
- while #nums>0 do
- local f = table.remove(nums,math.random(1,#nums))
- term.setCursorPos(f[1]+x-1,f[2]+y-1)
- term.write(errChars[math.random(1,#errChars)])
- c=c+1
- if c >= 3 then
- c=0
- sleep(.05)
- end
- end
- local nums = {}
- for cX=1,width,1 do
- for cY = 1, #screen, 1 do
- table.insert(nums,{cX,cY})
- end
- end
- c=0
- while #nums>0 do
- local f = table.remove(nums,math.random(1,#nums))
- term.setCursorPos(f[1]+x-1,f[2]+y-1)
- if string.len(screen[f[2]]) < f[1] then
- term.write(" ")
- else
- term.write(string.sub(screen[f[2]],f[1],f[1]))
- end
- c=c+1
- if c>=3 then
- sleep(.05)
- c=0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment