Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Dale on May 08, 2006, 07:06 PM

Title: Sending 0x65
Post by: Dale 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
Title: Re: Sending 0x65
Post by: MyndFyre on May 08, 2006, 07:51 PM
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
Title: Re: Sending 0x65
Post by: Dale on May 08, 2006, 07:58 PM
Um...oh..ok.. :-\ :-X
Title: Re: Sending 0x65
Post by: l2k-Shadow on May 09, 2006, 12:35 AM
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...
Title: Re: Sending 0x65
Post by: Eric on May 09, 2006, 01:05 AM
It would probably be best to wait for the packet to arrive before attempting to parse it.
Title: Re: Sending 0x65
Post by: warz on May 09, 2006, 05:27 AM
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.
Title: Re: Sending 0x65
Post by: Dale on May 09, 2006, 02:25 PM
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...
Title: Re: Sending 0x65
Post by: 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.
Title: Re: Sending 0x65
Post by: MyndFyre 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.
Title: Re: Sending 0x65
Post by: Eric on May 10, 2006, 03:31 PM
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.
Title: Re: Sending 0x65
Post by: Dale on May 12, 2006, 09:21 PM
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