Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4273474
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:43:05+00:00 2026-05-21T07:43:05+00:00

I’m making a simple IRC client for myself because I really don’t see the

  • 0

I’m making a simple IRC client for myself because I really don’t see the need for a lot of mIRC’s functionality, but I’m having problems cleaning up the input from the server.

Right now, on connect, I’m getting the following:

[16:37] :young.home.net NOTICE AUTH :** Looking up your hostname…
:young.home.net NOTICE AUTH :** Found your hostname
PING :DE7AED31
[16:37] :DE7AED31!nospoof@young.home.net PRIVMSG Logan :VERSION
:young.home.net 451 PING :You have not registered
[16:37] :young.home.net 001 Logan :Welcome to the YoungNet IRC Network Logan!lyoung@127.0.0.1
:young.home.net 002 Logan :Your host is young.home.net, running version Unreal3.2.8.1
:young.home.net 003 Logan :This server was created Sun Apr 12 14:47:33 2009

I’m trying to clean it up to read like this:

[16:37] -young.home.net- ** Looking up your hostname…
[16:37] -young.home.net- ** Found your hostname
[16:37] [Logan] VERSION
[16:37] You have not registered
Welcome to the YoungNet IRC Network Logan!lyoung@127.0.0.1
Your host is young.home.net, running version Unreal3.2.8.1
This server was created Sun Apr 12 14:47:33 2009

I’ve read the IRCP (RFC 1459) and I understand the formatting of the server input, but I can’t seem to strip out the unwanted stuff… A friend suggested loading the input into an array and deal with each item individually, but I can’t seem to make it work. I have tried, but it doesn’t seem to make a difference… Here’s my code

Public Function recv() As String
    Dim mail As String
    Try
        Dim Data(4096) As Byte
        sock.Receive(Data, 4096, Net.Sockets.SocketFlags.None)
        mail = System.Text.ASCIIEncoding.UTF8.GetString(Data)
        If mail.Contains(" ") Then
            If mail.Contains("PING") Then
                Dim pserv As String = mail.Substring(mail.IndexOf(":"), mail.Length - mail.IndexOf(":"))
                pserv = pserv.TrimEnd(Chr(0))
                'MsgBox("pserv: " & pserv)
                send("PONG " & pserv)
            ElseIf mail.Substring(mail.IndexOf(" ") + 1, 7) = "PRIVMSG" Then
                Dim tmparr() As String = Nothing
                Dim rnick, rmsg As String
                mail = mail.Remove(0, 1)
                tmparr = mail.Split("!")
                rnick = tmparr(0)
                tmparr = mail.Split(":")
                rmsg = tmparr(1)
                mail = "<" & rnick & "> " & rmsg
            ElseIf mail.Substring(mail.IndexOf(" ") + 1, 6) = "NOTICE" Then
                Dim tmparr() As String = Nothing
                Dim rnick, rmsg As String
                mail = mail.Remove(0, 1)
                tmparr = mail.Split("!")
                rnick = tmparr(0)
                tmparr = mail.Split(":")
                rmsg = tmparr(1)
                mail = "-" & rnick & "- " & rmsg
            Else
                Dim tmparr() As String = Nothing
                Dim rnick, rmsg As String
                tmparr = mail.Split(" ")
                rnick = tmparr(0)
                tmparr = mail.Split(":")
                rmsg = tmparr(1)
                mail = rmsg
            End If
        End If

        mail = g.Timestamp & mail

    Catch ex As Exception
        MsgBox(ex.ToString)
        mail = "ERROR: " & ex.Message & vbCrLf
    End Try
    Return mail
End Function

Any pointers here would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:43:05+00:00Added an answer on May 21, 2026 at 7:43 am

    OK, I got so busy after I found the solution here that I completely forgot about stackoverflow…

    [http://www.mirc.net/raws/][1]

    [1]: http://www.mirc.net/raws/ contains a list of raw numeric codes that neatly categorize the server output to the client app.

    There’s a few splits to get through before you can use the raw numerics, however. See below:

    ' This function takes the raw input from the server as a parameter.
    ' NOTE: No modification has been done before this point.
    
    Private Function Clean(ByVal Target As String) As String
        ' Get each line
        Dim temp() As String = Target.Split(vbCrLf)
        Dim back As String = Nothing
    
        ' For each line in the current string
        For i As Integer = 0 To temp.Length - 1
            ' Split the line 
            Dim result() As String = temp(i).Split(New String() {" :"}, StringSplitOptions.None)
            Dim j As Integer = Nothing
            Try
                ' NOTICE AUTH messages aren't covered in raw format, so this cleans those up
                If result(0).Contains("NOTICE AUTH") Then
                    If Left(result(0), 1) <> ":" Then
                        ' g.Timestamp = "[" & Now.Hour & ":" & Now.Minute & "]"
                        back += g.Timestamp & " (" & result(0).Substring(2, result(0).IndexOf(" ") - 2) & ") " & result(1) & vbCrLf
                    Else
                        back += g.Timestamp & " (" & result(0).Substring(1, result(0).IndexOf(" ") - 1) & ") " & result(1) & vbCrLf
                        g.host = result(0).Substring(1, result(0).IndexOf(" ") - 1)
                    End If
                End If
    
                If Integer.TryParse(result(0).Substring(result(0).IndexOf(" ") + 1, 3), j) Then
                    Select Case result(0).Substring(result(0).IndexOf(" ") + 1, 3)
                        ' For each code, modify the input here, this is just an example of what I've done...
                        Case "001" : back += ":=:" & vbCrLf & g.Timestamp & result(1) & vbCrLf
                    End Select
                End If
            Catch ex As Exception
    
            End Try
        Next
    
        ' More stuff goes here (handling PING? PONG! events and such)
    
        Return back
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm making a simple page using Google Maps API 3. My first. One marker
I need to clean up various Word 'smart' characters in user input, including but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.