• Welcome to Valhalla Legends Archive.
 

Connecting to BNLS

Started by Tubby, August 06, 2003, 02:37 PM

Previous topic - Next topic

Tubby

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


[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

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.

Tubby

Even when i just have CSB on a form and harcode the properties. It still doesnt connect

FuZe

Quote from: Tubby on August 06, 2003, 02:37 PM
Ok when I try and connect to Bnet using BNLS I get this error


[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


Your string doesnt end with a null terminator
try this
07 00 0E D8 8C F0 57 00

Soul Taker

Looks like that's BNLS sending him a DWORD to me.

DarkMinion

Fuze...what kind of string would have an 0x0e character right at the beginning :\

UserLoser


FLiPPY_

#7
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 http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=2135

Tubby

Sorry but what you did to fix your code, doesnt help me.

FLiPPY_

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

Tubby


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

FuZe


Tubby

What is that? What do i need to do so it will connect?

Hazard

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!~!

"Courage is being scared to death - but saddling up anyway." --John Wayne

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