Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --*****************************
- --********BANQUE CLIENT********
- --*****************************
- --Déclaration des variables
- user = ""
- pass = ""
- idserver = 0
- whilef = False
- rondanet = "/disk/rondanet"
- os.loadAPI(rondanet)
- -- Fin des déclaration des variables
- function interfac()
- print("Banque interface")
- print("Entrée votre nom d'utilisateur:")
- user = read()
- print("Entrée votre mot de passe")
- pass = read("*")
- print("Connection en cours")
- end
- function conn()
- local logintable = {action = "Login", User = user, Pass = pass, id = os.getComputerID()}
- login = textutils.serialize(logintable)
- rondanet.open("top")
- idserver = rednet.lookup("babanque", "server")
- rondanet.send(idserver, login "superproto")
- while whilef = False do
- senderid, message, disance = rondanet.receive()
- if senderid == idserver then
- whilef = True
- message = textutils.unserialize(message)
- if message.action == "login" then
- if message.response == "yes" then
- print("Bravo !")
- else
- print("Mauvais identifiant")
- break
- end
- end
- end
- end
- whilef = False
- end
- interfac()
Add Comment
Please, Sign In to add comment