• Welcome to Valhalla Legends Archive.
 

BNCSutil Example Bot

Started by shadypalm88, March 10, 2005, 11:49 PM

Previous topic - Next topic

shadypalm88

I've been seeing a few posts here of people having problems figuring out how to use BNCSutil, and I think they're all using Visual Basic.

So I put together an example bot in Visual Basic capable of connecting and logging in (doesn't enter chat or anything).  I'm hoping this will show a little more clearly how it's used, how to check for errors, etc.

I'm placing this code (except BNCSutil.bas, which, like the rest of BNCSutil, falls under the LGPL) in the public domain.  Do with it what you'd like.

Click here to download.  (Also available on the BNCSutil site.)

If you have any questions about the example, reply here.

[Edit: Never did actually say what language it was in.]

Hdx

Cool, now let the leaxched warcraft 3 hashing bots begin!
But ya, thank you. That example showed me what I was doing wrong. I missunderstood the nls_init() function. I was creating a new pointer for each packet. Simply initalizing the pointer on 0x53 C->S and then clearing it on 0x54 c->s fixed it :) thank you once again.
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

iago

Nice :)

I'd rather see bots use BNCSUtil than use BNLS or NLS.dll. 

I'm glad my code is helping people :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


NetNX

I love you iago, lol i love bncsutil also ~_^ Eric you own

QwertyMonster

BNCSutil, very nice! ;D

Maybe people will use this more than BNLS or NLS.dll ? :P

iago

Hopefully people will use it instead of NLS.dll, since at least BNCSutil is supported.  Not to mention, it's cross-platform.

BNLS is fine for certain reasons, like if the original author of a bot gets lost in a certain MMORPG and is unable to update it in a timely fashion.  Although bots should be flexible enough that they don't need to be recompiled to change version information in the first place.  But eh? :/
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


QwertyMonster

Quote from: iago on March 11, 2005, 10:10 AM
Hopefully people will use it instead of NLS.dll, since at least BNCSutil is supported.  Not to mention, it's cross-platform.

BNLS is fine for certain reasons, like if the original author of a bot gets lost in a certain MMORPG and is unable to update it in a timely fashion.  Although bots should be flexible enough that they don't need to be recompiled to change version information in the first place.  But eh? :/


Yeah. Totally agreed!

BNCSutil all the way baby! :P

Well done shadypalm88!  8)

Michael

I get a runtime error 49 bad DLL calling for this line.
    mpqNumber = extractMPQNumber(P.GetString())
when testing the sample.

UserLoser.

Quote from: shadypalm88 on March 10, 2005, 11:49 PM
I've been seeing a few posts here of people having problems figuring out how to use BNCSutil, and I think they're all using Visual Basic.

So I put together an example bot in Visual Basic capable of connecting and logging in (doesn't enter chat or anything).  I'm hoping this will show a little more clearly how it's used, how to check for errors, etc.

I'm placing this code (except BNCSutil.bas, which, like the rest of BNCSutil, falls under the LGPL) in the public domain.  Do with it what you'd like.

Click here to download.  (Also available on the BNCSutil site.)

If you have any questions about the example, reply here.

[Edit: Never did actually say what language it was in.]


        Case 1
            'W3 Beta NLS
            Disconnect
            MsgBox "The NLS revision that the server has requested " & _
                "is not supported.", vbExclamation, "Example Bot"
            Exit Sub


That is false since you support the new logon system when the value is 2.  Diablo II and Starcraft (with their expansions) both support the use of the new logon system when this value is set to 1.

iago

I do the same style of login if I receive 1 or 2, even though I'm not totally sure that NLS1 is the same as NLS2. 
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


shadypalm88

Quote from: UserLoser on March 11, 2005, 01:52 PMThat is false since you support the new logon system when the value is 2.  Diablo II and Starcraft (with their expansions) both support the use of the new logon system when this value is set to 1.
If I remember using BNLS correctly, I had to set the NLS revision if this value was not equal to 1, or I would be unable to login.  Now, having never seen a logon type of 1 "in the wild", I don't know for sure if I would be able to log on or not, because I don't know what, if any, differences there are (or if any differences are in operations like upgrading accounts).  But based on what I knew about BNLS, I decided to have it fail gracefully.

If someone could elaborate on the differences, or say whether the differences are known, etc., it'd be appreciated.

UserLoser.

#11
Quote from: shadypalm88 on March 11, 2005, 03:18 PM
Quote from: UserLoser on March 11, 2005, 01:52 PMThat is false since you support the new logon system when the value is 2.  Diablo II and Starcraft (with their expansions) both support the use of the new logon system when this value is set to 1.
If I remember using BNLS correctly, I had to set the NLS revision if this value was not equal to 1, or I would be unable to login.  Now, having never seen a logon type of 1 "in the wild", I don't know for sure if I would be able to log on or not, because I don't know what, if any, differences there are (or if any differences are in operations like upgrading accounts).  But based on what I knew about BNLS, I decided to have it fail gracefully.

If someone could elaborate on the differences, or say whether the differences are known, etc., it'd be appreciated.

As far as I know, the only difference is non-war3 clients support upgrading accounts.  Could be used maybe to determine the method used to hash the CDKey values.  War3 must receive a 2 for this value, and it uses a 'regular' SHA for the hash, while other clients use the 'broken' one.  1 could be used to tell the client to use the new logon system, but still use the older cdkey hashing method, while 2 is use the new logon system, but use the new cdkey hashing method. /shrug, my post is sounding redundant

Stealth

Quote from: -MichaeL- on March 11, 2005, 01:51 PM
I get a runtime error 49 bad DLL calling for this line.
    mpqNumber = extractMPQNumber(P.GetString())
when testing the sample.

Make sure you're using version 0.2.3 of bncsutil.dll.
- Stealth
Author of StealthBot

Archangel

In bncsutil_checkVersion() Function
Line: Check = bncsutil_getVersion()
Should be: Req = bncsutil_getVersion()
I'm not an Addict.

Archangel

I like BNCSUtil but like giving an example bot loading all clients for users that didnt know how to use library will just make a alot of people edit that source and there wont be any effort on bot development.
I'm not an Addict.