Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function newMenu()
- term.setCursorPos(1,1)
- print("Are You Sure You Want To Purge Your PC? y/n")
- term.setCursorPos(1,9)
- Print("Selection: ")
- end
- function selection()
- print("y = Yes")
- print("n = No")
- --you can add more selections if you want
- term.setCursorPos(11,9) -- Resets the cursor back to the end of the selection line. Can be changed to any cursor position.
- end
- -- Now, the actual code
- term.clear()
- newMenu()
- selection()
- local input = read() --can add (*) if using passwords
- if input == "y" then fs.delete("startup") then
- print("All Files Purged, Rebooting Now...")
- sleep(1)
- os.reboot()
- -- Do stuff here
- elseif input == "n" then
- --print("Files Not Purged, Rebooting Now...")
- sleep(1)
- os.reboot()
- else
- print("Invalid Option,Rebooting Now")
- sleep(1)
- os.reboot() --only necessary if using this as a startup code.
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement