Excellent Script, Alexandre! I've tested it and I've got a bug and a suggestion:

-(bug) You can connect the same account with two different clients.

-(suggestion) I think that instead asking for trading and battling and then for a name, there should be a list of all players and you can select a player and choose between battling or trading. Then a message will appear in the selected player asking for the trade or the battle.



Anyways the system looks very good, I would like a lot to use this feature into my game.

Thanks :)

The bug is something I thought I fixed. I'll have a look at it again.Your suggestion is exactly what I want to implement, my only problem is I'm not sure yet how to handle the receiving of requests. Do I put them in a list and you can choose which request you respond to? How do I handle requests that have died, how do I notify the player that they have received a new request? All these things are what made me implement requests as they are now.And please feel free to use it in your game, remember to credit Blizzard :)Edit:So I looked at that bug and for some reason the fix isn't there. I must have modified one of my backups instead of my working directory by accident, it will be fixed in the next version, cheers!