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
#2
Updated the main post, added a help file and an example Code::Blocks project.
Reply
#3
Awesome man, thanks for the good share appreciate it.
Reply
#4
(05-24-2010, 01:02 AM)† KaLaShNiKoV † Wrote: Awesome man, thanks for the good share appreciate it.

No problem Smile
Reply
#5
It has been pointed out to me that there is a possibility of a stack overflow in this library (my bad Big Grin) if you have already downloaded this library please discontinue use until I have it fixed, hopefuly today or tomorow.

Sorry guys :S
Reply
#6
Bump, fixed all errors and released version 1.1, read the help file for any info on the new functions and new way of using the class.
Reply
#7
I like this Class, it's a bit buggy though, when will the next one be released? Smile
Reply
#8
(06-09-2010, 09:33 AM)TomC Wrote: I like this Class, it's a bit buggy though, when will the next one be released? Smile

There is a new one in progress, I should have finished it soon, I have homework and stuff at the moment though, I just need some help with using getaddrinfo() as gethostbyname has been depreciated and declaring strings inside a class, instead of globaly. If anyone can offer any ideas?
Reply
#9
Hi,

how many time do you need for the new version?

I want this use in my programm, that i develop in this days.

Thank you
Reply
#10
Very nice share mate, i'll add this to my collection. It may come useful later Smile
That's really weird,Ninja
Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)