Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. local locker = true
  3. local failed = true
  4. local attempted_login = true
  5. local password_server = 40 -- change to the ID of your password server computer
  6. rednet.open("right") -- change to the side your rednet modem is on
  7. while locker do
  8. attempted_login = false
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. print("FyroOS dèmarrer : Veuillez vous connectez")
  12. print("Que voulez vous faire ?")
  13. print("[1] Connection (*)")
  14. print("[2] Arreter l'ordinateur")
  15. write("> ")
  16. local input = read()
  17. if input == "2" then
  18. os.shutdown()
  19. elseif input == "1" then
  20. attempted_login = true
  21. print("Connectez vous...")
  22. write("Utilisateur: ")
  23. local username = read()
  24. write("Mot de passe: ")
  25. local password = read("*")
  26. rednet.send(password_server, username, true)
  27. senderId, message, distance = rednet.receive(5)
  28. if password == message then
  29. failed = false
  30. locker = false
  31. term.clear()
  32. term.setCursorPos(1,1)
  33. print("Bienvenue ", username)
  34. else
  35. print("Utilisateur ou mot de passe incorrect.")
  36. sleep(3)
  37. end
  38. else
  39. print("Fonction inconnu...")
  40. sleep(2)
  41. end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement