• Welcome to Valhalla Legends Archive.
 

Error When Connecting Bot

Started by FLiPPY_, July 30, 2003, 11:05 AM

Previous topic - Next topic

FLiPPY_

 [12:07:14] Connecting to BNLS....
[12:07:15] Connected to BNLS!
[12:07:15] DEBUG: BNLS In:  07 00 0E 1D 89 CC 43
HType=0/spass=False/cb=0
[12:07:16] DEBUG: BNLS In:  07 00 0F 00 00 00 00
HType=0/spass=False/cb=0
[12:07:19] BNLS Authorization Passed.
[12:07:20] DEBUG: BNLS In:  07 00 10 00 00 00 00
HType=0/spass=False/cb=0
[12:07:20] Version Byte: 5963776

This is what it displays.. and right vefore BNLS Authorization Passed, it pops up a message box saying Invalid Version. Any Help would be appreciated.

Kp

Quote from: FLiPPY_ on July 30, 2003, 11:05 AM
[12:07:14] Connecting to BNLS....
[12:07:15] Connected to BNLS!
[12:07:15] DEBUG: BNLS In:  07 00 0E 1D 89 CC 43
HType=0/spass=False/cb=0
[12:07:16] DEBUG: BNLS In:  07 00 0F 00 00 00 00
HType=0/spass=False/cb=0
[12:07:19] BNLS Authorization Passed.
[12:07:20] DEBUG: BNLS In:  07 00 10 00 00 00 00
HType=0/spass=False/cb=0
[12:07:20] Version Byte: 5963776

This is what it displays.. and right vefore BNLS Authorization Passed, it pops up a message box saying Invalid Version. Any Help would be appreciated.
Given that we don't know your code (other than you appear to be YACU), pasting your output isn't exactly conducive to telling us what's wrong.  We don't know why you pop up an "invalid version" message box.

A very quick check of the protocol document reveals to me that your received 0 for the version byte response says you asked for a product that BNLS doesn't recognize.  Perhaps you shouldn't go passing invalid product IDs...? :)
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

FLiPPY_

Well we put them as PXES, RATS.. and that stuff.. is that not correct?

Spht

Quote from: FLiPPY_ on July 31, 2003, 05:42 PM
Well we put them as PXES, RATS.. and that stuff.. is that not correct?

That is not correct. You send the value of the product which is recognized by BNLS...

#define PRODUCT_STARCRAFT             (0x01)
#define PRODUCT_BROODWAR              (0x02)
#define PRODUCT_WAR2BNE               (0x03)
#define PRODUCT_DIABLO2               (0x04)
#define PRODUCT_LORDOFDESTRUCTION     (0x05)
#define PRODUCT_JAPANSTARCRAFT        (0x06)
#define PRODUCT_WARCRAFT3             (0x07)
#define PRODUCT_THEFROZENTHRONE       (0x08)

FLiPPY_

#4
.-'Modified Code'-.

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 NLS revision."
End If
End Sub

Private Sub CleanSlateBot1_BNLSDisconnected()
   AddChat vbRed, "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: " & 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)
   AddChat vbYellow, "Joined " & ChannelName & " [" & Flags & "]."
   lvChannel.ListItems.Add (UserName)
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 vbYellow, "Connecting to Diablo II Realm..."
End Sub

Private Sub CleanSlateBot1_RealmDisconnected()
   AddChat vbRed, "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, "Something unknown has happened... Did B.Net just get more gay?"
End Sub


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

Private Sub CleanSlateBot1_UserInChannel(ByVal UserName As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, StatUpdate As Boolean, SimulatedEvent As Boolean)
'nada
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 vbWhite, "[" & Format$(Time, "Hh:Nn:Ss") & "] "
   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 vbWhite, "[" & Format$(Time, "Hh:Nn:Ss") & "] "
       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 vbWhite, "[" & Format$(Time, "Hh:Nn:Ss") & "] "
       AddWSpeech vbCyan, "<To: ", _
               vbWhite, UserName, _
               vbCyan, "> ", _
               vbWhite, Message
End Sub

Public Sub Form_Load()
Dim imConnected As Boolean
Dim strTheTime, strDay, strMonth, strYear, strHour, strMin, strSec As String
imConnected = False
strDay = Format$(Now, "Dd")
strMonth = Format$(Now, "Mm")
strYear = Format$(Now, "Yyyy")
strHour = Format$(Now, "Hh")
strMin = Format$(Now, "Nn")
strSec = Format$(Now, "Ss")

If strMonth = 1 Then
   strMonth = "January"
ElseIf strMonth = 2 Then
   strMonth = "February"
ElseIf strMonth = 3 Then
   strMonth = "April"
ElseIf strMonth = 4 Then
   strMonth = "March"
ElseIf strMonth = 5 Then
   strMonth = "May"
ElseIf strMonth = 6 Then
   strMonth = "June"
ElseIf strMonth = 7 Then
   strMonth = "July"
ElseIf strMonth = 8 Then
   strMonth = "August"
ElseIf strMonth = 9 Then
   strMonth = "September"
ElseIf strMonth = 10 Then
   strMonth = "October"
ElseIf strMonth = 11 Then
   strMonth = "November"
ElseIf strMonth = 12 Then
   strMonth = "December"
End If
strTheTime = Format(Now, "mmmm dd, yyyy | .:. | HH:MM:SS")
AddSpeech vbYellow, strTheTime
AddChat vbYellow, "Welcome to SystemBot v1.47d by R.a.B.B.i.T and FLiPPY_" & vbNewLine, _
       vbYellow, "This is a beta version and is not to be leaked."

Dim strUsername, strPassword, strChangePW, strNewPassword, strProduct, strCDKey, strLODKey, strServer As String
Dim strRealm, strUseRealm, strCharacter, strHomeChannel, strUseUDP, strConnectStart As String
strUsername = GetStuff("Configuration", "Username")
strPassword = GetStuff("Configuration", "Password")
strChangePW = GetStuff("Configuration", "Change Password")
strNewPassword = GetStuff("Configuration", "New Password")
strProduct = GetStuff("Configuration", "Product")
strCDKey = GetStuff("Configuration", "CD-Key")
strLODKey = GetStuff("Configuration", "LoD-Key")
strServer = GetStuff("Configuration", "Server")
strRealm = GetStuff("Configuration", "Realm")
strHomeChannel = GetStuff("Configuration", "Home Channel")
strUseUDP = GetStuff("Configuration", "Use Bot Plug")
strConnectStart = GetStuff("Configuration", "Connect At Run")

CleanSlateBot1.Accept = 579728
CleanSlateBot1.BNLSBotID = "xxxx"
CleanSlateBot1.BNLSBotPassword = "xxxxxx"
CleanSlateBot1.Server = strServer
If strUseRealm = "Yes" Then
   CleanSlateBot1.UseRealm = True
   CleanSlateBot1.LODKey = strLODKey
   CleanSlateBot1.Character = strCharacter
Else
   CleanSlateBot1.UseRealm = False
End If
CleanSlateBot1.CDKey = strCDKey
CleanSlateBot1.UserName = strUsername
CleanSlateBot1.Password = strPassword
If strChangePW = "Yes" Then
   CleanSlateBot1.ChangePassword = True
   CleanSlateBot1.NewPassword = strNewPassword
Else
   CleanSlateBot1.ChangePassword = False
End If
CleanSlateBot1.HomeChannel = strHomeChannel
If strUsePlug = "Yes" Then
   CleanSlateBot1.UseUDP = True
Else
   CleanSlateBot1.UseUDP = False
End If
If strConnectStart = "Yes" Then
   CleanSlateBot1.Connect
   mnuDisconnect.Enabled = True
   mnuReconnect.Enabled = True
   mnuConnect.Enabled = False
Else
   CleanSlateBot1.Disconnect
   mnuDisconnect.Enabled = False
   mnuReconnect.Enabled = False
   mnuConnect.Enabled = True
End If


Form1.Caption = "System Bot 1.47d Beta by R.a.B.B.i.T and FLiPPY_"
Close #1
Close #2
End Sub

Private Sub mnuConfig_Click()
   Dim theConfig As New Form2
   theConfig.Show
End Sub

Private Sub mnuConnect_Click()
   CleanSlateBot1.Connect
   Debug.Print
   Form1.lvChannel.ListItems.Clear
   mnuDisconnect.Enabled = True
   mnuConnect.Enabled = False
   mnuReconnect.Enabled = True
End Sub

Private Sub mnuDisconnect_Click()
   AddChat vbRed, "Disconnected."
   CleanSlateBot1.Disconnect
   Form1.lvChannel.ListItems.Clear
   mnuDisconnect.Enabled = False
   mnuConnect.Enabled = True
   mnuReconnect.Enabled = False
End Sub

Private Sub mnuReconnect_Click()
   AddChat vbYellow, "Reconencting..."
   CleanSlateBot1.Disconnect
   CleanSlateBot1.Connect
   mnuDisconnect.Enabled = True
   mnuConnect.Enabled = False
   mnuReconnect.Enabled = True
End Sub

Private Sub mnuExit_Click()
Dim ansclick As String
   ansclick = MsgBox("Are you Sure you want to Exit?", vbYesNo, "Exit")
If ansclick = vbYes Then
   Close #1
   CleanSlateBot1.Send "Forced disconnect by Exit menu command."
   CleanSlateBot1.Disconnect
   End
End If
End Sub


Private Sub txtSend_KeyPress(keyascii As Integer)
If imConnected = True Then
   Dim strSend, strPrepend, strAppend, strFull, mUsername As String
   mUsername = GetStuff("Configuration", "Username")
   If keyascii = 13 And txtSend.Text <> "" Then
       strSend = txtSend.Text
       strPrepend = txtPrepend.Text
       strAppend = txtAppend.Text
       strFull = strPrepend & strSend & strAppend
       txtSend.Text = ""
       AddSpeech vbWhite, "[" & Format$(Time, "Hh:Nn:Ss") & "] ", _
               vbCyan, "<", _
               vbWhite, mUsername, _
               vbCyan, "> ", _
               vbWhite, strFull
       
   End If
End If
End Sub


Yes we do have a BNLS username/ password

UserLoser

Quote from: FLiPPY_ on July 31, 2003, 06:04 PM
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."
Else
   AddChat vbRed, "Something is afoot..."
End If
End Sub

A boolean can only be True or False, so there's no need for the Else.

FLiPPY_

Ok, fixed that in both parts.. still I get the same errors.. if I'm not showing you the right code then just tell me.. and I'll give that code.. I'm all out of ideas now..  :(

Dark-Feanor

If BNLS is sending you the wrong version byte, you could always use a function like this:

Public Function GetVerByte() As String
On Error Resume Next
Select Case varProduct
       Case "RATS"
           GetVerByte = "C7"
       Case "PXES"
           GetVerByte = "C7"
       Case "NB2W"
           GetVerByte = "4F"
       Case "VD2D"
           GetVerByte = "09"
       Case "PX2D"
           GetVerByte = "09"
       Case "3RAW"
           GetVerByte = "0C"
       Case "PX3W"
           GetVerByte = "0C"
   End Select
End Function
- Feanor[xL]
clan exile
Firebot
iago: "caps lock is like cruise control for cool"

Grok

#8
Quote from: FLiPPY_ on July 31, 2003, 06:04 PM

If strMonth = 1 Then
   strMonth = "January"
ElseIf strMonth = 2 Then
   strMonth = "February"
ElseIf strMonth = 3 Then
   strMonth = "April"
ElseIf strMonth = 4 Then
   strMonth = "March"
ElseIf strMonth = 5 Then
   strMonth = "May"
ElseIf strMonth = 6 Then
   strMonth = "June"
ElseIf strMonth = 7 Then
   strMonth = "July"
ElseIf strMonth = 8 Then
   strMonth = "August"
ElseIf strMonth = 9 Then
   strMonth = "September"
ElseIf strMonth = 10 Then
   strMonth = "October"
ElseIf strMonth = 11 Then
   strMonth = "November"
ElseIf strMonth = 12 Then
   strMonth = "December"
End If


Plenty I could fix in there, but this caught my eye.

strMonth = Format(Now,"mmmm")

Oh and if all you want is the time in this format:

QuotestrTheTime = strMonth & " " & strDay & ", " & strYear & " | . : . | " & strHour & ":" & strMin & ":" & strSec

Try this:

strTheTime = Format("Now, "mmmm dd, yyyy | .:. | HH:MM:SS")

Looks much cleaner.
Hope this helps.

Spht

Quote from: DaRk-FeAnOr on July 31, 2003, 08:56 PM
If BNLS is sending you the wrong version byte, you could always use a function like this:

Public Function GetVerByte() As String
On Error Resume Next
Select Case varProduct
       Case "RATS"
           GetVerByte = "C7"
       Case "PXES"
           GetVerByte = "C7"
       Case "NB2W"
           GetVerByte = "4F"
       Case "VD2D"
           GetVerByte = "09"
       Case "PX2D"
           GetVerByte = "09"
       Case "3RAW"
           GetVerByte = "0C"
       Case "PX3W"
           GetVerByte = "0C"
   End Select
End Function


BNLS wouldn't send an invalid version byte. My guess is he's parsing the return wrong.

FLiPPY_

Ok,
Dark-Feanor, your code doesn't work at all on my script. Maybe I'm adding it wrong? I dont know.

Grok, when you want me to add

strTheTime = Format("Now, "mmmm dd, yyyy | .:. | HH:MM:SS")

It asks me to put a list seperator or a ) and it puts my mouse cursor over mmmm. I've tried to do that and it doesn't seem to work.
Thanks for trying though

UserLoser

Take the quotation mark away next to Now.

FLiPPY_

Ok, now it works.  ;) Does anyone have a clue why my bot wont connect?

FLiPPY_

Yes, I am using Cleanslatebot. :-)

Stealth

Try adding Option Explicit to the top of your form to make sure that you haven't accidentally re-declared a variable with nothing in it.

Have you coded all the CleanSlateBot events in some form or another? I didn't have time to scan your entire block of code.
- Stealth
Author of StealthBot