Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Doggy OS Systems
- -- DogRE 13.0 (N3K0 V13 CFG)
- local function clearScreen(message)
- term.clear()
- term.setCursorPos(1, 1)
- if message then
- print(message)
- end
- end
- local function waitForDisk(diskPath, message)
- clearScreen(message)
- while not fs.exists(diskPath) do
- sleep(1)
- end
- end
- local function promptForEnter(message)
- print(message .. " Press Enter to continue...")
- io.read()
- end
- local function askToOverride(filePath)
- clearScreen("File " .. filePath .. " already exists.\nDo you want to override it?\n1. Yes\n2. No (Skip)")
- local choice = tonumber(io.read())
- return choice == 1
- end
- local function displayError(errorMsg, errorCode)
- clearScreen("===== DOGGY OS SYSTEM RECOVERY ERROR =====")
- print("Error Message: " .. errorMsg)
- print("Error Code: " .. (errorCode or "DOSx7002"))
- print("\nPossible Causes:")
- print("1. Missing or corrupted files.")
- print("2. Disk access errors.")
- print("3. Unexpected system behavior.")
- print("\nSuggested Actions:")
- print("1. Check disk connections and try again.")
- print("2. Run a full system recovery.")
- print("3. Contact support if the issue persists.\n")
- promptForEnter("Press Enter to Reboot system and return to normal system environment")
- end
- local function showLoadingScreen(message, totalSteps)
- local barLength = 30
- clearScreen(message)
- for step = 1, totalSteps do
- term.setCursorPos(1, 3)
- write("[")
- for i = 1, barLength do
- if i <= math.floor((step / totalSteps) * barLength) then
- write("=")
- else
- write(" ")
- end
- end
- write("] " .. math.floor((step / totalSteps) * 100) .. "%")
- sleep(0.3)
- end
- end
- local function fullSystemRecovery()
- showLoadingScreen("Starting Full System Recovery...", 50)
- -- Logic to restore files from /recovery
- clearScreen("Recovery process completed.\nThe system is now restored.")
- promptForEnter("Press Enter to exit")
- end
- local function wipeDataAndResetFactoryDefaults()
- showLoadingScreen("Wiping data and resetting to factory defaults...", 50)
- -- Logic to delete everything except /disk/users/ and restore from /.doggyfactorydefaults/
- clearScreen("Factory reset completed.\nPreparing for system setup...")
- shell.run("/disk/setup")
- end
- local function recoveryMenu()
- while true do
- clearScreen("===== Recovery Options =====\n1. Full System Recovery\n2. Wipe data / Reset to factory defaults\n3. Exit")
- local choice = tonumber(io.read())
- if choice == 1 then
- fullSystemRecovery()
- elseif choice == 2 then
- wipeDataAndResetFactoryDefaults()
- elseif choice == 3 then
- break
- else
- clearScreen("Invalid choice. Please try again.")
- sleep(2)
- end
- end
- end
- local function powerMenu()
- clearScreen("===== Power Options =====\n1. Reboot system\n2. Shutdown system")
- local choice = tonumber(io.read())
- if choice == 1 then
- os.reboot()
- elseif choice == 2 then
- os.shutdown()
- else
- clearScreen("Invalid choice. Please try again.")
- sleep(2)
- end
- end
- local function mainMenu()
- while true do
- clearScreen("===== Doggy OS DEV Recovery GUI =====\n1. Recovery Options\n2. Power Options\n3. Exit")
- local choice = tonumber(io.read())
- if choice == 1 then
- recoveryMenu()
- elseif choice == 2 then
- powerMenu()
- elseif choice == 3 then
- break
- else
- clearScreen("Invalid choice. Please try again.")
- sleep(2)
- end
- end
- end
- if fs.exists("/disk/config/dogRE/disableRE.cfg") then
- displayError("Recovery Environment Disabled", "DOSx7000")
- else
- mainMenu()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement