Results 1 to 6 of 6
  1. #1

    Default C++ IRC Class v 1.1 - IRC bots made easy

    C++ IRC Library 1.1

    Hey guys, sorry about the screw up on the last version, but this one should be all fixed! (thanks to Montage's help)

    This version uses the C++ string class instead of C-style char arrays, so its more up to date.

    Info

    What this library does is make it a lot easier to connect to an IRC server in C++, just include the header files and the IRC class takes care of all the protocol and socket programming, and lets you take care of the bot itself.

    Here's an example of a simple IRC bot skeleton using this library:

    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;
    }
    All it does is idle in a channel until it receives the command, "!quit", and then it will send you a notice and close, quitting from the IRC server.

  2. #2
    Rank: Rookie
    • Join Date: Aug 2011
    • Posts: 2

    Default

    Cool , tnx bro

  3. #3

    Default

    np

  4. #4

    Default

    Can you help me to make IRC Bot?? I have my own HostBots?? We'd glad to see a nice programmer design and web administration statement

    Sincerely Regards,
    --
    DA-01
    http://i63.tinypic.com/2j3f8kw.jpg

  5. #5
    Rank: Apprentice
    • Join Date: Jul 2012
    • Posts: 69

    Default

    cool nice work
    ​★ RGC.Team

  6. #6
    Rank: Rookie
    • Join Date: Dec 2012
    • Posts: 1

    Default

    thx works

Posting Permissions

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