Advertisement
Guest User

pass

a guest
Feb 22nd, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. local user
  2. local pass
  3. local cp
  4. local np
  5. local np1
  6.  
  7. term.clear()
  8. term.setCursorPos(1,1)
  9.  
  10. os.loadAPI("/dat")
  11. user = dat.u()
  12. pass = dat.p()
  13. os.unloadAPI("/dat")
  14.  
  15. print("Starting Pass Change")
  16. sleep(1)
  17. write("Enter Current Password > ")
  18. cp = read("*")
  19. if (cp == pass) then
  20.   write("Enter New Password > ")
  21.   np = read("*")
  22.   write("Confirm New Password > ")
  23.   np1 = read("*")
  24.   if (np == np1) then
  25.     shell.run("delete dat")
  26.     local g = fs.open("dat", "w")
  27.     g.writeLine("local x")
  28.     g.writeLine("local y")
  29.     g.writeLine(" ")
  30.     g.writeLine("x = \"".. np.. "\"")
  31.     g.writeLine("y = \"".. user.. "\"")
  32.     g.writeLine("function p()")
  33.     g.writeLine("return x")
  34.     g.writeLine("end")
  35.     g.writeLine("function u()")
  36.     g.writeLine("return y")
  37.     g.writeLine("end")
  38.     g.flush()
  39.     g.close()
  40.     print("Password Change Complete ...")
  41.     read()
  42.   else
  43.     print("Please make sure new password matches...")
  44.     read()
  45.   end
  46. else
  47. print("Wrong Password.. Closing")
  48. sleep(1)
  49. end
  50. print("Closing Password Change")
  51. read()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement