Results 1 to 4 of 4

Thread: Chat w/ IRC

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Location
    Texas
    Posts
    27

    Question

    How can I connect to an IRC server and chat. Basically I want to make an IRC program, but with REALLY limited features, can someone describe this process to me?
    Software for the next century...

  2. #2
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    First of all, you'll need to make a server for the client to connect to(not hard if you use WinSock).
    Then you can send messages to the server, which will be displayed on the client programs.
    It is difficult to make a server that accepts more that one connection, but I you know WinSock, this will be an easy task!

    Good luck!
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  3. #3
    Hyperactive Member wasiq's Avatar
    Join Date
    Jan 2000
    Location
    Karachi, Sindh, Pakistan
    Posts
    274
    check out the attachment
    Attached Files Attached Files

  4. #4
    Addicted Member Quintonir's Avatar
    Join Date
    Mar 2001
    Location
    The Netherlands
    Posts
    155

    Post Your take-off

    I'll give you something to start, very simple examples and stuff.

    Get a new Project, place a Winsock Control (TCP) on it, and a TextBox (txtDisplay). Make the txtDisplay big, get MultiLine to True.

    First thing, I'd like to make two Subs before we begin, so I don't have to type that much

    ----------------
    Sub Send(Msg)

    TCP.SendData Msg & vbNewLine

    End Sub
    ----------------

    ----------------
    Sub Say(Text)

    txtDisplay = txtDisplay & Text & vbNewLine

    End Sub
    ----------------

    We have to connect to the server first.

    -------------------
    Private Sub Form_Load()

    txtDisplay = ""

    If TCP.State <> sckClosed Then TCP.Close

    TCP.RemoteHost = "irc.msn.com"
    TCP.RemotePort = 6667
    TCP.Connect

    End Sub
    -------------------

    There! (I assume you know the basics on the Winsock Control, otherwise just ask! You can find it rightclicking on your control tab on the left, selecting "Components" --> "Microsoft Winsock Control <ver.>".) We are connecting now.

    As you probably expect, we must verify on the Connect Event. The server needs to know our nickname and user information.

    --------------------
    Private Sub TCP_Connect()

    Say ">> Connected! Sending Data ..."
    Send "NICK MyVBNickname01"
    Send "USER [email protected] " _
    & TCP.LocalIP & "irc.msn.com :VBIRC-Test"
    End Sub
    --------------------

    Information sent! You're connected! The server probably sends his MOTD (Message Of The Day) and you're ready to go! I'll give you something simple to put every received string in the TextBox, and I think you can make some coding yourself on responding to the strings received (such as nick-changing, parts, joins, whatever).

    --------------------
    Private Sub TCP_DataArrival

    Dim InMSG

    TCP.GetData InMSG

    Say "Data Received:" & vbNewLine & "---" & vbNewLine & InMSG _
    & vbnewline & "---"

    ' >> Replace it by some codes to respond, and
    ' >> communicate with the server!!

    End Sub
    --------------------

    That's all there is to it, if you ask me! Some strings you could send at last:

    Join a room: Send "JOIN #VisualBasic"
    Part a room: Send "PART #VisualBasic"
    Change nick: Send "NICK MyNewNick"
    Op someone: Send "MODE #VB +o MyLittleFriend"

    These are some basic commands!

    Hope this will help you with your problem,


    Quintonir

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width