Advertisement
LazerAio

APM

Mar 16th, 2022 (edited)
255
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.40 KB | None | 0 0
  1. args = {...}
  2. print("There is a new update avaible, APM has been moved to github. Please run 'APM update'")
  3. PackW =
  4. {
  5. "AIOS MAY CHANGE SYSTEM SETTINGS/FILES",
  6. nil,
  7. "REACTOR IS INSTALLED AS A STARTUP FILE",
  8. nil,
  9. nil,
  10. nil,
  11. nil,
  12. nil,
  13. nil,
  14. nil,
  15. "POST INSTALL PLEASE INSTALL ONCE MORE",
  16. "YOU ARE ABOUT TO INSTALL PACKMAN IT IS VERY LARGE",
  17. nil,
  18. nil,
  19. nil,
  20. nil,
  21. "THIS PROGRAM REQUIERS A SPEAKER",
  22. "THIS PROGRAM REQUIERS AN ADVANCED COMPUTER!",
  23. "THIS PROGRAM INTERFACES WITH WEBSOCETS",
  24. "THIS PROGRAM IS IN EARLY ALPHA",
  25. "THIS PROGRAM IS IN EARLY ALPHA",
  26. nil
  27. }
  28. PackN =
  29. {
  30. {"AIOS","Aiosos","Aio's os"},
  31. {"ASSAV","ASS-AV","Aios secure shell - antivirus","Aios secure shell"},
  32. {"REACTOR","CCreactor controller v1.5","CCreactor","ComputerCraft reactor controller V1.5","CCreactor controller"},
  33. {"ARE","Aios Remote Explorer"},
  34. {"ARS","Aios Remote server"},
  35. {"FM2","File Manager 2"},
  36. {"AFETCH","AioFetch"},
  37. {"FTP","File Transfer Protocall"},
  38. {"ANO","Aio Text Editor"},
  39. {"RemoteSuite","RS","Remote Suite"},
  40. {"cowsay"},
  41. {"packman","packmanager","packageman","packagemanager","package manager"},
  42. {"harbor","packman-harbor","harbour","packman-harbour"},
  43. {"harbor-extras","harbor extra","harbour-extras","harbour extra","harborE","harbourE"},
  44. {"palCollection","palleteCollection","pallateCollection","colors collection","colours collection"},
  45. {"palPal","pallete pal","pellete pal"},
  46. {"SimplePiano","Piano"},
  47. {"ScrnSavr","Screen Saver","ScreenSaver"},
  48. {"SkyNet","IRC","Internet Relay Chat"},
  49. {"ccLiquidReactor","computercraft liquid reactor"},
  50. {"ccTurbineReactor","computercraft turbine reactor"},
  51. {"CCH","computercraftshell","remote shell"}
  52. }
  53. PackR =
  54. {
  55. nil,
  56. nil,
  57. nil,
  58. nil,
  59. nil,
  60. "APM findInstall ANO",
  61. nil,
  62. nil, --please see http://www.computercraft.info/forums2/index.php?/topic/22471-file-transfer-protocol-ftp/
  63. nil,
  64. "APM findInstall FTP",
  65. "APM findInstall packman", --please see http://www.computercraft.info/forums2/index.php?/topic/27992-cowsay-for-computercraft/
  66. nil, --please see http://www.computercraft.info/forums2/index.php?/topic/22268-packman-a-package-management-tool/
  67. nil, --please see https://forums.computercraft.cc/index.php?topic=91.0
  68. nil, --please see https://forums.computercraft.cc/index.php?topic=91.0
  69. "APM findInstall palpal", --please see https://forums.computercraft.cc/index.php?topic=61.0
  70. nil, --please see https://forums.computercraft.cc/index.php?topic=60.0
  71. nil, --please see https://forums.computercraft.cc/index.php?topic=383.0
  72. nil,
  73. nil, --please see https://forums.computercraft.cc/index.php?topic=71.0
  74. nil, --Please see file for creddits
  75. nil,  --Please see file for creddits
  76. "APM findInstall SkyNet"
  77. }
  78. PackI =
  79. {
  80. "pastebin run mgg84eJ7",
  81. "pastebin get 6gadUHeS ASS",
  82. "pastebin get sczNdpjm startup",
  83. "pastebin get e8HMLxPJ ARE",
  84. "pastebin get Q9W6KJ2X ARS",
  85. "pastebin get bX2Rb0b2 FM2",
  86. "pastebin get tEg6UR0w AFETCH",
  87. "pastebin get bihLMhkX FTP",
  88. "pastebin get bkKTcs8H ANO",
  89. "pastebin get VcKspez7 RemoteSuite",
  90. "packman install cowsay",
  91. "pastebin run 4zyreNZy",
  92. "pastebin run ivRuuLSH",
  93. "pastebin run ivRuuLSH extras",
  94. "wget https://raw.githubusercontent.com/Wendelstein7/palCollection-CC/master/palCollection.lua palCollection.lua",
  95. "wget https://raw.githubusercontent.com/Wendelstein7/palPal-CC/master/palPal.lua palPal.lua",
  96. "pastebin get ZdSjei8j piano",
  97. "pastebin get Bq5ERu8F ScrnSavr",
  98. "wget https://raw.githubusercontent.com/osmarks/skynet/master/client.lua skynet",
  99. "pastebin get SPPM2HWQ ccLiquidReactor",
  100. "pastebin get HjAaxXfR ccTurbineReactor",
  101. "pastebin get bzGHsYhk CCH"
  102. }
  103. if #args < 1 then
  104.     print("USE")
  105.     print("APM install <id> {flags}")
  106.     print("APM findInstall <name>")
  107.     print("APM search <name>")
  108.     print("APM update")
  109.     print("APM list {flags}")
  110.     print("APM mirror <id>")
  111.        print("install flags are")
  112.     print("-y to autoinstall")
  113.     print("list flags are")
  114.     print("-i for the IDs")
  115. end
  116. function install(args)
  117.     --FOR SECURITY REASONS THE FOLLOWING IS NEEDED DO NOT REMOVE IT!
  118.     sleep(math.random(0.5,1))
  119.     if tonumber(args[2]) < #PackN+1 then
  120.         i = tonumber(args[2])
  121.         if PackW[i] == nil then
  122.                  else
  123.             print(PackW[i])
  124.             if args[3] == "-y" then
  125.                    print("auto granting!")
  126.                         else
  127.                 print("Enter Y/n")
  128.                    if string.upper(read()) == "Y" then
  129.                 else
  130.                     print("Aborted install")
  131.                     return false
  132.                 end
  133.             end
  134.         end
  135.         shell.run(PackI[i])
  136.         if fs.exists(PackR[i]) or fs.exists(PackR[i]..".lua") then
  137.         else
  138.             if args[3] == "-y" then
  139.                 shell.run(PackR[i],"-y")
  140.             else
  141.                 shell.run(PackR[i])
  142.             end
  143.         end
  144.     else
  145. end
  146. end
  147. function search(name)
  148.     if args[1] == "search" then
  149.         print("The following matches was found:")
  150.     end
  151.     for i=1,#PackN do
  152.         for j=1,#PackN[i] do
  153.             if string.upper(PackN[i][j]) == string.upper(name) then
  154.                 if args[1] == "search" then
  155.                     print(name,"or",PackN[i][1],"has id",i)
  156.                     break
  157.                 elseif args[1] == "findInstall" then
  158.                     args[2] = i
  159.                     return args
  160.                 end
  161.             end
  162.         end
  163.     end
  164. end
  165. if args[1] == "install" then
  166.     install(args)
  167. elseif args[1] == "search" then
  168.     search(args[2])
  169. elseif args[1] == "findInstall" then
  170.     install(search(args[2]))
  171. elseif args[1] == "list" then
  172.     for i=1,#PackN do
  173.         sleep(1)
  174.         print(PackN[i][1])
  175.         if #args > 1 and args[2] == "-i" then
  176.             print("it has the ID",i)
  177.         end
  178.     end
  179. elseif args[1] == "update" then
  180.     if fs.exists("APMold") then
  181.         print("It is not safe to update at the moment")
  182.         return false
  183.     end
  184.     shell.run("mv APM APMold")
  185.     shell.run("wget https://raw.githubusercontent.com/TheAio/CC-ALLUDE/main/APM APM")
  186.     if fs.exists("APM") then
  187.         shell.run("rm APMold")
  188.     else
  189.         print("Failed to update")
  190.         shell.run("mv APMold APM")
  191.     end
  192. elseif args[1] == "mirror" and #args > 1 then
  193.     i = tonumber(args[2])
  194.     if i < #PackN+1 then
  195.         print(PackN[i][1])
  196.         print("can be found useing")
  197.         print(PackI[i])
  198.         if PackR[i] == nil then
  199.         else
  200.             print("after running")
  201.             print(PackR[i])
  202.         end
  203.     end
  204. end
Advertisement
Comments
  • LazerAio
    2 years
    # text 0.15 KB | 0 0
    1. This is now a fairly old version, run "wget https://raw.githubusercontent.com/TheAio/CC-APM/main/APM APM" then "APM update" for the most recent version.
Add Comment
Please, Sign In to add comment
Advertisement