Jump to content
Eternal Lands Official Forums
Sign in to follow this  
WizzKidd

Help with trading

Recommended Posts

Hello,

 

I am working on writing a bot using VB.Net built on the 1.1 framework. Currently, my bot is able to log in and stay online (heartbeat) as well as communicate with players via general chat as well as private message.

 

I would like to implement trading, but as I watch the ip packets between two clients attempting a trade it's dificult to decypher.

 

Could you please post the message flow for responding to a trade request? I sure would appreciate it. :P

Share this post


Link to post
Share on other sites

You want to know of someone attempted to trade with you? Filter the chat log.

 

to actually initiate a trade, You will need to know the actor_id for the player, And send a

       str[0] = TRADE_WITH;
       *((int *)(str+1)) = actors_list[j]->actor_id;
       my_tcp_send ( my_socket , str, 5 );

For example.

 

str(0)=ADD_NEW_ACTOR is were you get your player ids from. The define #'s ive used here are in the client_serv.h in the el source

Edited by Zep

Share this post


Link to post
Share on other sites

Ahhh, gota use the id, not the name :) No wonder it kept booting me out when I sent the command! :P

 

Thanks!

Share this post


Link to post
Share on other sites

np

 

yeah sending almost anything over length will have you disconnected, Nice server failsafe =)

Share this post


Link to post
Share on other sites

OK, so next thing.. I figured out the first half of message 35 up though quantity, what's the rest?

 

Also message 37 makes no sense to me. And the whole sequence of removing an item from the trade window. Best I can tell three messages are sent. an empty 37, then a 37 with a 1 in it, then a message starting with 0 which seems to contain the quantity. None of them contain the id to the item being removed!

 

Am I going about this the wrong way? I wanted the bot to put the money in as the items are put in.

 

Thanks

Share this post


Link to post
Share on other sites

can anyone tell me in which el source file I can find the trading code? I would really appreciate it! :P

Share this post


Link to post
Share on other sites
can anyone tell me in which el source file I can find the trading code?  I would really appreciate it!  :ph34r:

177595[/snapback]

 

umm, trade.c =)

Share this post


Link to post
Share on other sites
umm, trade.c =)

178034[/snapback]

 

Zep, if you want I can send you the source to Quartermaster and MadameYes - they both ran on my Tcl version of a trade bot and worked very well for many months. Since the update, the code is only a reference, and not too pretty either, but it does outline some of the OLD El packets. Also, the code is sloppy, but worked very well. From my point of view, the source for the EL client is NOT the way to write clients for EL or any socket code. Save yourself headaches and open 2 EL clients and run Etherreal to snif the facts out about those packets and how they interact.

 

Another way to do it, if I may suggest, is to compile elbot and insert some printf's that list packet contents during a trade, and hack it out like that. Whitter posted a fantastic sequence of packet interaction last week in the forums here also, and thos are almost dead on describing the actual packets, BUT put and get object need slight fixes, but it's all there.

Share this post


Link to post
Share on other sites

How did the VB trade code come along. I'm trying to code the trade part of ny bot in VB.NET and implementing the trade protocols is getting confusing. Any help?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×