Valhalla Legends Forums Archive | Battle.net Bot Development | Stupid CSB q

AuthorMessageTime
Sidoh
Hey, im having problems getting the "RequestKey" to work with cleanslatebot... here's what im sending:

CSB.RequestKey Profile, ChannelList.SelectedItem, "sex", "age", "user", "Username", "username"

ive tried them seperatly too, but when the keyreturn is activated, it has no KeyValue... any ideas?
September 20, 2003, 5:38 AM
Yoni
Not that familiar with CSB.RequestKey but try "Profile\Sex" instead of "Sex", "Profile\Age" instead of "Age", etc.
September 20, 2003, 9:13 AM
iago
Wasn't Age disabled? I know that wouldn't solve your problem, but I doubt you'll get any information from profile/age.
September 20, 2003, 11:17 AM
blinkdude
im sure you got the same problum i had... location / age / sex isn't working for me but Des. is ... duno y ..... heres the code cup head has for it
Req click.
[code]
CleanSlateBot1.RequestKey Profile, Listnamehere.SelectedItem.Text, "Profile\Age", "Profile\Sex", "Profile\Description", "Profile\Location"
[/code]
*******
[code]
Private Sub CleanSlateBot1_KeyReturn(KeyName As String, KeyValue As String)
Select Case KeyName
Case "Profile\Age"
TempAge = KeyValue
Case "Profile\Sex"
TempSex = KeyValue
Case "Profile\Location"
TempLoc = KeyValue
Case "Profile\Description"
TempDesc = KeyValue
Dim Profile As New frmProfile
Profile.txtUsername.Text = ListView1.SelectedItem.Text
Profile.Caption = ListView1.SelectedItem.Text & "'s Profile"
Profile.txtAge.Text = Replace(TempAge, Chr(10), vbCrLf)
Profile.txtSex.Text = Replace(TempSex, Chr(10), vbCrLf)
Profile.txtDescription.Text = Replace(TempDesc, Chr(10), vbCrLf)
Profile.txtLocation.Text = Replace(TempLoc, Chr(10), vbCrLf)
If CleanSlateBot1.Username = ListView1.SelectedItem.Text Then Profile.cmdSave.Enabled = True
Profile.Show
Case Else
rtbadd vbRed, KeyName & " : " & KeyValue & vbNewLine, vbRed
End Select
End Sub
[/code]
heres an ss or my bot with CSB working for profile but no location ...
http://eternalsoldiers.net/esbot/ss/ss3.gif
September 20, 2003, 3:22 PM
Kp
[quote author=iago link=board=17;threadid=2764;start=0#msg21783 date=1064056631]Wasn't Age disabled? I know that wouldn't solve your problem, but I doubt you'll get any information from profile/age.[/quote]There is some server-side hack that forces it to be empty. However, until such time as the client you're emulating is patched to stop requesting profile\age, you should request it too for compatibility (even though, as iago says, it will be empty).
September 20, 2003, 3:23 PM
Spht
[quote author=blinkdude link=board=17;threadid=2764;start=0#msg21800 date=1064071370]
im sure you got the same problum i had... location / age / sex isn't working for me but Des. is ... duno y ..... heres the code cup head has for it
Req click.
[code]
CleanSlateBot1.RequestKey Profile, Listnamehere.SelectedItem.Text, "Profile\Age", "Profile\Sex", "Profile\Description", "Profile\Location"
[/code]
*******
[code]
Private Sub CleanSlateBot1_KeyReturn(KeyName As String, KeyValue As String)
Select Case KeyName
Case "Profile\Age"
TempAge = KeyValue
Case "Profile\Sex"
TempSex = KeyValue
Case "Profile\Location"
TempLoc = KeyValue
Case "Profile\Description"
TempDesc = KeyValue
Dim Profile As New frmProfile
Profile.txtUsername.Text = ListView1.SelectedItem.Text
Profile.Caption = ListView1.SelectedItem.Text & "'s Profile"
Profile.txtAge.Text = Replace(TempAge, Chr(10), vbCrLf)
Profile.txtSex.Text = Replace(TempSex, Chr(10), vbCrLf)
Profile.txtDescription.Text = Replace(TempDesc, Chr(10), vbCrLf)
Profile.txtLocation.Text = Replace(TempLoc, Chr(10), vbCrLf)
If CleanSlateBot1.Username = ListView1.SelectedItem.Text Then Profile.cmdSave.Enabled = True
Profile.Show
Case Else
rtbadd vbRed, KeyName & " : " & KeyValue & vbNewLine, vbRed
End Select
End Sub
[/code]
heres an ss or my bot with CSB working for profile but no location ...
http://eternalsoldiers.net/esbot/ss/ss3.gif
[/quote]

That will only work if Profile\Description is the last key KeyReturn() sends to you. A simple way to find out what order you get them in, is:

[code]
Private Sub CleanSlateBot1_KeyReturn(KeyName As String, KeyValue As String)
Debug.Print "KeyReturn(" & KeyName & ", " & KeyValue & ")"
End Sub
[/code]

Now request someone's profile. Whichever key you get last, move your profile dialog display there. For example, if Profile\Age is the last you get, then:

[code]
Private Sub CleanSlateBot1_KeyReturn(KeyName As String, KeyValue As String)
Select Case KeyName
Case "Profile\Age"
TempAge = KeyValue
Dim Profile As New frmProfile
Profile.txtUsername.Text = ListView1.SelectedItem.Text
Profile.Caption = ListView1.SelectedItem.Text & "'s Profile"
Profile.txtAge.Text = Replace(TempAge, Chr(10), vbCrLf)
Profile.txtSex.Text = Replace(TempSex, Chr(10), vbCrLf)
Profile.txtDescription.Text = Replace(TempDesc, Chr(10), vbCrLf)
Profile.txtLocation.Text = Replace(TempLoc, Chr(10), vbCrLf)
If CleanSlateBot1.Username = ListView1.SelectedItem.Text Then Profile.cmdSave.Enabled = True
Profile.Show
Case "Profile\Sex"
TempSex = KeyValue
Case "Profile\Location"
TempLoc = KeyValue
Case "Profile\Description"
TempDesc = KeyValue
Case Else
rtbadd vbRed, KeyName & " : " & KeyValue & vbNewLine, vbRed
End Select
End Sub
[/code]
September 20, 2003, 6:46 PM
blinkdude
i tryed it that way for like a day or two then just did it this way it works.... but it will pop up the Profile Form on any keyreturn...
[code]
Private Sub CleanSlateBot1_KeyReturn(KeyName As String, KeyValue As String)
frmProfile.txtUsername.Text = ListView1.SelectedItem.Text
frmProfile.Caption = ListView1.SelectedItem.Text & "'s Profile"

If KeyName = "Profile\Age" Then
TempAge = KeyValue
frmProfile.txtAge.Text = TempAge
Else
End If

If KeyName = "Profile\Sex" Then
TempSex = KeyValue
frmProfile.txtSex.Text = TempSex
Else
End If

If KeyName = "Profile\Location" Then
TempLoc = KeyValue
frmProfile.txtLocation.Text = TempLoc
Else
End If

If KeyName = "Profile\Description" Then
TempDesc = KeyValue
frmProfile.txtDescription.Text = TempDesc
Else
End If

If CleanSlateBot1.Username = ListView1.SelectedItem.Text Then frmProfile.cmdSave.Enabled = True
frmProfile.Show
End sub
[/code]
September 20, 2003, 8:55 PM
iago
That will only display one thing on the form, since KeyName will only ever be one of those options.
September 20, 2003, 9:11 PM
Sidoh
Okay, new question, how do you request record data?
September 21, 2003, 11:00 PM
iago
[code]void BinaryBot::SendRecDataRequest(string User)
{
   LastProfileName = User;
   Buffer Request;
   Request << (DWORD) 1; // One user
   Request << (DWORD) 31; // With 31 fields
   Request << RecDataCookie; // The record cookie
   Request << User << (BYTE) 0; // The username

   Request << "profile\\sex" << (BYTE) 0; // The standard profile data
   Request << "profile\\age" << (BYTE) 0;
   Request << "profile\\location" << (BYTE) 0;
   Request << "profile\\description" << (BYTE) 0;
   
   Request << "Record\\SEXP\\0\\wins" << (BYTE) 0; // Brood war regular stuff
   Request << "Record\\SEXP\\0\\losses" << (BYTE) 0;
   Request << "Record\\SEXP\\0\\disconnects" << (BYTE) 0;
   Request << "Record\\SEXP\\0\\last game result" << (BYTE) 0;
   Request << "Record\\SEXP\\1\\wins" << (BYTE) 0; // Brood war ladder stuff
   Request << "Record\\SEXP\\1\\losses" << (BYTE) 0;
   Request << "Record\\SEXP\\1\\disconnects" << (BYTE) 0;
   Request << "Record\\SEXP\\1\\rating" << (BYTE) 0;
   Request << "Record\\SEXP\\1\\last game result" << (BYTE) 0;
   
   Request << "Record\\STAR\\0\\wins" << (BYTE) 0; // Starcraft regular
   Request << "Record\\STAR\\0\\losses" << (BYTE) 0;
   Request << "Record\\STAR\\0\\disconnects" << (BYTE) 0;
   Request << "Record\\STAR\\0\\last game result" << (BYTE) 0;
   Request << "Record\\STAR\\1\\wins" << (BYTE) 0; // Starcraft ladder
   Request << "Record\\STAR\\1\\losses" << (BYTE) 0;
   Request << "Record\\STAR\\1\\disconnects" << (BYTE) 0;
   Request << "Record\\STAR\\1\\rating" << (BYTE) 0;
   Request << "Record\\STAR\\1\\last game result" << (BYTE) 0;
   
   Request << "Record\\W2BN\\0\\wins" << (BYTE) 0; // War2 regular
   Request << "Record\\W2BN\\0\\losses" << (BYTE) 0;
   Request << "Record\\W2BN\\0\\disconnects" << (BYTE) 0;
   Request << "Record\\W2BN\\0\\last game result" << (BYTE) 0;
   Request << "Record\\W2BN\\1\\wins" << (BYTE) 0; // War2 ladder
   Request << "Record\\W2BN\\1\\losses" << (BYTE) 0;
   Request << "Record\\W2BN\\1\\disconnects" << (BYTE) 0;
   Request << "Record\\W2BN\\1\\rating" << (BYTE) 0;
   Request << "Record\\W2BN\\1\\last game result" << (BYTE) 0;

   SendBNetPacket(SID_READUSERDATA, Request);
}
[/code]
September 21, 2003, 11:08 PM
Sidoh
Odd, that doesn't seem to work.. (i made sure to change everything to vb from c++), the value it returns is blank. Per haps im just being stupid
September 21, 2003, 11:21 PM
Spht
[quote author=Sidoh link=board=17;threadid=2764;start=0#msg21918 date=1064186467]
Odd, that doesn't seem to work.. (i made sure to change everything to vb from c++), the value it returns is blank. Per haps im just being stupid
[/quote]

Use one slash (\) instead of two. There's two in his sample to avoid it being recognized as a C++ operator.
September 21, 2003, 11:25 PM
iago
Yes, I should have mentioned.. and you might not need the (BYTE) 0, depending on how your buffer works :)
September 21, 2003, 11:29 PM
Sidoh
Okay, its working now, thanks ;D
September 21, 2003, 11:42 PM
Soul Taker
What about Ironman stats =P
September 21, 2003, 11:54 PM
Sidoh
Okay I have another question. When I request the key
"Record\SEXP\0\last game", I get a weird keyreturn. It in no way resembles the time or date of the last game.

Heres what I got:
Key Return (Keyname: Record\SEXP\0\last game, KeyValue: 29587645 2393367080)

When the actual time/date was:
9/11/2003 17:33

Anyone know how this is parsed?
September 22, 2003, 12:00 AM
iago
Of course there is, I just didn't care enough to add it to my request string.

btw, a simple "thank you" would be more appreciated than, "give me more". Just for future reference.
September 22, 2003, 1:33 AM
Sidoh
Yeah, I felt bad about that :( I'm sorry, THANK YOU! ;D
September 22, 2003, 1:36 AM
Soul Taker
[quote author=Sidoh link=board=17;threadid=2764;start=15#msg21925 date=1064188803]
Okay I have another question. When I request the key
"Record\SEXP\0\last game", I get a weird keyreturn. It in no way resembles the time or date of the last game.

Heres what I got:
Key Return (Keyname: Record\SEXP\0\last game, KeyValue: 29587645 2393367080)

When the actual time/date was:
9/11/2003 17:33

Anyone know how this is parsed?

[/quote]
Look up FileTime structures on MSDN.
September 22, 2003, 1:41 AM

Search