I've been wanting to make some sort of IRC bot with C++ but haven't quite started. I saw that sockets were used to do it, but have no idea where to start D:
I know C++ isn't the best thing for IRC but it's the best language I know at the moment Very Happy.
I have always used cpIRC when I quickly wanted to make IRC bots. Smile
Well, you'll want a couple of levels:

- The lowest level will involve sockets. You'll use sockets to connect to an IRC server, get messages from higher levels and pass them to the server, and throw incoming messages up to higher levels
- The next level will be an IRC client. It will send the proper IRC commands down to the socket level to connect, it will receive the incoming IRC commands and decide if they're relevant
- The highest level will be your IRC bot. It will instruct the middle level to do things like connect or disconnect, join or leave channels, PM people or message channels, etc.
Ok KermM, now I get it a bit more Very Happy,
and AHelper, cpIRC is a library? Something I could use with Dev-C++ on my Vista?
(Also any "beginners" tutorials that I can read?)
It depends on what you actually want to learn. If you just want an IRC bot, I'd suggest using one of the billions of libraries out there to do it--and maybe even use this as an opportunity to learn a new language (Python, Java, and C# all have IRC libraries). If what you actually want is to learn network programming, start with some basic socket tutorials online and go from there. I have a simple chat program in C that you're free to dig around in. It has basic client-server communication, and the GUI is with curses, so it should be a pretty simple start. Incidentally I also have a client in C# that communicates with the same server. I can provide source for that if you're interested.

If you start right out the gate making an IRC bot, you'll probably get overwhelmed. Start by making some simple network programs based on your own protocols, and then start reading RFCs and doing their protocols, and then move to IRC. That's what I would do.

As for tutorials and all that, googling is your friend. However, Beej's Guide is a pretty standard guide, and this is a good unix socket FAQ.
hellninjas wrote:
and AHelper, cpIRC is a library? Something I could use with Dev-C++ on my Vista?


Assuming Dev-c++ is an ide, yes, this library works on *nix and windows. It consists of one source file and one header.
I have Dev-C++ installed on my computer, but word on the street is that it was a bad, maintained IDE five years ago, and a bad, unmaintained IDE today. I would probably recommend getting Visual Studio Express, which is free.
The boost library is very good for network programming as well.
lafferjm wrote:
The boost library is very good for network programming as well.
Boost is good for a lot of things, from threading to networking to hashtables. Smile
KermMartian wrote:
I have Dev-C++ installed on my computer, but word on the street is that it was a bad, maintained IDE five years ago, and a bad, unmaintained IDE today. I would probably recommend getting Visual Studio Express, which is free.


No, it was a decent IDE when it was still maintained 7 years ago. Now it is a mediocre IDE with a horrible outdated compiler - which is why it should be avoided. That's the real problem with Dev-C++ - the compiler from 7 years ago. It's still using GCC 3.4.2 after all.

There are plenty of maintained IDEs these days - such as Visual Studio Express. So why bother with something from 7 years ago? Especially since the GCC/MingW combo sucks pretty bad on Windows - the only good Windows compilers are Microsoft's and Intel's.
TCC is a great compiler, especially if you're doing command-line stuff. The only problem is, it only compiles C (which I like a lot better than C++, so whatever). As for libraries and stuff, I've only ever used WinSock :3
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement