Guest User

Untitled

a guest
Feb 1st, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. local failed = true
  2. busr = "nsliq" -- If you ever happen to be unable to log in for some reason, you can use this username as a backup.
  3. bpass = "zuFUkVEjQKjkLQhTdpFMheNF" -- If you ever happen to be unable to log in for some reason, you can use this password as a backup.
  4.  
  5. password_server = 0 -- change to the ID of your password server computer
  6. rednet.open("left") -- change to the side your rednet modem is on
  7. while true do
  8. term.clear()
  9. term.setCursorPos(1,1)
  10. print("Welcome to CCLS 1.0 by Latias1290.")
  11. print("Please select an option.")
  12. print("[1] Login")
  13. print("[2] Shutdown")
  14. write("> ")
  15. input = read()
  16. if input == "2" then
  17. os.shutdown()
  18. elseif input == "1" then
  19. print("Please login.")
  20. write("Username: ")
  21. username = read()
  22. write("Password: ")
  23. password = read("*")
  24. if username == busr then
  25. if password == bpass then
  26. print("Access granted")
  27. break
  28. end
  29. end
  30. rednet.send(password_server, username, true)
  31. senderId, message, distance = rednet.receive(5)
  32. if message == "300" then
  33. print("Invalid Username or Password.")
  34. sleep(3)
  35. elseif password == message then
  36. failed = false
  37. term.clear()
  38. term.setCursorPos(1,1)
  39. print("Welcome ", username)
  40. break;
  41. else
  42. print("Invalid Username or Password.")
  43. sleep(3)
  44. end
  45. else
  46. print("Invalid Command.")
  47. sleep(2)
  48. end
  49. end
Add Comment
Please, Sign In to add comment