Does anyone have an IRC bot written in C++ that I could look at? I'm trying to make one but I'm not getting anywhere with it.
Thanks.
Does anyone have an IRC bot written in C++ that I could look at? I'm trying to make one but I'm not getting anywhere with it.
Thanks.
Well have you read this yet?
ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt
I'm assuming that you've reached the stage where you can send and receive network messages.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
That's the part I'm having trouble with. I could get the bot to start connecting but I can't seem to send anything to the server no matter what I try. I've read two tutorials so don't just paste a link to one please. I really learn better by looking at working examples. I couldn't find any code for simple bots on google though.I'm assuming that you've reached the stage where you can send and receive network messages.
All I need is code that connects and then maybe joins a channel or something. I think I could figure it out from there...
Oh, and yeah I've read some of ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt.
Try some of this as well then
http://cboard.cprogramming.com/showthread.php?t=41926
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I said no tutorials
I want some code, if you don't have any don't post.
>I want some code,
Then write some, and post it here when you have troubles. We'd like to help, but most people only do so when shown that you've attempted on your own first.
Also, our friend Google will undoubtably know where some source code is...
My recommendation: Break your problem down into bite-sized chunks, get each chuck working, and post it here when you can't.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
I just asked if someone knew where I could get a sample IRC bot. I didn't beg for one to be made for me. If no one knows about one, fine. And I said I tried google.
But I'm made some progress. It stops are pong though. Here is my code for it. It just stops, no response from the server, and no error until I get disconnected for a ping timeout.
Code:sprintf(msg,"PONG :%c%c%c%c%c%c%c%c%c%c", buf[i+6], buf[i+7], buf[i+8], buf[i+9], buf[i+10], buf[i+11], buf[i+12],buf[i+13],13,10); printf("\n\n--> %s",msg); if (send(sockfd, msg, strlen(msg) + 1, 0) == -1) { perror("send"); exit(1); }
Last edited by eam; 07-05-2004 at 09:44 PM.
Well that's because you should be sending a "PING"
You send a PING, the server at the other end sends a "PONG"
Oh, and get http://www.ethereal.com/
It will allow you to compare message trafffic your real IRC client generates, and the traffic your bot generates.
> I just asked if someone knew where I could get a sample IRC bot
Oh there's plenty of code - whether any of it is of the required simplicity is another matter.
Google "irc source code" for example.
A bot is simply a client without a user interface IMO
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
No, I'm replying to the server's PING with a PONG. I used putty and entered all the exact stuff my code does and I connected. It has to be a problem in code...
And you don't need to teach me how to use google. I know how. I searched for a long time before I even thought about posting here. Google didn't find what I needed, so I asked if anyone could show me where to get it. Telling me to go back to google does not help me...
Apparently you need not only a lesson on how to use google, but an attitude adjustment.
http://www.google.com/search?num=30&...va&btnG=Search
http://virtus.ath.cx/elendil/index.php?sec=dl
Well the usual thing to do when it "doesn't work" is to post something approaching a complete program which doesn't work so we can all see exactly what you are doing.
That is, after you've cut out as much irrelevant detail which has no bearing on the bit which doesn't work.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.