Marlingaming

CC Tweaked File - Online Setup File

Jan 5th, 2022 (edited)
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. --this is a Online Setup Script for CSP
  2. local Taxed = 20
  3. local Address = "n"
  4. local Properties = "n"
  5. print("--------------------")
  6. print("-------Setup--------")
  7. print("--------------------")
  8. local ConfirmFile = fs.open("os/os_SystemFiles/setupCompleted", "w")
  9. local UserApps = {"os_UserProfilePg","os_BankingApp"}
  10. local ProgramsName = {"Account","Banking"}
  11. local ProgramConnect = {"false","true"}
  12. ConfirmFile.writeLine(os.date())
  13. ConfirmFile.writeLine("Completed")
  14. ConfirmFile.close()
  15.  
  16. settings.load(".settings")
  17. settings.define("UpdateFile",{ description = "used to figure out what file is used to update scripts", default = false})
  18. settings.define("Secure_WirelessProtocol",{ description = "Personal Security Protocol", default = "1000"})
  19. settings.set("Secure_WirelessProtocol",math.random(1000,9999))
  20. settings.save(".settings")
  21. local User
  22. local event
  23. if fs.exists("temp_SetupFile") == true then
  24. print("setup file found")
  25. print("setting up account off of File")
  26. local SetupFile = fs.open("temp_SetupFile","r")
  27. User = SetupFile.readLine()
  28. Taxed = SetupFile.readLine()
  29. Address = SetupFile.readLine()
  30. Properties = SetupFile.readLine()
  31. SetupFile.close()
  32. print("do you wish to delete the Transfer file?")
  33. print("y/n")
  34. repeat
  35. event = {os.pullEvent("key")}
  36. until event[2] == keys.n or event[2] == keys.y
  37. if event[2] == keys.y then
  38. fs.delete("temp_SetupFile")
  39. print("file Deleted")
  40. elseif event[2] == keys.n then
  41. print("moving file to archive")
  42. fs.move ("temp_SetupFile","os/os_TempFiles/Archive")
  43. end
  44. end
  45. if settings.get("os_Username") == "guest" then
  46. print("Please Enter User Name")
  47. while true do
  48. local event = {os.pullEvent("key")}
  49. if event[2] == keys.enter then break end
  50. User = read()
  51. end
  52. settings.set("os_Username",User)
  53. else
  54. User = settings.get("os_Username")
  55. print("User name Detected as = "..User)
  56. end
  57. print("Confirmed, to switch Name in the future, please")
  58. local file = fs.open("os/os_UserFiles/AccountDetails","w")
  59. file.writeLine(User)
  60. file.writeLine(Taxed)
  61. file.writeLine(Address)
  62. file.writeLine(Properties)
  63. file.close()
  64. settings.save(".settings")
  65. if settings.get("banking_System") ~= "n" then
  66. shell.run( settings.get("banking_System"),"setup")
  67. end
  68. print("Contact your local Administrator")
  69. print("---------------------")
  70. print("---Setup--Finished---")
  71. print("---------------------")
  72. os.sleep(3)
Add Comment
Please, Sign In to add comment