Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Tass on November 26, 2005, 07:57 PM

Title: MCP 0x02 (Char Create)
Post by: Tass on November 26, 2005, 07:57 PM
I'm having a problem on sending the flags for char create. This is what I'v got...

Private Sub Command1_Click()
Dim Class As String, Flags As String, Name As String
Name = Text1.Text
Flags = 0 'Regular Classic
If Option1.Value = True Then: Class = 0
If Option2.Value = True Then: Class = 1
If Option3.Value = True Then: Class = 2
If Option4.Value = True Then: Class = 3
If Option5.Value = True Then: Class = 4
If Option6.Value = True Then: Class = 5
If Option7.Value = True Then: Class = 6
If Check1.Value = vbChecked Then: Flags = (Flags Or 20) 'Expansion
If Check1.Value = vbChecked Then: Flags = (Flags Or 4) 'Hardcore
If Check1.Value = vbChecked Then: Flags = (Flags Or 40) 'Ladder
If Len(Name) > 15 Then: Name = Left(Name, 15)
AddC vbrealm, "MCP: Character flags.. " & Flags & " Character.. " & Class
With PBuffer
    .InsertDWORD "&H" & Class
    .InsertWORD "&H" & Flags
    .InsertNTString Text1.Text
    .SendMCPPacket &H2
End With
AddC vbGreen, "&H" & Flags
Unload frmCharCreate
End Sub

It works if I don't select Expantion, Hardcore, or Ladder on the form so it only creates a classic char, so how do I properly do it for the others?
Title: Re: MCP 0x02 (Char Create)
Post by: LivedKrad on November 26, 2005, 09:30 PM
Quote
Private Sub Command1_Click()
Dim Class As String, Flags As String, Name As String
Name = Text1.Text
Flags = 0 'Regular Classic
If Option1.Value = True Then: Class = 0
If Option2.Value = True Then: Class = 1
If Option3.Value = True Then: Class = 2
If Option4.Value = True Then: Class = 3
If Option5.Value = True Then: Class = 4
If Option6.Value = True Then: Class = 5
If Option7.Value = True Then: Class = 6
If Check1.Value = vbChecked Then: Flags = (Flags Or 20) 'Expansion
If Check1.Value = vbChecked Then: Flags = (Flags Or 4) 'Hardcore
If Check1.Value = vbChecked Then: Flags = (Flags Or 40) 'Ladder

Why are you assigning numerals to a variable dimensionalized as a String variable?
Title: Re: MCP 0x02 (Char Create)
Post by: Tass on November 26, 2005, 09:48 PM
I have no idea :P, I'll change it.

But does anyone know the hex value for expansion because &H20 does not work.. and my packetlogger is not working correctly..
Title: Re: MCP 0x02 (Char Create)
Post by: Tass on November 26, 2005, 10:27 PM
Here's what I'v got for the packet log...

11 00 02 00 00 00 00 20 00 53 63 52 75 42 42 73 00
Title: Re: MCP 0x02 (Char Create)
Post by: UserLoser. on November 27, 2005, 12:11 AM
Quote

If Check1.Value = vbChecked Then: Flags = (Flags Or 20) 'Expansion
If Check1.Value = vbChecked Then: Flags = (Flags Or 4) 'Hardcore
If Check1.Value = vbChecked Then: Flags = (Flags Or 40) 'Ladder

wtf?
Title: Re: MCP 0x02 (Char Create)
Post by: l2k-Shadow on November 27, 2005, 02:06 AM
Hmm so you do OR the flags? that makes no sense to me. why would you do Hardcore Or Ladder and not Hardcore And Ladder?
Title: Re: MCP 0x02 (Char Create)
Post by: Tass on November 27, 2005, 09:54 AM
Yes I know.. it said to OR them together on bnetdocs so I was like ok wtf.. and then i switched them heh
Title: Re: MCP 0x02 (Char Create)
Post by: UserLoser. on November 27, 2005, 10:35 AM
No, using Or is correct.  Just the "Check1.Value = vbChecked" three times over is redundant and wtfable
Title: Re: MCP 0x02 (Char Create)
Post by: Tass on November 27, 2005, 01:31 PM
So shadow was wrong and i was right.. meh. I wasen't thinking what I put the checks up, I just copied them and forgot to chang them. And i kept getting kicked off the MCP because i was sending create expansion char on a classic key.. :) stupid me.. This is solved