Deltekkio

CC_Bank_Register

Jul 24th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. local B = false
  2. local D = "profili/."
  3. local C = "conti/."
  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. term.setCursorPos(1,5)
  21. term.setTextColor(colors.red)
  22.  
  23. print("Impossibile creare il profilo")
  24.  
  25. term.setCursorPos(1,7)
  26.  
  27. os.sleep(2)
  28.  
  29. term.setTextColor(colors.white)
  30.  
  31. shell.run("cd/os/.menu")
  32.  
  33. else
  34.  
  35. local file = fs.open(D..User, "w")
  36. file.writeLine(Pass)
  37. file.close()
  38.  
  39. local conto = fs.open(C..User, "w")
  40. conto.writeLine("0")
  41. conto.close()
  42.  
  43. term.setCursorPos(1,5)
  44. term.setTextColor(colors.green)
  45.  
  46. print("Profilo creato!")
  47.  
  48. term.setCursorPos(1,7)
  49.  
  50. os.sleep(2)
  51.  
  52. term.setTextColor(colors.white)
  53.  
  54. shell.run("cd/os/.menu")
  55.  
  56. end
Add Comment
Please, Sign In to add comment