Hi can you look at this code and see if you can see where i went
Iv created a new project with a txtbox name txtlog and a winstock component called wskIrc
Can you see where i have went wrong, Im meant to get a log of if it has connected and im not getting anything? any ideas?
Code:Public Function addLog(ByVal Message As String) txtLog.Text = "[" & "]: " & Message & vbCrLf End Function Private Sub Form_Load() wskIrc.RemoteIP = "irc.bluehell.org" wskIrc.RemotePort = 6668 addLog("Connecting to " & wskIrc.RemoteIP & " port " & wskIrc.RemotePort & "...") wskIRC.Connect() End Sub Private Sub wskIRC_Connect() addLog("Connected!") Dim Name As String Dim Random As Integer Dim Channel As String Randomize() Random = Rnd * 1000 Name = "[nice]-" & Random addLog("Username: " & Name) wskIrc.Send("NICK " & Name & vbCrLf) wskIrc.Send("USER interesting" & vbCrLf) Channel = "#dhf" wskIrc.Send("JOIN " & Channel & vbCrLf) End Sub Private Sub wskIRC_DataArrival(ByVal bytesTotal As Long) Dim Data As String wskIRC.GetData(Data) addLog(Data) Dim ircCommand As String If InStr(Data, ":!") Then ircCommand = Split(Data, ":!")(1) addLog("Command: " & ircCommand) End If If InStr(Data, "PING") Then wskIrc.Send(Replace(Data, "PING", "PONG") & vbCrLf) addLog(Replace(Data, "PING", "PONG")) End If If InStr(ircCommand, "test") Then MsgBox("it works") End If End Sub




Reply With Quote