Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- FrekSystem
- -- pastebin get e99GHzb9 disk/startup
- -- pastebin get nW0L33Tp disk/ComputerSoftware
- function checkIfInstalled()
- if fs.exists("FrekSystem/UserData/Username") and fs.exists("FrekSystem/UserData/Password") then
- if fs.exists("FrekSystem/UserData/Username") then
- shell.run("startup")
- else
- print("The FrekSystem is not installed!")
- print("It will now be installed, please be patient.")
- fs.makeDir("FrekSystem/UserData")
- selectName()
- end
- else
- print("The FrekSystem is not installed!")
- print("It will now be installed, please be patient.")
- fs.makeDir("FrekSystem/UserData")
- selectName()
- end
- end
- function installSystem()
- fs.delete("startup")
- fs.copy("disk/ComputerSoftware", "startup")
- print("")
- print("Installation is done!")
- print("Reboots in")
- print("3")
- sleep(1)
- print("2")
- sleep(1)
- print("1")
- sleep(1)
- print("Rebooting...")
- sleep(1)
- os.reboot()
- end
- function createNewPassword()
- term.clear()
- term.setCursorPos(1,1)
- local Password = ""
- print("[-------------------------------------------------]")
- print("[- FrekSystem V.1.0.0 Installer -]")
- print("[-------------------------------------------------]")
- write("Please type wanted password: ")
- Password = read()
- term.clear()
- term.setCursorPos(1,1)
- print("[-------------------------------------------------]")
- print("[- FrekSystem V.1.0.0 Installer -]")
- print("[-------------------------------------------------]")
- print("Selected password: ", Password)
- file = io.open("FrekSystem/UserData/Password", "w")
- file:write(Password)
- file:close()
- installSystem()
- end
- function selectName()
- term.clear()
- term.setCursorPos(1,1)
- local Username = ""
- print("[-------------------------------------------------]")
- print("[- FrekSystem V.1.0.0 Installer -]")
- print("[-------------------------------------------------]")
- write("Please type the username you want: ")
- Username = read()
- if Username == "" then
- print("[Error] Username cannot be blank!")
- sleep(2)
- selectName()
- else
- file = io.open("FrekSystem/UserData/Username", "w")
- file:write(Username)
- file:close()
- createNewPassword()
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- checkIfInstalled()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement