Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: QwertyMonster on February 20, 2005, 08:39 AM

Title: Profile Request
Post by: QwertyMonster on February 20, 2005, 08:39 AM
Hey, yeah im trying to add profile request to my bot.

At the moment, i first searched this website. and got
http://forum.valhallalegends.com/phpbbs/index.php?topic=5670.0

Now hes sending &H26 for request, and on bnetdocs its 0x35

And on bnetdocs
0x26 -> ReadUserData
0x27 -> WriteUserData

Hes using them, yet 0x35 is profile request? What should i do?  :-\


Edit:

Oh nevermind, when looking around on 0x26 i found this

http://bnetdocs.valhallalegends.com/content.php?Section=m&Code=11

But i would like to know, why hasnt that "Sonic" person used 0x35 to request it?
Title: Re: Profile Request
Post by: Warrior on February 20, 2005, 09:15 AM
Maybe they changed it or he was stupid?
Title: Re: Profile Request
Post by: QwertyMonster on February 20, 2005, 11:21 AM
Lol ok, i think ive got it working now anyway. Thx All (..only Warrior :P )
Title: Re: Profile Request
Post by: Blaze on February 20, 2005, 06:17 PM
-.-

0x26 is what x-sha clients use for requesting profiles/ranks.
0x27 is for chaning the description/sex/location variables.
Title: Re: Profile Request
Post by: QwertyMonster on February 21, 2005, 10:04 AM
Hey. Im trying to request MY profile but it doesnt seem to be working :O

I have


Public Function GetProfile(Username As String)


Packet.InsertDWORD 1
Packet.InsertDWORD 4
Packet.InsertDWORD &H26
Packet.InsertNTString Username
Packet.InsertNTString "profile\sex"
Packet.InsertNTString "profile\location"
Packet.InsertNTString "profile\description"
Packet.SendPacket frmMain.bnetsocket, &H26

End Function


Ok thats getting it, now i know im not putting it anywhere, but what would i put for it?

Ok i have 2 questions

1.) What do i put to put a txtbox named "txtSex" as the sex
2.) I keep getting ipbanned when trying to get mine, why?

This is my 0x27


Private Sub Option1_Click()
Dim Username As String
   
   With Packet
   .InsertDWORD 1
   .InsertDWORD 4
   .InsertNTString Username
   .InsertNTString "profile\sex"
   .InsertNTString "profile\age"
   .InsertNTString "profile\location"
   .InsertNTString "profile\description"
   .InsertNTString frmProfile.TXTSex.Text 'Sex
  ' .InsertNTString frmProfile.txtAge.Text 'Age
   .InsertNTString frmProfile.txtLocation.Text 'Location
   .InsertNTString frmProfile.txtDesc.Text 'Description
   .SendPacket frmMain.bnetsocket, &H27

Me.Hide
End With
End Sub


Could some1 please help me? Ive got a really banging headache atm lol
Title: Re: Profile Request
Post by: Arta on February 21, 2005, 10:25 AM
In your 0x26:

You're setting key count to 4 (2nd DWORD) but only supplying 3 key names.

In your 0x27:

You've commented out the data for the second key (age) but you've still got it in your list and keycount is still 4.
Title: Re: Profile Request
Post by: QwertyMonster on February 21, 2005, 10:39 AM
Wow i edited my profile from my bot, sweet?! ^_^

I also did it with a BLUDDY BANGING HEADACHE  :'(

*cuts his head off*


Anyway, back to topic, i can set it, but how to view it?
Title: Re: Profile Request
Post by: CrAz3D on February 21, 2005, 10:54 AM
Public Function GetProfile(Username As String)


Packet.InsertDWORD 1
Packet.InsertDWORD 4
Packet.InsertDWORD &H26
Packet.InsertNTString Username
Packet.InsertNTString "profile\sex"
Packet.InsertNTString "profile\age"
Packet.InsertNTString "profile\location"
Packet.InsertNTString "profile\description"
Packet.SendPacket frmMain.bnetsocket, &H26

End Function
Title: Re: Profile Request
Post by: Soul Taker on February 21, 2005, 12:07 PM
Just a note, to properly emulate the real client, you should also request an empty profile key after the other ones.
Title: Re: Profile Request
Post by: QwertyMonster on February 21, 2005, 02:58 PM
Quote from: CrAz3D on February 21, 2005, 10:54 AM
Public Function GetProfile(Username As String)


Packet.InsertDWORD 1
Packet.InsertDWORD 4
Packet.InsertDWORD &H26
Packet.InsertNTString Username
Packet.InsertNTString "profile\sex"
Packet.InsertNTString "profile\age"
Packet.InsertNTString "profile\location"
Packet.InsertNTString "profile\description"
Packet.SendPacket frmMain.bnetsocket, &H26

End Function



Ok thats getting the info, but how would i get it to a txt box, i know it sounds stupid,
Ok, i know how to send txt to a txt box, but what do i put for this case lol, if that made sense...


txtLocation.text = ???
Title: Re: Profile Request
Post by: Warrior on February 21, 2005, 03:14 PM
You parse the response.

It's an array of strings and I'm pretty sure you wont care about the three DWORD so find where the Array of strings begin and split that by the Null Terminator. (BYTE 0)
Title: Re: Profile Request
Post by: Spilled on February 22, 2005, 09:48 AM
When you send that packet the server will respond with the requested keys in an array, as he said split it by the null terminator and your keys will be in the order you requested them.

Anymore questions, ask away im happy to help


Edit:
Ex:
txtSex.text = thesplityouused(0)
txtLocation.text = thesplityouused(1)
Title: Re: Profile Request
Post by: Blaze on February 22, 2005, 03:57 PM
Quote from: CrAz3D on February 21, 2005, 10:54 AM
Public Function GetProfile(Username As String)
Packet.InsertDWORD 1
.....
Packet.SendPacket frmMain.bnetsocket, &H26
End Function


Why is this a function exactly?
Title: Re: Profile Request
Post by: Warrior on February 22, 2005, 11:23 PM
Good point, I tend to make Functions that dont return anything subs.