Valhalla Legends Forums Archive | Battle.net Bot Development | Connecting to BNLS

AuthorMessageTime
Tubby
Ok when I try and connect to Bnet using BNLS I get this error

[code]
[15:40:42] Connecting to BNLS....
[15:40:42] Connected to BNLS!
[15:40:43] DEBUG This: BNLS In: 07 00 0E D8 8C F0 57
HType=0/spass=False/cb=0
[15:40:43] Disconnected from BNLS
[/code]
August 6, 2003, 7:37 PM
UserLoser
If it's IN then it's not happening when you're connecting. BNLS only sends you messages back if you send them first, so then it must be your programming error.
August 6, 2003, 8:41 PM
Tubby
Even when i just have CSB on a form and harcode the properties. It still doesnt connect
August 6, 2003, 9:21 PM
FuZe
[quote author=Tubby link=board=17;threadid=2227;start=0#msg17233 date=1060198622]
Ok when I try and connect to Bnet using BNLS I get this error

[code]
[15:40:42] Connecting to BNLS....
[15:40:42] Connected to BNLS!
[15:40:43] DEBUG This: BNLS In: 07 00 0E D8 8C F0 57
HType=0/spass=False/cb=0
[15:40:43] Disconnected from BNLS
[/code]
[/quote]

Your string doesnt end with a null terminator
try this
07 00 0E D8 8C F0 57 00
August 7, 2003, 4:07 AM
Soul Taker
Looks like that's BNLS sending him a DWORD to me.
August 7, 2003, 5:38 AM
DarkMinion
Fuze...what kind of string would have an 0x0e character right at the beginning :\
August 7, 2003, 6:56 AM
UserLoser
A happy string.
August 7, 2003, 2:16 PM
FLiPPY_
Blah.. I know most of you don't like me now.. but I don't think I will be needing Bot help in the future. If you look back at the Post. Error Connecting Bot or whatever.. thats the same error that I got. Just poiting something out..

EDIT - Link https://davnit.net/bnet/vL/phpbbs/index.php?board=17;action=display;threadid=2135
August 7, 2003, 3:00 PM
Tubby
Sorry but what you did to fix your code, doesnt help me.
August 7, 2003, 5:11 PM
FLiPPY_
Well maybe you posting your code might help?
EDIT - When it connects to BNLS.. it just disconnects. It doesn't Authorize it. Make sure you did all the things from the dropdown menu for CleanSlateBot1.. if thats what your using to connect
August 7, 2003, 5:47 PM
Tubby
[code]
Option Explicit
Public strUsername As String, strPassword As String, strHomeChannel As String, strServer As String, strCDKey As String, strRealm As String, strRealmChar As String, strProduct As String, strSend As String, mUsername As String
Private Sub CleanSlateBot1_BnetConnected()
AddChat vbGreen, "Connected to BNET!"
End Sub

Private Sub CleanSlateBot1_BnetConnecting()
AddChat vbYellow, "Connecting to BNET!"

End Sub

Private Sub CleanSlateBot1_BnetDisconnected()
AddChat vbRed, "Disconnected from BNET!"
End Sub

Private Sub CleanSlateBot1_BnetError(ErrorNumber As Integer, Description As String)
AddChat vbRed, "Error Number: " & Number & " Description: " & Description

End Sub

Private Sub CleanSlateBot1_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 CleanSlateBot1_BNLSConnected()
AddChat vbGreen, "Connected to BNLS!"
End Sub

Private Sub CleanSlateBot1_BNLSConnecting()
AddChat vbYellow, "Connecting to BNLS...."
End Sub

Private Sub CleanSlateBot1_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 BNLS revision."
End If

End Sub

Private Sub CleanSlateBot1_BNLSDisconnected()
AddChat vbGreen, "Disconnected from BNLS"

End Sub

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

Private Sub CleanSlateBot1_ChannelList(ChannelName As String)
lblChannelName.Caption = ChannelName
End Sub

Private Sub CleanSlateBot1_CharacterList(CharacterName As String)
strBox = MsgBox(CharacterName, , "Character") = vbOK
End Sub

Private Sub CleanSlateBot1_Debugger(Message As String)
AddChat vbRed, "DEBUG This: " & Message
End Sub

Private Sub CleanSlateBot1_FlagsUpdate(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, SimulatedEvent As Boolean)
Dim intstr As Integer 'Declare The integers
Dim lagicoN As Integer
Dim icon As Integer

icon = GetIconCodeFLAGS(Message, Flags)
lagicoN = GetLagIcon(Ping, Flags)
If InStr(1, Username, "*", vbTextCompare) <> 0 Then
intstr = InStr(1, Username, "*", vbTextCompare)
Username = Right(Username, Len(Username) - intstr)
End If

If (Flags And BNFLAGS_OP) = BNFLAGS_OP Then
icon = ICON_GAVEL
Main.lvChannel.ListItems.Remove Main.lvChannel.FindItem(Username).Index
With Main.lvChannel.ListItems.Add(1, , Username, , icon)
.ListSubItems.Add 1, , , lagicoN
End With
Else
With Main.lvChannel
.ListItems(.FindItem(Username).Index).SmallIcon = icon
End With
End If
End Sub

Private Sub CleanSlateBot1_JoinedChannel(ByVal ChannelName As String, ByVal Flags As Long, SimulatedEvent As Boolean)
rtbChat.Text = rtbChat.Text & "Joined Channel: " & ChannelName & vbCrLf
End Sub

Public Sub AddChat(ParamArray saElements() As Variant)
On Error Resume Next
Dim strTimeStamp As String, Logging As Boolean, data As String
strTimeStamp = "[" & Format(Time, "hh:mm:ss") & "] "


With rtbChat
.SelStart = Len(.Text)
.SelLength = 0
.SelColor = vbWhite
.SelText = strTimeStamp
.SelStart = Len(.Text)
data = strTimeStamp
End With

Dim i As Integer
For i = LBound(saElements) To UBound(saElements) Step 2
With rtbChat
.SelStart = Len(.Text)
.SelLength = 0
.SelColor = saElements(i)
.SelText = saElements(i + 1) & Left$(vbCrLf, -2 * CLng((i + 1) = UBound(saElements)))
.SelStart = Len(.Text)
data = data & saElements(i + 1)
End With
Next i
With rtbChat
If Len(.Text) >= 20000 Then
.Visible = False
.SelStart = 0
.SelLength = InStr(1, .Text, vbLf, vbTextCompare)
.SelText = ""
.SelStart = Len(.Text)
.Visible = True
End If
End With
End Sub
Public Sub addText(ByVal txtOne As String, ByVal clrOne As Long, Optional ByVal txtTwo As String, Optional ByVal clrTwo As Long, Optional strType As String)
txtOne = Replace(txtOne, vbCrLf, "")
txtTwo = Replace(txtTwo, vbCrLf, "")
Call AddChat(clrOne, txtOne, clrTwo, txtTwo)
Form1.rtbChat.SelStart = Len(Form1.rtbChat.Text)
End Sub

Private Sub CleanSlateBot1_LoggedOnAs(Username As String, Product As String)
AddChat vbGreen, "Logged on as " & Username & " using " & Product & "."
imConnected = True

End Sub

Private Sub CleanSlateBot1_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 CleanSlateBot1_News(News As String)
AddChat vbYellows, News & vbNewLine

End Sub

Private Sub CleanSlateBot1_PasswordChange(Success As Boolean)
If Success = True Then
AddChat vbGreen, "Password change successful."
ElseIf Success = False Then
AddChat vbRed, "Password chage failed."
End If

End Sub

Private Sub CleanSlateBot1_RealmConnected()
AddChat vbGreen, "Connected to Diablo II Realm."
End Sub

Private Sub CleanSlateBot1_RealmConnecting()
AddChat vbGreen, "Connecting to Diablo II Realm.."
End Sub

Private Sub CleanSlateBot1_RealmDisconnected()
AddChat vbGreen, "Disconnected from Diablo II Realm."
End Sub

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

End Sub

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

End Sub

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

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

End Sub

Private Sub CleanSlateBot1_SomethingUnknown(ByVal UnknownString As String, SimulatedEvent As Boolean)
AddChat vbRed, "Hmm...Something has happened that is Unknown!"
End Sub

Private Sub CleanSlateBot1_UserEmote(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, SimulatedEvent As Boolean)
AddChat vbBlue, "<" & Username & Message & ">"

End Sub

Private Sub CleanSlateBot1_UserJoins(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, SimulatedEvent As Boolean)
AddChat vbYellow, Username & " has joined the channel using " & Product & " with a ping of " & Ping & ". " & Message
lvChannel.ListItems.Add (Username)

End Sub

Private Sub CleanSlateBot1_UserLeaves(ByVal Username As String, ByVal Flags As Long, SimulatedEvent As Boolean)
AddChat vbYellow, Username & " has left the channel."
lvChannel.ListItems.Remove (Username)

End Sub

Private Sub CleanSlateBot1_UserTalk(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, SimulatedEvent As Boolean)
AddSpeech vbCyan, "<", _
vbWhite, Username, _
vbCyan, "> ", _
vbWhite, Message

End Sub

Private Sub CleanSlateBot1_VersionByte(VersionByte As Long)
AddChat vbYellow, "Version Byte: " & VersionByte

End Sub

Private Sub CleanSlateBot1_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

Private Sub CleanSlateBot1_WhisperFromUser(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, SimulatedEvent As Boolean)
AddWSpeech vbCyan, "<From: ", _
vbGray, Username, _
vbCyan, "> ", _
vbGray, Message
End Sub

Private Sub CleanSlateBot1_WhisperToUser(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, SimulatedEvent As Boolean)
AddWSpeech vbCyan, "<To: ", _
vbWhite, Username, _
vbCyan, "> ", _
vbWhite, Message

End Sub

Private Sub Form_Load()


AddChat vbYellow, strTheTime
AddChat vbYellow, "Welcome to Tu|3|3y Chat v1.00 by BD_Tubby " & vbNewLine, _
vbYellow, "This is a private bot as of now. If you have gotten it by my gracefullnes, Dont leak!"

frmTubbyChat.Caption = "Tu|3|3y Chat by Tul3l3y
Close #1
Close #2



CleanSlateBot1.BNLSBotID = "xxxx"
CleanSlateBot1.BNLSBotPassword = "xxxx"
CleanSlateBot1.CDKey = strCDKey
CleanSlateBot1.Product = "RATS"
CleanSlateBot1.HomeChannel = "Op Roost"
CleanSlateBot1.Password = strPassword
CleanSlateBot1.Username = strUsername
CleanSlateBot1.NewPassword = "bleh"
CleanSlateBot1.ChangePassword = False
CleanSlateBot1.Server = "useast.battle.net"
CleanSlateBot1.Accept = 579728
End Sub

Private Sub mnuConnect_Click()
CleanSlateBot1.Connect

End Sub

Private Sub mnuDisconnect_Click()
CleanSlateBot1.Disconnect
End Sub

Private Sub mnuExit_Click()
Unload Me
End Sub

Private Sub mnuReconnect_Click()

End Sub

Private Sub mnuSetting_Click()
frmSettings.Show
End Sub



Private Sub txtSend_Keypress(KeyAscII As Integer)
If CleanSlateBot1.Connected = True Then
mUsername = ReadINI(f, "Username", "\" & p)
If KeyAscII = 13 And txtSend.Text <> "" Then
AddChat vbWhite, " [" & Format$(Time, "Hh:Nn:Ss") & "] ", vbCyan, "<", vbBlue, mUsername, vbCyan, "> ", vbWhite, strSend
CleanSlateBot1.Send txtSend.Text
txtSend.Text = ""

KeyAscII = 0
End If
End If
End Sub
[/code]
August 7, 2003, 6:16 PM
FuZe
[quote author=Soul Taker link=board=17;threadid=2227;start=0#msg17290 date=1060234700]
Looks like that's BNLS sending him a DWORD to me.
[/quote]
yep :(
August 7, 2003, 6:40 PM
Tubby
What is that? What do i need to do so it will connect?
August 7, 2003, 7:56 PM
DrivE
Highlight your entire code. Press the delete key. Start over again using Cuphead's CSB tutorial and work your way from their rather than raping code from downloaded sources meant purely for learning purposes. If this does not fix the problem, uninstall Visual Basic and get a new hobby. I suggest Cricket.

!~!HaZaRD!~!
August 7, 2003, 8:15 PM
Tubby
umm ok. I used Stealths source for the WriteINI ReadINI. What ever else I found on the forums or asked people in the clan. And i have found a hobby
August 7, 2003, 10:12 PM
Tubby
Now I get this
[code]
[12:02:15] Connecting to BNLS....
[12:02:15] Connected to BNLS!
[12:02:15] DEBUG This: BNLS In: 07 00 0E BE 6F 28 10
HType=0/spass=False/cb=0
[12:02:15] DEBUG This: BNLS In: 07 00 0F 00 00 00 00
HType=0/spass=False/cb=0
[12:02:16] BNLS Authorization Passed.
[12:02:16] DEBUG This: BNLS In: 07 00 10 00 00 00 00
HType=0/spass=False/cb=0
[12:02:16] Version Byte: 7471104
[/code]
August 15, 2003, 3:58 PM
Eternal
*wonders what the hobby might be..
August 15, 2003, 6:33 PM
Tubby
w00t Eternal is back! Can you help me now? ::)
August 15, 2003, 7:24 PM
Camel
Where did you get 0x720000 from, Tubby? It doesnt appear to be anywhere in your packet dumps...
August 16, 2003, 12:00 AM
Tubby
I dont know. I set up everything and it seemed to be allright. When i click connect, that is what comes up. And when it connects to BNLS a msg box appears and say Invalid version. Then i get version byte 0. Runtime Error 10049. Address is not availible from local machine.
August 16, 2003, 12:04 AM
Tubby
*Bump* and i have screens of it. I cant figure it out.
August 18, 2003, 10:08 PM

Search