• Welcome to Valhalla Legends Archive.
 

A problem, help plz

Started by EviL_MarinE, October 24, 2004, 03:55 PM

Previous topic - Next topic

EviL_MarinE

Hey, 3rd post soz ;(

But my problem is:

My bot is sending data:


Private Sub BnetSocket_Connect()
Display frmMain.ChatRoom, True, True, vbGreen, "BNET: Connected to Battle.net!"
    bnetSocket.SendData Chr(1)
    Send0x50
End Sub


So then it SHOULD go to:


Private Sub bnetsocket_DataArrival(ByVal bytesTotal As Long)
Static strBuffer As String
Dim strTemp As String, lngLen As Long
    bnetSocket.GetData strTemp, vbString
    strBuffer = strBuffer & strTemp
    While Len(strBuffer) > 4
        lngLen = Val("&H" & StrToHex(StrReverse(Mid(strBuffer, 3, 2))))
        If Len(strBuffer) < lngLen Then: Exit Sub
        ParseBnet (Left(strBuffer, lngLen))
        strBuffer = Mid(strBuffer, lngLen + 1)
    Wend
End Sub


But it doesnt, Any ideas?

Minux

Quote from: EviL_MarinE on October 24, 2004, 02:15 PM
AH, k thanks.

Well i did just use www.valhallalegends.com in the end and it worked

Thanks for the help in other forum btw :)

Didn't you already get your connection to work?

Warrior

I have no idea why your DataArrival Sub is so big.

Straight out of my Bot


Private Sub sckBNCS_DataArrival(ByVal bytesTotal As Long)
    Dim Packets As String
        sckBNCS.GetData Packets, vbString
            BNCS.ParsePacket Packets
End Sub


Assuming you do Public BNCS as New BNCS also assuming you name your class BNCS



Public Function ParsePacket(Data As String)
    Dim Header As String
        If Data = vbNullString Then Exit Sub
            Header = Asc(Mid(Data, 2, 1))
        Select Case Header
            Case &H50 'SID_AUTH_INFO
                'Parse
           Case Else 'Packet Handling
                'Handle Unknown Packet
        End Select
End Function


Or something along those lines.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Stealth

His code checks the validity of the packet. Battle.net will sometimes send you multiple or partial packets, so if you try and parse them, you won't succeed.
- Stealth
Author of StealthBot

Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

UserLoser.

Bad idea to check for only packets > 4 in length, you could miss a lot of things

Minux

Quote from: UserLoser on October 24, 2004, 09:10 PM
Bad idea to check for only packets > 4 in length, you could miss a lot of things

Forgive me for saying, but I don't think he wrote that himself. He most likely acquired from somebody elses source code. Otherwise he would probably agree with you.

EviL_MarinE

hmm, minus i tried ur coding and still not,  It just doesnt go to data arrival, maybe the data isnt being sent? Oh but it is:


    bnetSocket.SendData Chr(1)


Hmmm, It should go to the Data Arrival, and i know it doesnt because i put a msgbox in there to say if it had gone to that, and the msg never came up... Any ideas people

EviL_MarinE


[11:23:06] Welcome To iLLuSiOn Bot 1.0.0 By EviL_MarinE
[11:23:07] BNLS: Connecting To bnls.valhallalegends.com
[11:23:07] BNLS: Connected to BNLS!
[11:23:08] BNET: Connected to Battle.net server 213.248.106.204
[11:23:09] Unhandled Packet: 0x05
[11:23:09]  FF 05 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[11:23:09] Unhandled Packet: 0x01D
[11:23:09]  FF 1D 0C 00 D8 9A 04 00 15 09 16 EF


Thats my bot, and im getting 2 unhandled packets, i think 0x01D is LogonChallange ? and 0x05 Is SID_CLIENT_ID ?? Correct me if im wrong plz ;)

Has anybody got any ideas WHY im getting these 2 unhandled packets?


        Case Else
            If Len(PacketId) = 1 Then
                Display frmMain.ChatRoom, True, True, vbRed, "Unhandled Packet: 0x0" & Hex(PacketId)
            Else
                Display frmMain.ChatRoom, True, True, vbRed, "Unhandled Packet: 0x" & Hex(PacketId)
            End If
            Display frmMain.ChatRoom, True, True, vbRed, StrToHex(data)
    End Select
End Sub

The PacketID is going to 1 it seems, hmm, can anybody help me here?

Warrior

Are you talking to yourself or did you just post 4 times on purpose?
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

EviL_MarinE

Umm, talking to myself i think ^_^

LivedKrad

Quote from: EviL_MarinE on October 25, 2004, 04:08 AM
hmm, minus i tried ur coding and still not,  It just doesnt go to data arrival, maybe the data isnt being sent? Oh but it is:


    bnetSocket.SendData Chr(1)


Hmmm, It should go to the Data Arrival, and i know it doesnt because i put a msgbox in there to say if it had gone to that, and the msg never came up... Any ideas people

You based your questions on the validity of your DataArrival sub by parsing a response for Chr(1)?

EviL_MarinE

LivedKrad, dont take notice of that post, take notice of my latest One, All pelase help me on this:
Quote from: EviL_MarinE on October 25, 2004, 05:29 AM

[11:23:06] Welcome To iLLuSiOn Bot 1.0.0 By EviL_MarinE
[11:23:07] BNLS: Connecting To bnls.valhallalegends.com
[11:23:07] BNLS: Connected to BNLS!
[11:23:08] BNET: Connected to Battle.net server 213.248.106.204
[11:23:09] Unhandled Packet: 0x05
[11:23:09] FF 05 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[11:23:09] Unhandled Packet: 0x01D
[11:23:09] FF 1D 0C 00 D8 9A 04 00 15 09 16 EF


Thats my bot, and im getting 2 unhandled packets, i think 0x01D is LogonChallange ? and 0x05 Is SID_CLIENT_ID ?? Correct me if im wrong plz ;)

Has anybody got any ideas WHY im getting these 2 unhandled packets?


Case Else
If Len(PacketId) = 1 Then
Display frmMain.ChatRoom, True, True, vbRed, "Unhandled Packet: 0x0" & Hex(PacketId)
Else
Display frmMain.ChatRoom, True, True, vbRed, "Unhandled Packet: 0x" & Hex(PacketId)
End If
Display frmMain.ChatRoom, True, True, vbRed, StrToHex(data)
End Select
End Sub

The PacketID is going to 1 it seems, hmm, can anybody help me here?

Thanks for your time and effort :)

R.a.B.B.i.T

Quote from: EviL_MarinE on October 25, 2004, 05:29 AM

[11:23:06] Welcome To iLLuSiOn Bot 1.0.0 By EviL_MarinE
[11:23:07] BNLS: Connecting To bnls.valhallalegends.com
[11:23:07] BNLS: Connected to BNLS!
[11:23:08] BNET: Connected to Battle.net server 213.248.106.204
[11:23:09] Unhandled Packet: 0x05
[11:23:09]  FF 05 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[11:23:09] Unhandled Packet: 0x01D
[11:23:09]  FF 1D 0C 00 D8 9A 04 00 15 09 16 EF

More of a sidenote: you should use (Grok's?) DebugOutput(), which is available on the BotDev page, it will make life so much easier later on.

Blaze

Quote from: R.a.B.B.i.T on October 25, 2004, 08:11 PM
More of a sidenote: you should use (Grok's?) DebugOutput(), which is available on the BotDev page, it will make life so much easier later on.

Plus it looks much better..
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No