Sir_Mr_Bman

change

Apr 23rd, 2014
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. local function clear()
  2.   term.setBackgroundColor(colors.gray)
  3.   term.setTextColor(colors.yellow)
  4.   term.clear()
  5.   term.setCursorPos(1, 1)
  6. end
  7.  
  8. clear()
  9. print("This guide will lead you through changing your password.")
  10. print("")
  11. term.setTextColor(colors.white)
  12. print("Please enter your new password.")
  13. term.setTextColor(colors.red)
  14. term.write(">: ")
  15. local first = read("*")
  16. term.setTextColor(colors.white)
  17. print("Please re-enter your new password.")
  18. term.setTextColor(colors.red)
  19. term.write(">: ")
  20. local second = read("*")
  21. if second == first then
  22.   clear()
  23.   print("Modifying your password. Please wait.")
  24.   sleep(2)
  25.   fs.delete("/.bman/pass/pass")
  26.   local h = fs.open("/.bman/pass/pass", "w")
  27.   h.write(first)
  28.   h.close()
  29.   print("Done.")
  30.   sleep(3)
  31.   os.reboot()
  32. else
  33.   clear()
  34.   print("Passwords did not match.")
  35.   sleep(4)
  36.   shell.run("/.bman/pass/opt")
  37. end
Advertisement
Add Comment
Please, Sign In to add comment