• Welcome to Valhalla Legends Archive.
 

Sending 0x65

Started by Dale, May 08, 2006, 07:06 PM

Previous topic - Next topic

Dale

                 
1. Introduction.  ;)
Uh well, since i'm new to these forums i'd like to say hello to everyone, I'm not new to battle.net (been playing since 97') anyways, i've been learning Visual basic for over 10 months now and i'd like to build a bot, and this is my problem.


2. Problem.
Alright, i'm fairly new to building packets, and i'd like to recieve my friends list...I did use Bnetdocs, and researched it got what I want but I just don't understand how to use it I guess?... ???


Here is my code...

Public Sub RequestFriends(ByVal Location1, Status As Integer, ProductID, Location2 As String)
    SendPacket &H65, sckBNET
    Location1 = GetByte
    Status = GetByte
    ProductID = GetFixedString(4)
    Location2 = GetString
End Sub

(I'm using an old friends Hashed control (simmilar to CSB))..But what is wrong with this?.. Please help, and play nicely   :D

MyndFyre

It's pretty clear you don't understand the packet.  Given the following structure:

typedef struct FRIENDSTATUS_TYPE
{
  char  account[];
  u8     status;
  u8     location;
  u32   product;
  char  channel[];
} FRIEND_STATUS;

your friends list is the following:

u8     number_of_friends;
FRIEND_STATUS   friends[number_of_friends];


So in pseudocode, what you're looking for is:

u8 numberFriends = GetByte();
for i := 0 to numberFriends
  current_friend = Friends[i]
  current_friend.Name = GetString()
  current_friend.Status = GetByte()
  current_friend.Location = GetByte()
  current_friend.Product = GetUInt32()
  current_friend.Channel = GetString()

next
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Dale


l2k-Shadow

Quote from: dlStevens on May 08, 2006, 07:06 PM
                 
1. Introduction.  ;)
Uh well, since i'm new to these forums i'd like to say hello to everyone, I'm not new to battle.net (been playing since 97') anyways, i've been learning Visual basic for over 10 months now and i'd like to build a bot, and this is my problem.


2. Problem.
Alright, i'm fairly new to building packets, and i'd like to recieve my friends list...I did use Bnetdocs, and researched it got what I want but I just don't understand how to use it I guess?... ???


Here is my code...

Public Sub RequestFriends(ByVal Location1, Status As Integer, ProductID, Location2 As String)
    SendPacket &H65, sckBNET
    Location1 = GetByte
    Status = GetByte
    ProductID = GetFixedString(4)
    Location2 = GetString
End Sub

(I'm using an old friends Hashed control (simmilar to CSB))..But what is wrong with this?.. Please help, and play nicely   :D

You clearly have no knowledge about how packets work.. perhaps learn more about how client->server communication works before attempting to make a bot...
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Eric

It would probably be best to wait for the packet to arrive before attempting to parse it.

warz

Quote from: l2k-Shadow on May 09, 2006, 12:35 AM
You clearly have no knowledge about how packets work.. perhaps learn more about how client->server communication works before attempting to make a bot...

No, clearly he has some knowledge about how packets work. Perhaps creating a bot would be a good method of broadening that knowledge.

Dale

Thank you...I do have some knowledge... and I am learning a lot, I just..I guess I'd like to see some examples of this situation...

l2k-Shadow

You need to parse the packet after your receive it. You are attempting to parse something that is not yet there.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

MyndFyre

Quote from: Lord[nK] on May 09, 2006, 01:05 AM
It would probably be best to wait for the packet to arrive before attempting to parse it.
Quote from: l2k-Shadow on May 10, 2006, 02:22 PM
You need to parse the packet after your receive it. You are attempting to parse something that is not yet there.

You know guys, it occurs to me that if he was using something like Visual Basic .NET, he could be making a blocking call to GetByte() (or similar functions) on a background thread that would automatically wait for the data to arrive.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Eric

Quote from: MyndFyre[vL] on May 10, 2006, 03:25 PM
Quote from: Lord[nK] on May 09, 2006, 01:05 AM
It would probably be best to wait for the packet to arrive before attempting to parse it.
Quote from: l2k-Shadow on May 10, 2006, 02:22 PM
You need to parse the packet after your receive it. You are attempting to parse something that is not yet there.

You know guys, it occurs to me that if he was using something like Visual Basic .NET, he could be making a blocking call to GetByte() (or similar functions) on a background thread that would automatically wait for the data to arrive.

Even so, it would still be erroneous to assume that the next packet received would most definately be a response to his request.

Dale

Never mind guys, i've done some research and some past friends have helped me and I now have a fresh understanding of sending & recieving packets, atleast the format they are supposed to be in. Thanks anyways guys. ;D