All pastes #1023412 Raw Edit

Untitled

public text v1 · immutable
#1023412 ·published 2008-05-20 02:11 UTC
rendered paste body
Private Sub Form_Load()

 If ws.State = 7 Then ws.Close

  Dim rhost As String, rport As Integer, rchan As String

ws.RemoteHost = "irc.rawnet.com"
ws.RemotePort = "6667"
ws.Connect

End Sub


Private Sub ws_Connect()

 Dim UserName As String, RealName As String, Nick As String
 
  Nick = "RawNet_Bot"
  UserName = Nick
  RealName = Nick
    
    ws.SendData "USER " & UserName & " 0 * " & RealName & vbCrLf
    ws.SendData "NICK " & Nick & vbCrLf
    ws.SendData "JOIN " & "#BotTest" & vbCrLf
    
End Sub

Private Sub DataArrival(ByVal bytestotal As Long)

    Dim Data As String

    ws.GetData Data
    Debug.Print Data
    
    DoEvents
    
    If InStr(Data, "PING") <> 0 Then ws.SendData Replace(Data, "PING", "PONG") & vbCrLf

End Sub

Private Sub Command1_Click()
ws.Close
End Sub