Advertisement
Guest User

Untitled

a guest
Mar 10th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. local locker = true
  2. local failed = true
  3. local attempted_login = true
  4. local password_server = 0
  5. rednet.open("left")
  6. while locker do
  7. attempted_login = false
  8. term.clear()
  9. term.setCursorPos(1,1)
  10. print("Welcome to a USERS PC : Roaming Profile Enabled")
  11. print("What would you like to do?")
  12. print("[1] Login(*)")
  13. print("[2] Shutdown")
  14. write("> ")
  15. local input = read()
  16. if input == "2" then
  17. os.shutdown()
  18. elseif input == "1" then
  19. attempted_login = true
  20. print("Please login...")
  21. write("Username: ")
  22. local username = read()
  23. write("Password: ")
  24. local password = read("*")
  25. rednet.send(password_server, username, true)
  26. senderID, message, distance = rednet.receive(5)
  27. if password == message then
  28. failed = false
  29. locker = false
  30. term.clear()
  31. term.setCursorPos(1,1)
  32. print("Welcome ", username)
  33. else
  34. print("Invalid Username or Password.")
  35. sleep(3)
  36. end
  37. else
  38. print("Command not recoqnies...")
  39. sleep(2)
  40. end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement