Advertisement
daandecomputer

Untitled

Jul 24th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. print("Are You Sure? This Will Wipe Your Harddisk!")
  2. local menuOptions = {"Yes", "No"}
  3. term.write(text)
  4. return true
  5. function start()
  6. while true do
  7. term.clear()
  8. for i,v in ipairs(menuOptions) do
  9. if i == selected then
  10. centerText(":"..v..":", i)
  11. else
  12. centerText(v,i)
  13. end
  14. end
  15. local id, key = os.pullEvent()
  16. if key == 208 and selected < #menuOptions then
  17. selected = selected + 1
  18. elseif key == 200 and selected > 1 then
  19. selected = selected - 1
  20. end
  21. local id, key = os.pullEvent()
  22. if key == 28 then
  23. return selected
  24. end
  25. end
  26. end
  27. x = start()
  28. print()
  29. if selected == 1 then
  30. print("Goodbye!:(")
  31. sleep(1)
  32. print("Formatting Your Drive...")
  33. for _,file in ipairs(fs.list("/")) do
  34. if not fs.isReadOnly(file) then
  35. fs.delete(file)
  36. print("Deleted:" + file)
  37. end
  38. end
  39. print("DaanOS Was Been Uninstalled.")
  40. print("Please Help Us Make Our OS Better By Sending a suggestion on: https://bit.do/daanos")
  41. sleep(10)
  42. os.reboot()
  43. end
  44. if selected == 2 then
  45. print("Operation Aborted")
  46. write("Press any key to go back to the boot selection menu")
  47. os.pullEvent("key")
  48. shell.run("startup")
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement