Marlingaming

CC Tweaked Banking System - Installer

Jan 20th, 2022 (edited)
652
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --this is a installer for the Banking system
  2. local BankingFormat = "banking_public1"
  3. local OSSystem = "n"
  4. local Paths = {}
  5. local MScript
  6. local ClientApp
  7.  
  8. local function Clear()
  9. term.setbackgroundColor(colors.orange)
  10. term.clear()
  11. term.setCursorPos(1,1)
  12. end
  13.  
  14. local function CreateFolders(startPath)
  15. Paths[1] = startPath.."/BankingScripts/.Secure"
  16. Paths[2] = startPath.."/BankingScripts/Config"
  17. fs.makeDir(Paths[1])
  18. fs.makeDir(Paths[2])
  19. MScript = Paths[1].."/BankingDirector_"..BankingFormat
  20. end
  21.  
  22. local function Downloader()
  23. if BankingFormat == "banking_public1" then
  24.     shell.run("pastebin","get","77LLGHBP",MScript)
  25.     shell.run("pastebin","get","k6aAwARg",ClientApp)
  26. end
  27. settings.load(".settings")
  28. if OSSystem == "CCSPS" then
  29.     shell.run("os/os_Programs/Scripts/ClientAppSetup","Banking Client",ClientApp)
  30. end
  31.  
  32. local function GetOsType()
  33. settings.load(".settings")
  34. OSSystem = settings.get("OperatingSystem")
  35. end
  36.  
  37. local function GetOsSet(action)
  38. local item
  39. if action == "Path" then
  40.     if OSSystem == "CCSPS" then
  41.         item = "os/os_Programs"
  42.         ClientApp = "os/os_Programs/ClientApps/BankingClient_"..BankingFormat
  43.     end
  44. end
  45. return(item)
  46. end
  47.  
  48. local function SetupSettings()
  49. settings.load(".settings")
  50. settings.define("banking_Balance", "temp Banking Display")
  51. settings.set("banking_Balance",0)
  52. settings.define("banking_System", "the Script that handles all Banking Requests")
  53. settings.set("banking_System",MScript)
  54. settings.save(".settings")
  55. end
  56.  
  57. local function InstallMenu()
  58. Clear()
  59. print("Banking Service Installer")
  60. print("hello! and thanks for choosing us as your banking Service, to begin please choose your desired Banking Format")
  61. print("1 - banking_public1")
  62. print("2 - cancel")
  63. local event, key
  64. repeat
  65.     event, key = os.pullEvent("key")
  66. until key == keys.one or key == keys.two
  67. if key == keys.one then
  68.     BankingFormat = "banking_public1"
  69. elseif key == keys.two then
  70.     exit
  71. end
  72. GetOsType()
  73. CreateFolders(GetOsSet("Path"))
  74. SetupSettings()
  75. Downloader()
  76. shell.run(MScript,"setup")
  77. print("download Complete")
  78. os.sleep(3)
  79. Clear()
  80. end
  81.  
  82. InstallMenu()
RAW Paste Data Copied