Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- local locker = true
- local failed = true
- local attempted_login = true
- local password_server = 40 -- change to the ID of your password server computer
- rednet.open("right") -- change to the side your rednet modem is on
- while locker do
- attempted_login = false
- term.clear()
- term.setCursorPos(1,1)
- print("FyroOS dèmarrer : Veuillez vous connectez")
- print("Que voulez vous faire ?")
- print("[1] Connection (*)")
- print("[2] Arreter l'ordinateur")
- write("> ")
- local input = read()
- if input == "2" then
- os.shutdown()
- elseif input == "1" then
- attempted_login = true
- print("Connectez vous...")
- write("Utilisateur: ")
- local username = read()
- write("Mot de passe: ")
- local password = read("*")
- rednet.send(password_server, username, true)
- senderId, message, distance = rednet.receive(5)
- if password == message then
- failed = false
- locker = false
- term.clear()
- term.setCursorPos(1,1)
- print("Bienvenue ", username)
- else
- print("Utilisateur ou mot de passe incorrect.")
- sleep(3)
- end
- else
- print("Fonction inconnu...")
- sleep(2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement