Marlingaming

CC Tweaked CCSPS Iron - Install Manager/Handler

Jan 27th, 2022 (edited)
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. --this script combines all parts of past install Scripts CCSPS used
  2. local tArg = {...}
  3. local Path = tArg[1]
  4. local Code = tArg[2]
  5. local Type = tArg[3]
  6. local KeyWords = {"os.reboot","os.shutDown()","settings.clear"}
  7. local Accept = true
  8. settings.load(".settings")
  9.  
  10. function ScanFile()
  11. for i = 1, #KeyWords do
  12. ScanKey(KeyWords[i])
  13. end
  14. end
  15.  
  16. function ScanKey(Word)
  17. local file = fs.open(Path,"r")
  18. local Line = file.readAll()
  19. local Search = string.find(Line,Word)
  20. if Search then
  21. Accept = false
  22. end
  23. file.close()
  24. end
  25.  
  26.  
  27.  
  28. function SetupFile_Client()
  29. local AppPaths = settings.get("ClientApps_Paths")
  30. local AppNames = settings.get("ClientApps_Names")
  31. AppPaths[#AppPaths + 1] = Path
  32. AppNames[#AppNames + 1] = tArg[4]
  33. settings.set("ClientApps_Paths",AppPaths)
  34. settings.set("ClientApps_Names",AppNames)
  35. settings.save(".settings")
  36. local Pa = fs.combine("os/System/Client/Files/AppStore",tArg[4])
  37. local file = fs.open(Pa,"w")
  38. local Data = {Path,"1.0.0"}
  39. file.write(textutils.serialize(Data))
  40. file.close()
  41. shell.run("os/System/Scripts/ShortcutWriter",tArg[4],Path,tArg[5])
  42. end
  43.  
  44.  
  45. function CheckType()
  46. if Type == "Client" then
  47. SetupFile_Client()
  48. elseif Type == "Extension" then
  49.  
  50. end
  51. end
  52.  
  53. settings.load(".settings")
  54. local Paster = settings.get("osPaster")
  55. shell.run(Paster,"get",Code,Path)
  56. ScanFile()
  57.  
  58. if Accept == true then
  59. CheckType()
  60. else
  61. fs.delete(Path)
  62. end
Add Comment
Please, Sign In to add comment