Advertisement
Vodka51200

mdp porte user+mdp

Nov 15th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw -- Prevents CTRL+T shortcut
  2.  
  3. term.clear() -- Clears the screen
  4. term.setCursorPos(1,1) -- The places the print position to the top of screen
  5. write("Maison de Vodka")
  6. --textutils.slowPrint("Maison de Vodka")
  7. term.setCursorPos(1,2)
  8. username = {"user1", "user2", "user3"}
  9. password = {"pass1", "pass2", "pass3"}
  10. write("Nom d'utilisateur: ")
  11. user = read()
  12.  
  13. write("Mot de passe: ")
  14. pass = read('*') -- This prevents people from reading the password as you put it in
  15.  
  16. for i=1, #username do -- Starts a loop
  17.  if user == username[i] and pass == password[i] then
  18.    access = true
  19.  end
  20. end
  21.  
  22. if access == true then
  23. term.clear()
  24. term.setCursorPos(1,1)
  25. term.setTextColor(colors.red)
  26. print("Connextion en cour.")
  27. sleep(1,5)
  28. term.setCursorPos(1,1)
  29. print("Connextion en cour..")
  30. sleep(1,5)
  31. term.setCursorPos(1,1)
  32. print("Connextion en cour...")
  33. sleep(1,5)
  34. term.clear()
  35. term.setCursorPos(1,1)
  36. print("Bonjour "..user)
  37. rs.setOutput("side",true)
  38. sleep(opentime)
  39. rs.setOutput("side",false)
  40. os.shutdown()
  41. else
  42. print("Utilisateur ou mot de passe incorrect!")
  43. sleep(1)
  44. print("Votre ordinateur va redemarrer")
  45. sleep(2)
  46. os.reboot()
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement