David_Turtle

Turtle "Virus"

Nov 9th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.55 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. term.clear()
  3. term.setCursorPos(0,0)
  4. print("Reserving Memory Space...")
  5. os.sleep(4)
  6. print("Initializing Download...")
  7. os.sleep(2)
  8. print("Starting Download")
  9. os.sleep(5)
  10. local zeichen = {"1","0"}
  11. for i=0,100 do
  12.     for i=0,47 do
  13.         char = zeichen[math.random(1, #zeichen)]
  14.         term.write(char)
  15.     end
  16.     print(char)
  17.     os.queueEvent("randomEvent")
  18.     os.pullEvent()
  19. end
  20. os.sleep(4)
  21. print("")
  22. print("Download completed!")
  23. print("Unpacking Data...")
  24. os.sleep(2)
  25. print("'Virus.app' has been moved to 'startup'")
  26. os.sleep(1)
  27. print("Removing old Files...")
  28. os.sleep(4)
  29. print("Files Removed")
  30. os.sleep(2)
  31. print("Rebooting System in 5")
  32. os.sleep(1)
  33. print("Rebooting System in 4")
  34. os.sleep(1)
  35. print("Rebooting System in 3")
  36. os.sleep(1)
  37. print("Rebooting System in 2")
  38. os.sleep(1)
  39. print("Rebooting System in 1")
  40. os.sleep(1)
  41. print("Rebooting System now")
  42. os.sleep(2)
  43. term.clear()
  44. term.setCursorPos(1,1)
  45. print("VirusOS 1.1")
  46. print("")
  47. local inFolder = "root"
  48. local deleted = false
  49. local stop = 0
  50. os.sleep(3)
  51. print("Starting 'Virus.app'...")
  52. print("Done")
  53. while stop == 0 do
  54.     local command = read()
  55.     if command == "help" then
  56.         print("Command List:")
  57.         print("help delete reboot edit version open")
  58.         print("Dir: " ..inFolder)
  59.     elseif command == "delete" then
  60.         print("Delete what File?")
  61.         local file = read()
  62.         if (inFolder == "startup") and (file == 'virus.app') and (deleted == false) then
  63.             print("File deleted")
  64.             deleted = true
  65.         elseif (inFolder == "startup") and (file == 'system.dc') then
  66.             print("Access denied")
  67.        
  68.         elseif (inFolder == "startup") and (file == 'config.lpc') then
  69.             print("Access denied")
  70.         else
  71.             print("File not found")
  72.         end
  73.     elseif command == "reboot" then
  74.         print("Rebooting System in 5")
  75.         os.sleep(1)
  76.         print("Rebooting System in 4")
  77.         os.sleep(1)
  78.         print("Rebooting System in 3")
  79.         os.sleep(1)
  80.         print("Rebooting System in 2")
  81.         os.sleep(1)
  82.         print("Rebooting System in 1")
  83.         os.sleep(1)
  84.         print("Rebooting System now")
  85.         os.sleep(2)
  86.         term.clear()
  87.         if deleted == true then
  88.             stop = 1
  89.         else
  90.             print("VirusOS 1.1")
  91.             os.sleep(3)
  92.             print("Starting 'Virus.app'...")
  93.             print("Done")
  94.         end
  95.     elseif command == "edit" then
  96.         print("Edit what File?")
  97.         local file = read()
  98.         if (inFolder == "startup") and (file == 'virus.app') and (deleted == false) then
  99.             print("Access denied")
  100.         elseif (inFolder == "startup") and (file == 'system.dc') then
  101.             print("Access denied")
  102.        
  103.         elseif (inFolder == "startup") and (file == 'config.lpc') then
  104.             print("Access denied")
  105.         else
  106.             print("File not found")
  107.         end
  108.     elseif command == "version" then
  109.         term.clear()
  110.         term.setCursorPos(1,1)
  111.         print("VirusOS 1.1")
  112.         print("Directory : "..inFolder)
  113.     elseif command == "open" then
  114.         print("Open what Folder?")
  115.         local folder = read()
  116.         if folder == "startup" then
  117.             print("Directory has been changed to 'startup'")
  118.             print("Files: 'virus.app', 'system.dc', 'config.lpc'")
  119.             inFolder = "startup"
  120.         else
  121.             print("Folder not found")
  122.         end
  123.     else
  124.         print("ERROR 2.3")
  125.         print("exception handle: unknown command")
  126.     end
  127. end
  128. term.clear()
  129. term.setCursorPos(1,1)
  130. os.sleep(2)
  131. print("War kein echter Virus, du hast dich aber trotzdem gut geschlagen!")
  132. os.sleep(3)
  133. print("Echter System-Neustart in 5")
  134. os.sleep(1)
  135. print("Echter System-Neustart in 4")
  136. os.sleep(1)
  137. print("Echter System-Neustart in 3")
  138. os.sleep(1)
  139. print("Echter System-Neustart in 2")
  140. os.sleep(1)
  141. print("Echter System-Neustart in 1")
  142. os.sleep(1)
  143. print("Echter System-Neustart jetzt")
  144. os.sleep(2)
  145. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment