Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

irc parser in c

Name: Anonymous 2011-06-18 19:24

I've been writting an irc bot in c but I'm stuck trying to parse the irc buffer into an array.

here's my connecting function:


void connecting(int sockfd)
{
        char buf[MAX], temp[MAX];

        while(1)
        {
                recv(sockfd, buf, sizeof(buf), 0);

                printf("%s", buf);

                if (strstr(buf, "Checking Ident") != NULL)
                {
                        sprintf(temp, "USER something something something :something\r\n");
                        send(sockfd, temp, strlen(temp), 0);

                        sprintf(temp, "NICK %s\r\n", NICK);
                        send(sockfd, temp, strlen(temp), 0);

                        sprintf(temp, "JOIN %s\r\n", CHAN);
                        send(sockfd, temp, strlen(temp), 0);
}

                if (strstr(buf, ":!hi"))
                {
                        sprintf(temp, "PRIVMSG %s :Hi bitch\r\n", CHAN);
                        send(sockfd, temp, strlen(temp), 0);
                }


Could somebody write a parse for me or help me out?

Name: Anonymous 2011-06-20 2:40


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List