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
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
Um...oh..ok.. :-\ :-X
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...
It would probably be best to wait for the packet to arrive before attempting to parse it.
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.
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...
You need to parse the packet after your receive it. You are attempting to parse something that is not yet there.
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.
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.
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