Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to create the Recovery.cfg file
- local function createRecoveryFile()
- local file = fs.open("Recovery.cfg", "w")
- file.close()
- -- Show message about connecting device to Doggy OS device or Device Running Dogdroid Recovery
- term.clear()
- term.setCursorPos(1,1)
- print("Recovery.cfg file created.")
- print("Connect your device to a Doggy OS device")
- print("or a device running Dogdroid Recovery.")
- end
- -- Function to run /disk/boot/check-recovery
- local function runCheckRecovery()
- shell.run("/disk/boot/check-recovery")
- end
- -- Main function
- local function main()
- -- Variable to track if enter is pressed
- local enterPressed = false
- -- Event loop to check for key press
- parallel.waitForAny(
- function()
- while true do
- local event, key = os.pullEvent("key")
- if key == keys.enter then
- enterPressed = true
- break
- end
- end
- end,
- function()
- os.sleep(2)
- if not enterPressed then
- runCheckRecovery()
- end
- end
- )
- -- If enter is pressed, create Recovery.cfg file
- if enterPressed then
- createRecoveryFile()
- end
- end
- -- Run the main function
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement