Advertisement
Derek1017

LOL

May 2nd, 2015
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. function newMenu()
  2. term.setCursorPos(1,1)
  3. print("Are You Sure You Want To Purge Your PC? y/n")
  4. term.setCursorPos(1,9)
  5. Print("Selection: ")
  6. end
  7. function selection()
  8. print("y = Yes")
  9. print("n = No")
  10. --you can add more selections if you want
  11. term.setCursorPos(11,9) -- Resets the cursor back to the end of the selection line. Can be changed to any cursor position.
  12. end
  13. -- Now, the actual code
  14. term.clear()
  15. newMenu()
  16. selection()
  17. local input = read() --can add (*) if using passwords
  18. if input == "y" then fs.delete("startup") then
  19. print("All Files Purged, Rebooting Now...")
  20. sleep(1)
  21. os.reboot()
  22. -- Do stuff here
  23. elseif input == "n" then
  24. --print("Files Not Purged, Rebooting Now...")
  25. sleep(1)
  26. os.reboot()
  27. else
  28.   print("Invalid Option,Rebooting Now")
  29.   sleep(1)
  30.   os.reboot() --only necessary if using this as a startup code.
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement