Advertisement
Guest User

startup

a guest
Nov 17th, 2018
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.78 KB | None | 0 0
  1.  
  2. function banner()
  3.     print("Welcome to SwatDoge's chat program")
  4.     print("")
  5. end
  6.  
  7. function cls()
  8.     term.clear()    
  9.     term.setCursorPos(1, 1)
  10. end
  11.  
  12. function name()
  13.     account_name = user
  14.     cls()
  15.     write("What would you like your name to be? ")
  16.     account_name = read()
  17.     password()
  18. end    
  19.  
  20. function password()
  21.     account_password = admin
  22.     cls()
  23.     write("Welcome "..account_name..", Type a password you'd want to use: ")
  24.     write("")
  25.     account_password = read()
  26.     cls()
  27.     login()
  28. end
  29.    
  30. function first_name()
  31.     if account_name == nil then
  32.     name()
  33.     else
  34.     print(name)
  35.     cls()
  36.     login()
  37.     end
  38. end
  39.  
  40. function login()
  41.     local account_name_check
  42.     local account_password_check
  43.     print("Login with your information.")
  44.     write("Username: ")
  45.     account_name_check = read()
  46.     write("Password: ")
  47.     account_password_check = read()
  48.    
  49.     if (account_name_check == account_name) and (account_password_check == account_password) then
  50.     print("jo")
  51.     else
  52.     cls()
  53.     print("wrong username or password")
  54.     login()
  55.     end        
  56.    
  57. end
  58.    
  59.  
  60. local account_password
  61. local account_name                                                                                                                                
  62. banner()                                                                                                                                                                                                                                                                                  
  63. first_name()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement