c++ irc bot not working

im writing an irc bot in c++ on linux mint, and its not connecting right for some reason. anyways, heres the link: http://pastebin.com/mHrn8iLQ . it was connecting to quakenet before i added the functions, but now it just says connecting... and then quits.
(this->Status != sf::Socket::Done) ? false : true;
This line makes me dizzy O_O
Using the ternary operator is redundant, you could just return this->Status == sf::Socket::Done to the same effect.
Does the socket connect asynchronously? I ask because you may need to wait for the connection to connect instead of checking once immediately after.
Using the ternary operator is redundant


Not it's not. It is frowned upon in some companies i've worked for, but it's certainly not redundant.
@lachlon easton: thank you i forget i can do that. also, i think your right. i made it nonblocking which ive never done before. thats probably why
@mutexe I mean in this particular case. I use it quite often but never to flip a Boolean. (redundant =/= deprecated)
Last edited on
that was the issue. i made it nonblocking and forgot. new problem, when i tried to print what was in the buffer (which contains the responses from quakenet) its printing nonsense
Define nonsense. Are you getting the channel user list and such with every comment in the channel?

If it is what I think it is, you have to write a parser that reads everything and only prints out the things you want.
Last edited on
@mutexe I mean in this particular case. I use it quite often but never to flip a Boolean. (redundant =/= deprecated)

i'm sorry for misinterpreting what you wrote :)
@mutexe sorry for being ambiguous :P
sorry for the late reply. i was on my windows machine so i couldnt run the code. anyways, this is the output im getting: http://imgur.com/SVSZXeN
Wow, that is a different nonsense than what I was expecting. When I did my bot I never had that problem. My problem was that I was getting the user list for the channel (can't remember if it was before or after) every message.
anyone know how to fix it then?
never mind i figured it out. (wasnt allocating response correctly)
Topic archived. No new replies allowed.