BananeMan

Untitled

Sep 15th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. --*****************************
  2. --********BANQUE CLIENT********
  3. --*****************************
  4.  
  5. --Déclaration des variables
  6. user = ""
  7. pass = ""
  8. idserver = 0
  9. whilef = False
  10. rondanet = "/disk/rondanet"
  11. os.loadAPI(rondanet)
  12. -- Fin des déclaration des variables
  13.  
  14. function interfac()
  15. print("Banque interface")
  16. print("Entrée votre nom d'utilisateur:")
  17. user = read()
  18. print("Entrée votre mot de passe")
  19. pass = read("*")
  20. print("Connection en cours")
  21. end
  22.  
  23. function conn()
  24. local logintable = {action = "Login", User = user, Pass = pass, id = os.getComputerID()}
  25. login = textutils.serialize(logintable)
  26. rondanet.open("top")
  27. idserver = rednet.lookup("babanque", "server")
  28. rondanet.send(idserver, login "superproto")
  29. while whilef = False do
  30. senderid, message, disance = rondanet.receive()
  31. if senderid == idserver then
  32. whilef = True
  33. message = textutils.unserialize(message)
  34. if message.action == "login" then
  35. if message.response == "yes" then
  36. print("Bravo !")
  37. else
  38. print("Mauvais identifiant")
  39. break
  40. end
  41. end
  42. end
  43. end
  44. whilef = False
  45. end
  46.  
  47. interfac()
Add Comment
Please, Sign In to add comment