Advertisement
bryceio

ClientLogin

Feb 13th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. modem = peripheral.wrap("back")
  2. admin = "Bryceio"
  3. error = "Error404"
  4. modem.open(921)
  5. term.clear()
  6. term.setCursorPos(1, 1)
  7. print("Please enter username:")
  8. user = read()
  9. modem.transmit(753, 921, user)
  10. memes, are, king, password = os.pullEvent("modem_message")
  11. if password == error then
  12.     print("Invalid username. Restarting")
  13.     sleep(2)
  14.     shell.run("startup")
  15.     end
  16. print("Please enter password:")
  17. pass = read("*")
  18.  
  19. if password == pass then
  20.     if user == admin then
  21.         term.clear()
  22.         term.setCursorPos(1, 1)
  23.         print("Welcome, admin")
  24. else
  25. term.clear()
  26. term.setCursorPos(1, 1)
  27. print("Welcome, "..user)
  28. shell.run("MainInterface")
  29.  end
  30.  
  31. else
  32. print("Incorrect Password")
  33. sleep(2)
  34. shell.run("Login")
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement