Valhalla Legends Forums Archive | Battle.net Bot Development | BNLS Connect help

AuthorMessageTime
BorT
Hey, whats the code that is used to connect to the BNLS Server

BTW, I already have a Username and Password for the Server.
March 1, 2004, 10:34 PM
Myndfyr
N00B|_3T A|_3RT

[edit] What's extremely interesting to me is that this guy doesn't state his goals... why he wants to connect to the BNLS server... what language he's using....

Here's how:

[code]
WinSock1.Connect "bnls.valhallalegends.com", 9367
[/code]

I hope you're using Visual Basic!

[/edit]
March 1, 2004, 10:47 PM
LoRd
[quote author=Myndfyre link=board=17;threadid=5533;start=0#msg46972 date=1078181264]
N00B|_3T A|_3RT

[edit] What's extremely interesting to me is that this guy doesn't state his goals... why he wants to connect to the BNLS server... what language he's using....

Here's how:

[code]
WinSock1.Connect "bnls.valhallalegends.com", 9367
[/code]

I hope you're using Visual Basic!

[/edit]
[/quote]

Somehow I think he needs a little more help than that.

BorT, you can find complete documentation for BNLS Packets on http://www.valhallalegends.com/yoni/BNLSProtocolSpec.txt.
You can also use CleanSlateBot which is the easiest way to use BNLS, it's avaliable at http://www.valhallalegends.com/cuphead/.
March 1, 2004, 11:23 PM
ChR0NiC
[quote author=BorT link=board=17;threadid=5533;start=0#msg46970 date=1078180458]
Hey, whats the code that is used to connect to the BNLS Server

BTW, I already have a Username and Password for the Server.
[/quote]

Easiest way to get your bot connected with BNLS

[code]
sckBNLS.Connect "bnls.valhallalegends.com", 9367
[/code]

1. Connect To BNLS *big step*
2. Send Your BNLS ID To BNLS (As A Null Terminated String)
3. Get a response to your ID, then send your BNLS Pass.
4. Then on the response to your password, send your product to BNLS
5. You will then begin your connection to BNET. Start with sending 0x50

The rest should come as a given if you know how to connect to BNET. This is simply just helping you understand what it takes to use this illustrious server.

I am not in the mood for flaming, but it has been a while since I made my connection to BNLS, so any corrections (politely) please feel free to add on.

Edit: When you ask for code, you really do need to be more specific, but do not expect ANYBODY to just write you a BNLS connection, because unless you pay somebody, it will not happen.
March 2, 2004, 12:35 AM
BorT
Sorry i was very vague on my post, was in a rush. Anyways Cupheads ocx seems to be working fine, Thanks. :)
March 3, 2004, 12:15 AM
BorT
Where do I put
[code]
WinSock1.Connect "bnls.valhallalegends.com", 9367
[/code]?
March 3, 2004, 12:47 AM
Null
I believe all YOU will have to do is

[code]
clanslatebot1.connect
[/code]

after you have initialized all of its values

clanslatebot1.username
cleanslatebot1.password
cleanslatebot1.accept

and so forth.
March 3, 2004, 12:56 AM
ChR0NiC
[quote author=BorT link=board=17;threadid=5533;start=0#msg47150 date=1078274874]
Where do I put
[code]
WinSock1.Connect "bnls.valhallalegends.com", 9367
[/code]?
[/quote]

Go to http://www.valhallalegends.com/cuphead/ocx_me.txt

For details on how to use the OCX and how to get it to connect
March 3, 2004, 1:52 AM
BorT
[22:17:14] Connecting to BNLS...
[22:17:14] Connected to BNLS!
[22:17:14] BNLS Authorization Passed.
[22:17:14] Connecting to BNET...
[22:17:14] Address is not available from the local machine


How can I fix that? I know obviously that its failing to connect to the server, would this most likely be because faulty info has been entered, or maybe im just missing some code :-X
March 3, 2004, 3:25 AM
Eli_1
You most likely got that error because:

a.) CSB.Server was left out
b.) CSB.Server was invalid
c.) not connected to the internet at all (can't be the case because you connected to BNLS fine...)

[Edit 1] Changed the wording after I read over it
March 3, 2004, 4:33 AM
ExaM
Ok, how is your code set up? Do you have a menubar on the top with like connect? Click connect or whatever you use as your 'connect button' and type Call Connect then make a sub called connect and place your info in there. Example

[code]
Private Sub mnuConnect_Click()
Call Connect
End Sub

Sub Connect()
<BNLS Info>
End Sub
[/code]

Edit: Nevermind after reading more into it, sounds like you got it to connect, just a couple errors. But this is what I used to connect to BNLS.
March 3, 2004, 2:22 PM
Myndfyr
[quote author=ExaM link=board=17;threadid=5533;start=0#msg47225 date=1078323756]
Ok, how is your code set up? Do you have a menubar on the top with like connect? Click connect or whatever you use as your 'connect button' and type Call Connect then make a sub called connect and place your info in there. Example

[code]
Private Sub mnuConnect_Click()
Call Connect
End Sub

Sub Connect()
<BNLS Info>
End Sub
[/code]

Edit: Nevermind after reading more into it, sounds like you got it to connect, just a couple errors. But this is what I used to connect to BNLS.
[/quote]

While I tend to promote this kind of coding practice, do you realize that you don't need to have a separate Connect() subroutine, Exam? You can stick all you initialization/connection code under mnuConnect_Click....
March 3, 2004, 2:44 PM
BorT
[code]
Option Explicit

Private Sub Form_Load()
sckBNLS.Accept = 579728
sckBNLS.BNLSBotID = "bort"
sckBNLS.BNLSBotPassword = "System"
sckBNLS.Server = strServer
If strProduct = "PXES" Then
sckBNLS.Product = "PXES"
ElseIf strProduct = "RATS" Then
sckBNLS.Product = "PXES"
ElseIf strProduct = "VD2D" Then
sckBNLS.Product = "VD2D"
ElseIf strProduct = "PX2D" Then
sckBNLS.Product = "PX2D"
ElseIf strProduct = "NB2W" Then
sckBNLS.Product = "NB2W"
ElseIf strProduct = "3RAW" Then
sckBNLS.Product = "3RAW"
Else
sckBNLS.Product = "RATS"
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
End
End Sub

Private Sub mnuConnect_Click()
sckBNLS.Connect
End Sub

Private Sub mnuDisconnect_Click()
AddChat vbRed, "Disconnected."
sckBNLS.Disconnect
End Sub

Private Sub mnuSettings_Click()
frmSettings.Show
End Sub

Private Sub sckBNLS_BnetConnected()
AddChat vbGreen, "Connected to BNET!"
End Sub

Private Sub sckBNLS_BnetConnecting()
AddChat vbYellow, "Connecting to BNET..."
End Sub

Private Sub sckBNLS_BnetError(ErrorNumber As Integer, Description As String)
AddChat vbRed, Description
End Sub

Private Sub sckBNLS_BNLSAuthEvent(Success As Boolean)
If Success = True Then
AddChat vbGreen, "BNLS Authorization Passed."
ElseIf Success = False Then
AddChat vbRed, "BNLS Authorization Failed."
End If
End Sub

Private Sub sckBNLS_BNLSConnected()
AddChat vbGreen, "Connected to BNLS!"
End Sub

Private Sub sckBNLS_BNLSConnecting()
AddChat vbGreen, "Connecting to BNLS..."
End Sub

Private Sub sckBNLS_BNLSDataError(Message As Byte)
If Message = 1 Then
AddChat vbRed, "Bad CD key."
ElseIf Message = 2 Then
AddChat vbRed, "Bad product version."
ElseIf Message = 3 Then
AddChat vbRed, "Bad NLS revision."
End If
End Sub

Private Sub sckBNLS_BNLSError(ErrorNumber As Integer, Description As String)
AddChat vbRed, ErrorNumber & Description
End Sub

Private Sub sckBNLS_LoggedOnAs(UserName As String, Product As String)
Dim strProduct, aProduct, myUsername As String
strProduct = Left$(Product, 4)
If strProduct = "RATS" Then
aProduct = "StarCraft"
ElseIf strProduct = "PXES" Then
aProduct = "StarCraft: Brood War"
ElseIf strProduct = "NB2W" Then
aProduct = "Warcraft II BNE"
ElseIf strProduct = "PX2D" Then
aProduct = "Diablo II: Lord of Destruction"
ElseIf strProduct = "VD2D" Then
aProduct = "Diablo II"
ElseIf strProduct = "RTSJ" Then
aProduct = "StarCraft Japan"
ElseIf strProduct = "3RAW" Then
aProduct = "Warcraft III: The Frozen Thone"
Else
aProduct = "an unknown client"
End If
End Sub

Private Sub sckBNLS_LogonEvent(Message As Byte)
If Message = 0 Then
AddChat vbRed, "Failed logon, account doesn't exist."
ElseIf Message = 1 Then
AddChat vbRed, "Failed logon, bad password."
ElseIf Message = 2 Then
AddChat vbGreen, "Successful logon."
ElseIf Message = 3 Then
AddChat vbYellow, "Attempting to create the account."
ElseIf Message = 4 Then
AddChat vbGreen, "Successfully created account."
End If
End Sub

Private Sub sckBNLS_ServerError(ByVal Message As String, SimulatedEvent As Boolean)
AddChat vbRed, Message
End Sub

Private Sub sckBNLS_ServerInfo(ByVal Message As String, SimulatedEvent As Boolean)
AddChat vbYellow, Message
End Sub

Private Sub sckBNLS_SimulatedEvent(ByVal PassedControl As Integer, ByVal EventType As String)
AddChat vbYellow, PassedControl & EventType
End Sub

Private Sub sckBNLS_UserEmote(ByVal UserName As String, ByVal Flags As Long, ByVal Message As String, SimulatedEvent As Boolean)
AddChat vbYellow, " <" & strUserName & " " & Message & ">"
End Sub

Private Sub sckBNLS_VersionCheck(Message As Byte, ExtraInfo As String)
If Message = 0 Then
AddChat vbGreen, "Client version accepted!"
ElseIf Message = 1 Then
AddChat vbRed, "Version check failed! Bad version.. this message should not appear ever!"
ElseIf Message = 2 Then
AddChat vbGreen, "Version check passed!" & vbCrLf, vbRed, "CDKey invalid!"
ElseIf Message = 3 Then
AddChat vbRed, "Version check failed! BNLS has not been updated yet.."
ElseIf Message = 4 Then
AddChat vbGreen, "Version check passed!" & vbCrLf, vbRed, "Your CD-key is for another game."
ElseIf Message = 5 Then
AddChat vbGreen, "Version check passed!" & vbCrLf, vbRed, "Your CD-key is banned."
ElseIf Message = 6 Then
AddChat vbGreen, "Version check passed!" & vbCrLf, vbRed, "Your CD-key is currently in use."
End If
End Sub
[/code]
Am I missing something, seems to me that im missing the code to connect to bnet..Will CSB do that for me somehow?

Thanks.
March 3, 2004, 8:21 PM
LoRd
CleanSlateBot does it all for you, however, I believe once you connect the majority of packet parsing is up to you.
March 3, 2004, 8:55 PM
Eli_1
[quote author=whoever_started_this... link=board=17;threadid=5533;start=0#msg47288 date=1078347318]
Private Sub Form_Load()
sckBNLS.Accept = 579728
sckBNLS.BNLSBotID = "bort"
sckBNLS.BNLSBotPassword = "System"
sckBNLS.Server = strServer
If strProduct = "PXES" Then
sckBNLS.Product = "PXES"
ElseIf strProduct = "RATS" Then
sckBNLS.Product = "PXES"
ElseIf strProduct = "VD2D" Then
sckBNLS.Product = "VD2D"
ElseIf strProduct = "PX2D" Then
sckBNLS.Product = "PX2D"
ElseIf strProduct = "NB2W" Then
sckBNLS.Product = "NB2W"
ElseIf strProduct = "3RAW" Then
sckBNLS.Product = "3RAW"
Else
sckBNLS.Product = "RATS"
End If
End Sub
[/quote]

Do this for me:
[code]
Private Sub Form_Load()
sckBNLS.Accept = 579728
sckBNLS.BNLSBotID = "bort"
sckBNLS.BNLSBotPassword = "System"
sckBNLS.Server = strServer
Debug.Print strServer
[/code]

check what strServer ends up being - make sure there's not a typo in it (e.g. useast.bat6le.net or something) or if it's blank for some reason...

[quote author=LoRd[nK] link=board=17;threadid=5533;start=0#msg47288 date=1078347318]
CleanSlateBot does it all for you, however, I believe once you connect the majority of packet parsing is up to you.
[/quote]
No, CSB does that too :-\
March 3, 2004, 9:57 PM
Myndfyr
[quote author=Eli_1 link=board=17;threadid=5533;start=0#msg47306 date=1078351025]
[quote author=LoRd[nK] link=board=17;threadid=5533;start=0#msg47288 date=1078347318]
CleanSlateBot does it all for you, however, I believe once you connect the majority of packet parsing is up to you.
[/quote]
No, CSB does that too :-\
[/quote]

Correct -- CSB just gives you events. No packet parsing required.

As Kp has so elegantly stated:

[quote]Any idiot can make a bot with CSB -- and many do![/quote]
March 3, 2004, 10:41 PM
BorT
I Figured it out :D
March 4, 2004, 3:26 AM
Eli_1
what was the problem?
March 4, 2004, 3:41 AM

Search