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
Heres an example irc bot skeleton using my irc class:
Here are the files:
IRC Class download:
IRC Class and an example Code::Blocks project using it:
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):
I hope you guys find this useful!
Please leave your opinions bellow
If you need any help also don't hesitate to ask.
Edit log:
This object class is very easy to use and takes care of all the socket programing so you dont have to
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:
IRC Class and an example Code::Blocks project using it:
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):
I hope you guys find this useful!
Please leave your opinions bellow
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