
Untitled
By:
Serpen64 on
Jun 17th, 2012 | syntax:
VB.NET | size: 1.39 KB | hits: 24 | expires: Never
Private Sub IrcClient_onDataArrival(ByVal Data() As Byte, ByVal totBytes As Integer) Handles IrcClient.onDataArrival
Dim inData As String = IrcClient.BytestoString(Data)
Dim lData() As String
Dim C() As String
Dim tData As Integer
Dim CL As Integer
Dim CLi As String
Dim a As Integer
lData = Split(inData, Chr(10))
tData = UBound(lData) - LBound(lData)
For a = 0 To tData
If Mid(lData(a), 1, 1) = ":" Then
lData(a) = Mid(lData(a), 2)
End If
Next
For CL = 0 To tData
C = Split(lData(CL), " ")
ReDim Preserve C(2000)
CLi = lData(CL)
If C(0) = "PING" Then
IrcClient.SendData(IrcClient.StringToBytes("PONG :" & Mid(C(1), 2) & vbCrLf))
End If
If C(1) = "PRIVMSG" Then
' MsgBox("[" & Mid(C(3), 2) & "]") 'IF NO SPACE AT END OF STRING: RETURNS A vbNewLine????
If Mid(C(3), 2) = "a" Then
IrcClient.SendData(IrcClient.StringToBytes("PRIVMSG " & C(2) & " :" & "Bitch!" & vbCrLf))
End If
End If
' IrcClient.SendData(IrcClient.StringToBytes("JOIN #Serpen64" & vbCrLf))
ServerStatusBox.Text = ServerStatusBox.Text & vbCrLf & CLi
Next
End Sub