Valhalla Legends Forums Archive | Battle.net Bot Development | A problem, help plz

AuthorMessageTime
EviL_MarinE
Hey, 3rd post soz ;(

But my problem is:

My bot is sending data:

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

So then it SHOULD go to:

[code]
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
[/code]

But it doesnt, Any ideas?
October 24, 2004, 8:55 PM
Minux
[quote author=EviL_MarinE link=topic=9297.msg85935#msg85935 date=1098645315]
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 :)
[/quote]

Didn't you already get your connection to work?
October 24, 2004, 9:30 PM
Quarantine
I have no idea why your DataArrival Sub is so big.

Straight out of my Bot

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

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

[code]

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
[/code]

Or something along those lines.
October 24, 2004, 9:40 PM
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.
October 24, 2004, 9:55 PM
Quarantine
Hrm never knew that.
October 24, 2004, 10:00 PM
UserLoser.
Bad idea to check for only packets > 4 in length, you could miss a lot of things
October 25, 2004, 2:10 AM
Minux
[quote author=UserLoser link=topic=9302.msg86000#msg86000 date=1098670247]
Bad idea to check for only packets > 4 in length, you could miss a lot of things
[/quote]

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.
October 25, 2004, 3:53 AM
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:

[code]
    bnetSocket.SendData Chr(1)
[/code]

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
October 25, 2004, 9:08 AM
EviL_MarinE
[code]
[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
[/code]

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?

[code]
        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
[/code]
The PacketID is going to 1 it seems, hmm, can anybody help me here?
October 25, 2004, 10:29 AM
Quarantine
Are you talking to yourself or did you just post 4 times on purpose?
October 25, 2004, 10:43 AM
EviL_MarinE
Umm, talking to myself i think ^_^
October 25, 2004, 10:47 AM
LivedKrad
[quote author=EviL_MarinE link=topic=9302.msg86046#msg86046 date=1098695317]
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:

[code]
    bnetSocket.SendData Chr(1)
[/code]

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
[/quote]

You based your questions on the validity of your DataArrival sub by parsing a response for Chr(1)?
October 25, 2004, 5:06 PM
EviL_MarinE
LivedKrad, dont take notice of that post, take notice of my latest One, All pelase help me on this:
[quote author=EviL_MarinE link=topic=9302.msg86049#msg86049 date=1098700179]
[code]
[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
[/code]

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?

[code]
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
[/code]
The PacketID is going to 1 it seems, hmm, can anybody help me here?
[/quote]

Thanks for your time and effort :)
October 25, 2004, 5:46 PM
R.a.B.B.i.T
[quote author=EviL_MarinE link=topic=9302.msg86049#msg86049 date=1098700179]
[code]
[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
[/code][/quote]

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.
October 26, 2004, 1:11 AM
KkBlazekK
[quote author=R.a.B.B.i.T link=topic=9302.msg86130#msg86130 date=1098753071]
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.
[/quote]

Plus it looks much better..
October 26, 2004, 1:35 AM
EviL_MarinE
;o well i was talking  to my old friend (Pro_User) and he sed "Scrap the BNLS idea" and then he spent about 1hr or so going through connecting to battle.net and it really helped! I then went to bed and came on this morning to find that he had built me a "noob proof" conenction to battle.net to help me! It has really made me learn alot so far!

+++++++++
Dont bother posting bk to this !
October 26, 2004, 11:03 AM
Kp
[quote author=EviL_MarinE link=topic=9302.msg86165#msg86165 date=1098788622]
;o well i was talking  to my old friend (Pro_User) and he sed "Scrap the BNLS idea" and then he spent about 1hr or so going through connecting to battle.net and it really helped! I then went to bed and came on this morning to find that he had built me a "noob proof" conenction to battle.net to help me! It has really made me learn alot so far!

+++++++++
Dont bother posting bk to this ![/quote]

I would hardly consider such a person "friend".  His action has deprived you of the learning that would come of actually accomplishing this.  On top of that, I rather doubt you've learned any debugging skill from all this.  Most people who solve their own problems at least learn a bit about debugging, and are better able to solve problems on their own the next time around.  What will you do the next time something breaks?
October 26, 2004, 3:21 PM
Quarantine
Post here of course!
October 26, 2004, 3:39 PM
LivedKrad
I would presume an unhandled packet would be a packet that has not been handled. So, I would also venture a guess that the solution to this problem, would be to handle the packet. It is also by this train of logic that I would assume that you *do not* know how to parse/handle/cram up your ass such packets. Please correct me if wrong.
October 26, 2004, 5:08 PM
EviL_MarinE

[quote author=EviL_MarinE link=topic=9302.msg86165#msg86165 date=1098788622]

+++++++++
Dont bother posting bk to this ![/quote]
[/qoute]

LivedKrad, ...? -_-V

I just said in my post ive restarted and i dont need help anymore, and please do not say "i cant parse", Get your facts right
October 26, 2004, 5:43 PM
LivedKrad
So, your argument that you can indeed parse these packets is backed up by the fact that you received code someone else wrote? That makes absolutely no sense.
October 26, 2004, 9:54 PM
Minux
Why don't we test him? Of course, on BNET, so he can't look up the answers :P
October 26, 2004, 11:18 PM
EviL_MarinE
ok here is what im doing, to make it so you lot understand *sigh*

Pro_User gave me a working code that connects to bnet, i dled it.
I said that  i dont wanna "cheat" and steal code, he said:

"Use this code to learn on how to connect to bnet, users talking, and even try a creating game, and channel lists, then when you have learnt most of it then try it on your own"

This is my way of learning atm, and i have tbh learnt on how to connect to bnet and confident on doing it myself, but first i will finish the rest of..


Does this all explain it now?
October 27, 2004, 11:44 AM
Soul Taker
[quote author=EviL_MarinE link=topic=9302.msg86294#msg86294 date=1098877477]
ok here is what im doing, to make it so you lot understand *sigh*

Pro_User gave me a working code that connects to bnet, i dled it.
I said that  i dont wanna "cheat" and steal code, he said:

"Use this code to learn on how to connect to bnet, users talking, and even try a creating game, and channel lists, then when you have learnt most of it then try it on your own"

This is my way of learning atm, and i have tbh learnt on how to connect to bnet and confident on doing it myself, but first i will finish the rest of..


Does this all explain it now?
[/quote]
Maybe... but I only speak English  :-\
October 27, 2004, 12:45 PM
LivedKrad
I wasn't fishing for an explanation. If I wanted to know why you read from others' code to learn, then I'd ask you why you want to do things the wrong way. However, I was asking how you justified your argument on being able to parse/handle certain packets based on simply downloading another person's code.
October 27, 2004, 3:36 PM
EviL_MarinE
I dont, but i learn from it so i can ?
October 27, 2004, 5:41 PM
Quarantine
Dont take this the wrong way but looking at other people's code ruins the feeling of acomplishment you get when you successfully logon. If I were you id learn from documentation, not examples aka ripped sources.
October 27, 2004, 8:39 PM
LivedKrad
Sufficing knowledge of the syntax may help also.
October 27, 2004, 9:26 PM
Minux
It is true that with Visual Basic, you can learn from sources. It is the only language it seems, that you can learn from viewing sources. HOWEVER, this route takes almost three times longer, and once you reach an intermediate level, you lack the knowledge which you should have learned along the way. You get into the habit of looking at other sources, and you are always asking for help, and expecting people just to give you the answer instead of learning it.

Edit: Also, there are alot of things like Bytes, Words, DWORDS, Longs, Single, Double etc..
That you only can associate with other's sources....and it takes a while to fully understand that without reading the proper documentation. Therefore my conclusion is, packet logs will seem like GREEK to you.

My opinion ~ Minus
October 28, 2004, 5:09 AM
EviL_MarinE
heh, Warrior is absolutey right, i didnt get the "feeling" when i got another persons code online :(

But now i have actaully learnt logging on to bnet and i am working on my own to do it, but as well as doing this i am working out channel view ect...

Yes i have a habit to look at other sources, but it will soon pass

thanks for pointing me into the right place, as now i dont copy :P

And i cant wait til >I< get a bot on >MYSELF< with >MY< coding :D:D

Since now i know how to logon to bnet i am capable doing it myself

thanks you lot
October 28, 2004, 10:45 AM
Myndfyr
Are you capable of debugging it yourself?  So basically what you're telling us is, since you know it, you won't be coming to us with your problems if/when it doesn't work right?
October 28, 2004, 1:54 PM
EviL_MarinE
Hmm, well i think i CAN do logging onto to bnet myself, might need some help

But the only thing im not sure on is, Hmm maybe the "Packetclass" in my case, The .Insertdword ect... And the Socket_DataArrival, maybe i can do it, but if i cant i might ask :)

- if you dont mind!  ;D
October 28, 2004, 3:46 PM
Quarantine
Well if your going to do this correctly and do your homework on Battle.net then I think we would be glad to help.
October 28, 2004, 4:19 PM
LivedKrad
[quote author=EviL_MarinE link=topic=9302.msg86427#msg86427 date=1098978390]
Hmm, well i think i CAN do logging onto to bnet myself, might need some help

But the only thing im not sure on is, Hmm maybe the "Packetclass" in my case, The .Insertdword ect... And the Socket_DataArrival, maybe i can do it, but if i cant i might ask :)

- if you dont mind!  ;D
[/quote]

.Insertdword? I wasn't aware this was an intrinsic function/method to Visual BASIC.  But, looking upon others' code has revealed to me that .Insertdword has come to be a function in many people's packet parsing modules. It looks like  nothing more than a small piece of code calling an additional function to shift certain bytes of data to create a "DWORD". So, I don't understand your supposed "small problem" with two different things that are completely unrelated to each other, such as this "Packetclass" and the method .Insertdword. So, if you could reply back with more... customized versions of these procedures, then I would also be more than happy to help in any way I can.
October 28, 2004, 5:01 PM
EviL_MarinE
ah LivedKrad thx thx, now i understand!

Btw "PacketClass" is my class module with Inserting dwords, words, bytes, byte ect......

Thx for helping me out, i started my bot like 10 mins ago and kinda doing good @_@

Only thing stuck on, Data Arrival, what to put for it? :(
October 28, 2004, 6:05 PM
Myndfyr
[quote author=EviL_MarinE link=topic=9302.msg86433#msg86433 date=1098986728]
Btw "PacketClass" is my class module with Inserting dwords, words, bytes, byte ect......
[/quote]
Just as an editorial note, I think it's at best redundant and at worst poor practice to prepend or append a name of a class with "Class."  If someone, including yourself, is using your class, knowing full well that it is a class, then doesn't it somewhat defeat the point of naming it "-Class"?

[quote author=EviL_MarinE link=topic=9302.msg86433#msg86433 date=1098986728]i started my bot like 10 mins ago and kinda doing good @_@

Only thing stuck on, Data Arrival, what to put for it? :(
[/quote]
So....  by "doing good(sic)" you mean you've managed to drag and drop controls onto a form?  What is hard about understanding what to put for the DataArrival event?  You put code there that processes data that has arrived....
October 28, 2004, 6:48 PM
EviL_MarinE
Hmm yeah thx MyndFyre, thx for help :)

Now doing Data Arrival but gtg so bye lol
October 28, 2004, 6:58 PM
LivedKrad
So, what exactly do you plan to do with this magical "PacketClass"? And also, you've resolved to start on your Data_Arrival event, what then, are you planning to do for that? Code would be appreciated BTW. :P
October 28, 2004, 9:45 PM
R.a.B.B.i.T
The closest any Visual BASIC programmer should get to looking at other people's code is looking at the examples in API-Guide (http://www.allapi.net/) when looking at an API call for the first time.
October 31, 2004, 10:31 PM
shadypalm88
[quote author=R.a.B.B.i.T link=topic=9302.msg86864#msg86864 date=1099261890]
The closest any Visual BASIC programmer should get to looking at other people's code is looking at the examples in API-Guide (http://www.allapi.net/) when looking at an API call for the first time.
[/quote]Well... that is how I learned Visual Basic.  I started tinkering around with a fully-working bot.  I knew the author so I could ask questions about it along the way.

After messing with it a lot I started to feel comfortable with VB.  Then I wrote my own bot from scratch.

Although, keep in mind:
1. VB was not my first [programming] language.  (PHP was.)
2. The bot I wrote was organized very differently than the original one I played with (mine was more OO, for one).  I wasn't just recoding the original (or copying and pasting).  I made an effort to understand what was going on, and then tried to do it better.

So I guess it can work for some people.  My VB "skillz" didn't turn out too bad, if I do say so myself.
October 31, 2004, 11:31 PM
LivedKrad
Yes they did Eric, you're horrible! :p
November 1, 2004, 6:13 PM
LoRd
[quote author=R.a.B.B.i.T link=topic=9302.msg86864#msg86864 date=1099261890]
The closest any Visual BASIC programmer should get to looking at other people's code is looking at the examples in API-Guide (http://www.allapi.net/) when looking at an API call for the first time.
[/quote]
So you're saying that learning through example is frowned apon now?  Pretty soon people will be flamed because they learned how to program by reading a book or taking a class.

[quote="R.a.B.B.i.T"]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.[/quote]

Quite contradicting views.
November 2, 2004, 8:00 AM
Myndfyr
[quote author=LoRd[nK] link=topic=9302.msg87106#msg87106 date=1099382412]
[quote author=R.a.B.B.i.T link=topic=9302.msg86864#msg86864 date=1099261890]
The closest any Visual BASIC programmer should get to looking at other people's code is looking at the examples in API-Guide (http://www.allapi.net/) when looking at an API call for the first time.
[/quote]
So you're saying that learning through example is frowned apon now?  Pretty soon people will be flamed because they learned how to program by reading a book or taking a class.
[/quote]

No, I don't think that's the issue.  I think the issue is this process:

1.) Take someone else code example, if the example is actually a product.
2.) Change things around, play with it, examine the changes.
3.) Package it as your own product, giving no credit to the original author.

Nobody publishes the "Hello, world" example as their own.  But, say I make my bot open-source, someone downloads it, changes the title and some cosmetic things, and recompiles it, publishes it himself as ]sC4M[b0t (ph33r I33t h4x0rz!), then yes, there is a problem.  I would be making it open-source so people could learn, NOT so that they could do exactly what I just described.
November 2, 2004, 3:09 PM
Minux
Which is why you need to do what Stealth did, when he released one of his VERY early version sources. He removed a bunch of items, changed a few names on different controls and suddenly any idiot would just say "not worth it" and move on to the next source. I envy him for that.
November 2, 2004, 9:11 PM
LoRd
[quote author=MyndFyre link=topic=9302.msg87116#msg87116 date=1099408142]
[quote author=LoRd[nK] link=topic=9302.msg87106#msg87106 date=1099382412]
[quote author=R.a.B.B.i.T link=topic=9302.msg86864#msg86864 date=1099261890]
The closest any Visual BASIC programmer should get to looking at other people's code is looking at the examples in API-Guide (http://www.allapi.net/) when looking at an API call for the first time.
[/quote]
So you're saying that learning through example is frowned apon now?  Pretty soon people will be flamed because they learned how to program by reading a book or taking a class.
[/quote]

No, I don't think that's the issue.  I think the issue is this process:

1.) Take someone else code example, if the example is actually a product.
2.) Change things around, play with it, examine the changes.
3.) Package it as your own product, giving no credit to the original author.

Nobody publishes the "Hello, world" example as their own.  But, say I make my bot open-source, someone downloads it, changes the title and some cosmetic things, and recompiles it, publishes it himself as ]sC4M[b0t (ph33r I33t h4x0rz!), then yes, there is a problem.  I would be making it open-source so people could learn, NOT so that they could do exactly what I just described.
[/quote]
You should be aware of all possible risks and be prepared to accept them before releasing your product as open-source because you can't just leave something like that in the public's eye and then get mad because they don't use it exactly how you expected them to.

You claim to release open-source products to help people understand, however, here you are, refusing to help someone understand and patch up a piece of someone's open-source product.  Rather than deeming him a leecher and criticizing him because of it, wouldn't it be better to just try and help him understand it?

[quote]Quote from: Minus on Today at 01:11:46 PM
Which is why you need to do what Stealth did, when he released one of his VERY early version sources. He removed a bunch of items, changed a few names on different controls and suddenly any idiot would just say "not worth it" and move on to the next source. I envy him for that.[/quote]
Releasing faulty code is hardly an answer.
November 2, 2004, 9:44 PM
Minux
[quote author=LoRd[nK] link=topic=9302.msg87142#msg87142 date=1099431893]
Releasing faulty code is hardly an answer.
[/quote]

No, the code isn't faulty, but enough things were changed so it would take a while to fix it up for it to compile. It's a great reference, just won't compile. I think that's awesome.

Edit: The answer is, stop providing support for VB robots. And only support C/C#/C++/Java programs therefore leechers won't  bother since learning the language actually takes effort.
November 2, 2004, 9:53 PM
LoRd
[quote]No, the code isn't faulty, but enough things were changed so it would take a while to fix it up for it to compile. It's a great reference, just won't compile.[/quote]
He delibertely altered his code so that it would not function properly which nearly eliminated the possibility of using it as a learning reference.

[quote]Edit: The answer is, stop providing support for VB robots. And only support C/C#/C++/Java programs therefore leechers won't  bother since learning the language actually takes effort.[/quote]
People can leech easily in any language since no prior knowledge of the language is required (duh?).
November 2, 2004, 10:01 PM

Search