Advertisement
Marlingaming

Aperture Science OS System - Downloader

Sep 20th, 2021 (edited)
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. local tArg = {...}
  2. --Download Manager
  3. --this program takes download info, downloads, and updates the System Download List
  4. local Item = tArg[1]
  5. local Type = tArg[4]
  6. local Code = tArg[3]
  7. local DestinationFile = tArg[2]
  8. local PrintOutput = tArg[5]
  9.  
  10. if PrintOutput == true then
  11. print(tArg[1])
  12. print(tArg[2])
  13. print(tArg[3])
  14. print(tArg[4])
  15. end
  16.  
  17. local Text = nil
  18.  
  19.  
  20.  
  21. function AddToFile(Des)
  22. local File = fs.open(Des,"a")
  23. File.writeLine(Item)
  24.  
  25. File.close()
  26. end
  27.  
  28. if fs.exists("ApertureOS_Programs") == false then
  29. local Pro = fs.open("/OS/System/Files/ApertureOS_Programs","w")
  30. Pro.close()
  31. end
  32.  
  33. if fs.exists("ApertureOS_Files") == false then
  34. local Pro = fs.open("/OS/System/Files/ApertureOS_Files","w")
  35. Pro.close()
  36. end
  37.  
  38. if fs.exists("ApertureDL_Programs") == false then
  39. local Pro = fs.open("/OS/System/Files/ApertureDL_Programs","w")
  40. Pro.close()
  41. end
  42.  
  43. if fs.exists("ApertureDL_Downloads") == false then
  44. local Pro = fs.open("/OS/System/Files/ApertureDL_Downloads","w")
  45. Pro.close()
  46. end
  47.  
  48. if Type == "OS" then
  49. AddToFile("ApertureOS_Programs")
  50. end
  51.  
  52. if Type == "File" then
  53. AddToFile("ApertureOS_Files")
  54. end
  55.  
  56. if Type == "Addon" then
  57. AddToFile("ApertureDL_Programs")
  58. end
  59.  
  60.  
  61. if Type == "Public" then
  62. AddToFile("ApertureDL_Downloads")
  63. end
  64.  
  65.  
  66.  
  67. local Send = fs.combine("OS/System",DestinationFile,Item)
  68. if Code == "n" then
  69. fs.move(Item,Send)
  70. else
  71. shell.run("C_Pastebin","get",Code,Send)
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement