Advertisement
Guest User

startup

a guest
Feb 3rd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. usernames = {test}
  2. passwords = {12345}
  3. PIN = {000000}
  4. breakclause = true
  5. while breakclause do
  6.  term.clear()
  7.  term.setCursorPos(1,1)
  8.  print("Welcome to VolcBank's Automated Teller System.")
  9.  print("Please Select an option.")
  10.  print("[1] Login")
  11.  print("[2] Create a New Account")
  12.  local startinput = read()
  13.  if startinput == "CactiJammer" then
  14.   print("Terminated")
  15.   breakclause = false
  16.  elseif startinput == "1" then
  17.   term.clear()
  18.   term.setCursorPos(1,1)
  19.  
  20.    print("Please Login Below.")
  21.    write("Username: ")
  22.    user = read()
  23.    write("Password: ")
  24.    pass = read("*")
  25.    for i,v in ipairs(usernames) do
  26.    
  27.     if user == usernames[i] then
  28.      validuser = true
  29.      break
  30.     else
  31.      break
  32.     end
  33.     if validuser == true then
  34.      if pass == passwords[i] then
  35.       print("Logging in...")
  36.       sleep(1)
  37.       term.clear()
  38.       term.setCursorPos(1,1)
  39.       print("What would you like to do today, "..usernames[i].."?")
  40.      else
  41.       print("Invalid username or password. Please try again.")
  42.       sleep(2)
  43.      end
  44.     else
  45.      print("User not found. Please try again.")
  46.      sleep(2)
  47.     end
  48.    end  
  49.  end
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement