Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IRC Class Libaray 1.1 - C++ IRC bots made easy
#1
Hey guys, here's my C++ IRC class library, it now had even more IRC protocol managing functions that the last version, and it uses C++ strings instead of C-style character arrays.

This object class is very easy to use and takes care of all the socket programing so you dont have to Oui

Heres an example irc bot skeleton using my irc class:

Code:
/*  Example of IRC class usage
    Coded by delme
*/

#include "irc.cpp"

int main() {
    //set options here
    string IRCServer = "irc.swiftirc.net";
    int IRCPort = 6667;
    string Nick = "BotNick";
    string Channel = "#bot-test";

    string sBuffer;
    int i;

    IRC irc;
    if (irc.Connect(IRCServer,IRCPort) != IRC_CONNECT_SUCESS) {
        return 0;
    }
    irc.Register(Nick);
    irc.Join(Channel);

    while(1) {
        sBuffer = irc.RecvData();
        if (irc.GetLastError()!=IRC_RECIEVE_ERROR) {
            i = irc.ParseData(sBuffer);
            if (i==IRC_PRIVMSG) {
                //privmsg
                if (irc.s_privmsg.Message=="!quit") {
                    irc.Notice("Quitting...",irc.s_privmsg.User);
                    break;
                }
            }
        } else {
            break;
        }
    }
    irc.Quit();
    return 0;
}

Here are the files:

IRC Class download:
[Image: logo.gif]

IRC Class and an example Code::Blocks project using it:
[Image: logo.gif]

A help file containing info on all functions/data structures/and implementations inside the class (please read this before asking me any questions concerning the usage of this class):
[Image: logo.gif]

I hope you guys find this useful!

Please leave your opinions bellow Oui

If you need any help also don't hesitate to ask.

Edit log:
Code:
[24/05/10] Edited the class a bit, added an example project and added a help file - updated post
[26/05/10] Updated to version 1.1 - all errors fixed and lots more functions added
Reply


Messages In This Thread
IRC Class Libaray 1.1 - C++ IRC bots made easy - by delme - 05-22-2010, 09:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  C IRC bot skeleton Psycho 16 12,021 11-09-2011, 08:23 PM
Last Post: Hex
  [C++] IRC Bot. wchar_t 25 15,469 06-05-2011, 12:30 AM
Last Post: USN

Forum Jump:


Users browsing this thread: 2 Guest(s)