All pastes #589475 Raw Edit

ddfg

public text v1 · immutable
#589475 ·published 2007-06-26 00:25 UTC
rendered paste body
Public Function ParseChatData(whatSaid As String, theirID As String) 'used for parsing chat messages
Dim saySplit() As String, strCMD As String, strName As String, strData As String
Dim lngSpace As Long
Dim tmpName As String, tmpID As String
Dim Commander As String

On Error Resume Next

strData = vbNullString
saySplit() = Split(whatSaid, " ") 'split chat data by spaces
strCMD = saySplit(0)              'get the command (0'th space)
strName = players(theirID).Name   'get the person's name
lngSpace = InStr(whatSaid, " ")   'find location of space
Commander = players(theirID).Name
'If Commander <> "[GL]Kcuf" And Commander <> "[SS]OvErDoSe" And Commander <> "[GL]kyuss" And Commander <> "[GL]Jared" And Commander <> "[GL]RoadDog" And Commander <> "[GL]2fast" And Commander <> "[GL]Mezma" And Commander <> "xK" Then Exit Function
If IsAllowedCmd(strCMD, CLng(theirID)) = False Then Exit Function
If lngSpace <> 0 Then strData = Right(whatSaid, Len(whatSaid) - lngSpace) 'get all the data after the first space

PGetNameInfo strData, tmpName, tmpID

If IsNameCommand(strCMD) = True Then 'its a 'name' command that requires a name as a parameter!

If FormatText(strData) = vbNullString Then
PM Commander, "Provide a name, please."
Exit Function
End If
PGetNameInfo strData, tmpName, tmpID 'extract the name and id from strdata, place them in tmpName and tmpID variables.
If tmpName = vbNullString Then PM Commander, "Invalid Name.": Exit Function
End If

If strCMD = "!switch" And LCase(Commander) = LCase(txtMaster.Text) And UBound(saySplit) > 0 Then
    If LCase(saySplit(1)) = LCase(txtMyName.Text) Then
        If bEnableControl = True Then bEnableControl = False Else bEnableControl = True
        GodSend "[" & txtMyName.Text & "] Commands Enabled: " & bEnableControl
    End If
End If
If bEnableControl = True Then
Select Case strCMD

Case "!area"