Valhalla Legends Forums Archive | Battle.net Bot Development | Sending 0x65

AuthorMessageTime
dlStevens
                 
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
May 9, 2006, 12:06 AM
Myndfyr
It's pretty clear you don't understand the packet.  Given the following structure:
[code]
typedef struct FRIENDSTATUS_TYPE
{
  char  account[];
  u8    status;
  u8    location;
  u32  product;
  char  channel[];
} FRIEND_STATUS;
[/code]
your friends list is the following:
[code]
u8    number_of_friends;
FRIEND_STATUS  friends[number_of_friends];
[/code]

So in pseudocode, what you're looking for is:
[code]
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
[/code]
May 9, 2006, 12:51 AM
dlStevens
Um...oh..ok.. :-\ :-X
May 9, 2006, 12:58 AM
l2k-Shadow
[quote author=dlStevens link=topic=14949.msg152211#msg152211 date=1147133177]
                 
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
[/quote]

You clearly have no knowledge about how packets work.. perhaps learn more about how client->server communication works before attempting to make a bot...
May 9, 2006, 5:35 AM
LoRd
It would probably be best to wait for the packet to arrive before attempting to parse it.
May 9, 2006, 6:05 AM
warz
[quote author=l2k-Shadow link=topic=14949.msg152220#msg152220 date=1147152938]
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]

No, clearly he has some knowledge about how packets work. Perhaps creating a bot would be a good method of broadening that knowledge.
May 9, 2006, 10:27 AM
dlStevens
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...
May 9, 2006, 7:25 PM
l2k-Shadow
You need to parse the packet after your receive it. You are attempting to parse something that is not yet there.
May 10, 2006, 7:22 PM
Myndfyr
[quote author=Lord[nK] link=topic=14949.msg152223#msg152223 date=1147154725]
It would probably be best to wait for the packet to arrive before attempting to parse it.
[/quote]
[quote author=l2k-Shadow link=topic=14949.msg152282#msg152282 date=1147288923]
You need to parse the packet after your receive it. You are attempting to parse something that is not yet there.
[/quote]

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.
May 10, 2006, 8:25 PM
LoRd
[quote author=MyndFyre[vL] link=topic=14949.msg152283#msg152283 date=1147292714]
[quote author=Lord[nK] link=topic=14949.msg152223#msg152223 date=1147154725]
It would probably be best to wait for the packet to arrive before attempting to parse it.
[/quote]
[quote author=l2k-Shadow link=topic=14949.msg152282#msg152282 date=1147288923]
You need to parse the packet after your receive it. You are attempting to parse something that is not yet there.
[/quote]

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]

Even so, it would still be erroneous to assume that the next packet received would most definately be a response to his request.
May 10, 2006, 8:31 PM
dlStevens
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
May 13, 2006, 2:21 AM

Search