Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: Serpen64 on Jun 17th, 2012  |  syntax: VB.NET  |  size: 1.39 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     Private Sub IrcClient_onDataArrival(ByVal Data() As Byte, ByVal totBytes As Integer) Handles IrcClient.onDataArrival
  2.  
  3.         Dim inData As String = IrcClient.BytestoString(Data)
  4.  
  5.         Dim lData() As String
  6.         Dim C() As String
  7.         Dim tData As Integer
  8.         Dim CL As Integer
  9.         Dim CLi As String
  10.         Dim a As Integer
  11.  
  12.         lData = Split(inData, Chr(10))
  13.         tData = UBound(lData) - LBound(lData)
  14.  
  15.         For a = 0 To tData
  16.             If Mid(lData(a), 1, 1) = ":" Then
  17.                 lData(a) = Mid(lData(a), 2)
  18.             End If
  19.         Next
  20.  
  21.         For CL = 0 To tData
  22.             C = Split(lData(CL), " ")
  23.             ReDim Preserve C(2000)
  24.             CLi = lData(CL)
  25.  
  26.             If C(0) = "PING" Then
  27.                 IrcClient.SendData(IrcClient.StringToBytes("PONG :" & Mid(C(1), 2) & vbCrLf))
  28.             End If
  29.  
  30.             If C(1) = "PRIVMSG" Then
  31.  
  32.                 ' MsgBox("[" & Mid(C(3), 2) & "]") 'IF NO SPACE AT END OF STRING: RETURNS A vbNewLine????
  33.                 If Mid(C(3), 2) = "a" Then
  34.  
  35.                     IrcClient.SendData(IrcClient.StringToBytes("PRIVMSG " & C(2) & " :" & "Bitch!" & vbCrLf))
  36.                 End If
  37.  
  38.             End If
  39.  
  40.             ' IrcClient.SendData(IrcClient.StringToBytes("JOIN #Serpen64" & vbCrLf))
  41.             ServerStatusBox.Text = ServerStatusBox.Text & vbCrLf & CLi
  42.         Next
  43.     End Sub