• Welcome to Valhalla Legends Archive.
 

BNLS Connect help

Started by BorT, March 01, 2004, 04:34 PM

Previous topic - Next topic

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.

MyndFyre

#1
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:


WinSock1.Connect "bnls.valhallalegends.com", 9367


I hope you're using Visual Basic!

[/edit]
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Eric

Quote from: Myndfyre on March 01, 2004, 04:47 PM
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:


WinSock1.Connect "bnls.valhallalegends.com", 9367


I hope you're using Visual Basic!

[/edit]

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/.

ChR0NiC

#3
Quote from: BorT on March 01, 2004, 04:34 PM
Hey, whats the code that is used to connect to the BNLS Server

BTW, I already have a Username and Password for the Server.

Easiest way to get your bot connected with BNLS


sckBNLS.Connect "bnls.valhallalegends.com", 9367


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.

BorT

Sorry i was very vague on my post, was in a rush. Anyways Cupheads ocx seems to be working fine, Thanks. :)

BorT

Where do I put

WinSock1.Connect "bnls.valhallalegends.com", 9367
?

effect

I believe all YOU will have to do is


clanslatebot1.connect


after you have initialized all of its values

clanslatebot1.username
cleanslatebot1.password
cleanslatebot1.accept

and so forth.
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

ChR0NiC

#7
Quote from: BorT on March 02, 2004, 06:47 PM
Where do I put

WinSock1.Connect "bnls.valhallalegends.com", 9367
?

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

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

Eli_1

#9
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

ExaM

#10
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


Private Sub mnuConnect_Click()
Call Connect
End Sub

Sub Connect()
<BNLS Info>
End Sub


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.

MyndFyre

Quote from: ExaM on March 03, 2004, 08:22 AM
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


Private Sub mnuConnect_Click()
Call Connect
End Sub

Sub Connect()
<BNLS Info>
End Sub


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.

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....
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

BorT


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

Am I missing something, seems to me that im missing the code to connect to bnet..Will CSB do that for me somehow?

Thanks.

Eric

#13
CleanSlateBot does it all for you, however, I believe once you connect the majority of packet parsing is up to you.

Eli_1

#14
Quote from: whoever_started_this... on March 03, 2004, 02:55 PM
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

Do this for me:

Private Sub Form_Load()
sckBNLS.Accept = 579728
sckBNLS.BNLSBotID = "bort"
sckBNLS.BNLSBotPassword = "System"
sckBNLS.Server = strServer
Debug.Print strServer


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 from: LoRd[nK] on March 03, 2004, 02:55 PM
CleanSlateBot does it all for you, however, I believe once you connect the majority of packet parsing is up to you.
No, CSB does that too  :-\