• Welcome to Valhalla Legends Archive.
 

Parsing Data.

Started by Christ, February 11, 2004, 12:33 PM

Previous topic - Next topic

Christ

Sup everyone, I've recently been working hard on this new bot i created, Its in VB6.0 and to do a shitlist, protect and wildcards i need to parse data join_events.. i'm still learning but this is what i have so far.

Option Explicit
Private index As Integer

Public Sub AddToBuffer(ByVal strData As String)
   Dim buffer() As String
   Dim pos As Byte
   buffer() = Split(strData, vbCrLf)
   For pos = 0 To UBound(buffer())
       If Len(buffer(pos)) > 0 Then
           parse buffer(pos)
       End If
   Next pos
End Sub

Public Sub constructor(iform As Integer)
   index = iform
End Sub

Private Sub parse(data As String)
   Dim packetID() As String
   packetID() = Split(data, " ", 3)
   Select Case packetID(0)
       Case "2010"
           addchat index, vbGreen, "Connected to: " & frm(index).varserver
       Case "1018"
           addchat index, vbYellow, data
       Case "1005"
           packetID() = Split(packetID(2), " ", 3)
           Dim cmd As New Commands
           Call cmd.process(packetID(0), Mid(packetID(2), 2, Len(packetID(2)) - 2), index)
   End Select
End Sub

The join packet is "1002" But whats next.. i dunno i'm stuck any help?

[Kp edit: added code tags.  Use them on your own in the future.]

o.OV

#1
From the looks of it.. its a Chat/TAHC client..

I'm guessing you will be using it on a fsgs/emul server?

TAHC clients are pretty straight forward .. especially since the data you recieve is in Plain text that could be read. You can do trial and error and find out on your own.. or you could use the "search facility" to find your answer.
If the facts don't fit the theory, change the facts. - Albert Einstein

Christ

Yes, this is a chat for XGN/WARRNET.. and no tried it if i wanted to do search for the answer i would have i posted on here to get help, not to be told to search for it on google.com.

Dyndrilliac

Quote from: Christ on February 11, 2004, 03:19 PM
Yes, this is a chat for XGN/WARRNET.. and no tried it if i wanted to do search for the answer i would have i posted on here to get help, not to be told to search for it on google.com.

I believe he means the FORUM search function. Questions get answered over and over, it is your responsibility to make sure you aren't double posting a question.
Quote from: Edsger W. DijkstraIt is practically impossible to teach good programming to students that have had a prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.