Valhalla Legends Forums Archive | Battle.net Bot Development | Re: Receiving 127 and 137 Bytes

AuthorMessageTime
Noodlez
why dont you print the data?
March 5, 2003, 7:30 AM
tA-Kane
The data you are receving is most likely something similar to...

[CODE]
2010 NAME kanezor
1007 CHANNEL "Public Chat 1"
1001 USER FearsBot 0010 [CHAT]
1001 USER W3P 0010 [CHAT]
1001 USER Gods_TempleChat 0010 [CHAT]
1001 USER STD-East 0010 [CHAT]
1001 USER dt1969#2 0010 [CHAT]
1001 USER Sage_Master 0000 [D2XP]
1001 USER pr0be_death 0010 [CHAT]
1001 USER AvalonBoA 0010 [CHAT]
1001 USER BF-Franksbot 0010 [CHAT]
1001 USER kiss1212k@Azeroth 0000 [WAR3]
1001 USER kanezor 0010 [CHAT]
1018 INFO "Welcome to Battle.net!"
1018 INFO "This server is hosted by AT&T."
1018 INFO "There are currently 369 users in Chat, and 228452 users playing 91278 games on Battle.net."
1019 ERROR "Chatting with this game is restricted to the channels listed in the channel menu."
1018 INFO "Last logon: Fri Feb 14  2:22 AM"
1019 ERROR "Failed logon attempts since then: 1"
1003 LEAVE kiss1212k@Azeroth 0000
1003 LEAVE AvalonBoA 0010
1003 LEAVE Sage_Master 0000
[/CODE]
March 5, 2003, 8:13 AM
MesiaH
lol on your data arrival sub, make a string, and do SOCKET.getdata STRINGUMADE

and then add the STRINGUMADE to the rtb or in the intermeddiate debug window by using debug.print or debug.assert, but its gotta be what kane said, nothing else in the chatbot connection procedure is that large.
March 5, 2003, 4:03 PM
haZe
Nevermind, I used PeekData instead and got my orginal results. But, their requesting my user and pass and I already sent it!! Here is my complete code.
[code]
Private Sub connect_Click()
sckBnet.Close
sckBnet.connect "useast.battle.net", 6112
'Debug.Print "Connecting to useast.battle.net..."
AddText vbDarkYellow, "Connecting to useast.battle.net..."
End Sub

Private Sub disconnect_Click()
sckBnet.Close
'Debug.Print "Disconnected."
AddText vbRed, "Disconnected."
End Sub

Private Sub Form_Load()
frmDataWindow.Show
End Sub
Private Sub sckBnet_Connect()
sckBnet.SendData Chr(3) & Chr(4) & USERNAME & vbCrLf & PASSWORD & vbCrLf
AddText vbGreen, "Connected!"
End Sub

Private Sub sckBnet_ConnectionRequest(ByVal requestID As Long)
AddText vbBlue, "Connection Request from to " & requestID
End Sub

Private Sub sckBnet_DataArrival(ByVal bytesTotal As Long)
Dim data As String
AddData vbLavender, "Data Recieved - Bytes Total: " & bytesTotal
sckBnet.PeekData data
AddData &HFFFF00, "" & data
End Sub

Private Sub sckBnet_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Debug.Print "Error: " & Number & ":" & Description & " Scode: " & Scode & " Source: " & Source
AddText vbRed, "Socket Error " & Number & ": " & Description
AddText vbRed, "Socket Error Scode " & Scode
AddText vbRed, "Socket Error Source " & Source
AddData vbRed, "Socket Error " & Number & ": " & Description
AddData vbRed, "Socket Error Scode " & Scode
AddData vbRed, "Socket Error Source " & Source
End Sub
[/code]
Am I sending my user and password wrong? Because its requesting it...
March 5, 2003, 4:45 PM
Yoni
Use GetData, not PeekData.
GetData removes the data from the internal buffer. PeekData doesn't (so you'll see the same data over and over again until you run out of buffer space).
March 5, 2003, 4:56 PM
haZe
Not for me..and even with GetData, I get the same message. It requests my user/pass again, even thouhg im pretty sure I already sent it.
March 5, 2003, 4:59 PM
MesiaH
IIRC, bnet chat protocol doesnt request the name and password again if its invalid, you just get disconnected, so your obviously not doing it right.
March 5, 2003, 8:43 PM
haZe
what am i doing wrong..
March 5, 2003, 8:48 PM
Camel
[quote]Use GetData, not PeekData.[/quote]
haze, you're totally wrong if you think peekdata is removing data from "the internal buffer"
March 5, 2003, 9:28 PM
haZe
Uh, Buddy, Yoni wrote that Not me.
March 5, 2003, 9:41 PM
tA-Kane
[quote]IIRC, bnet chat protocol doesnt request the name and password again if its invalid, you just get disconnected[/quote]
You do not remember correctly.

[CODE]
Connection from [ip hidden]

Enter your account name and password.
Use 'anonymous' if you only want to issue queries.

Username: badusername
Password: badpassword

Login incorrect
Username: kanezor
Password: (hidden)


2010 NAME kanezor
1007 CHANNEL "Public Chat 1"
...etc
[/CODE]
March 6, 2003, 8:54 AM
Camel
[quote]Uh, Buddy, Yoni wrote that Not me.[/quote]
yoni wrote it, i emphasized it

[edit] google is the best spell checker ever invented
March 6, 2003, 3:15 PM
St0rm.iD
[quote]
[edit] google is the best spell checker ever invented[/quote]

True dat. AbiWord's sucks.
March 6, 2003, 4:24 PM

Search