Deltekkio

CC_Bank_Login

Jul 24th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. local B = false
  2. local D = "profili/."
  3. local P = ""
  4.  
  5. term.clear()
  6. term.setCursorPos(1,1)
  7.  
  8. write("Username: ")
  9. User = read()
  10.  
  11. term.setCursorPos(1,3)
  12.  
  13. write"Password: "
  14. Pass = read("*")
  15.  
  16. B = fs.exists(D..User)
  17.  
  18. if(B == true) then
  19.  
  20. local file = fs.open(D..User, "r")
  21. P = file.readLine()
  22. file.close()
  23.  
  24. if(P == Pass) then
  25.  
  26. term.setCursorPos(1,5)
  27.  
  28. term.setTextColor(colors.green)
  29.  
  30. print("Benvenuto: "..User.."!")
  31.  
  32. os.sleep(2)
  33.  
  34. term.setTextColor(colors.white)
  35.  
  36. shell.run("cd/os/.usermenu", User)
  37.  
  38. else
  39.  
  40. term.setCursorPos(1,5)
  41.  
  42. term.setTextColor(colors.red)
  43.  
  44. print("Username o password errati!")
  45.  
  46. os.sleep(2)
  47.  
  48. term.setTextColor(colors.white)
  49.  
  50. shell.run("cd/os/.menu")
  51.  
  52. end
  53.  
  54. else
  55.  
  56. term.setCursorPos(1,5)
  57.  
  58. term.setTextColor(colors.red)
  59.  
  60. print("Username o password errati!")
  61.  
  62. os.sleep(2)
  63.  
  64. term.setTextColor(colors.white)
  65.  
  66. shell.run("cd/os/.menu")
  67.  
  68. end
Add Comment
Please, Sign In to add comment