Jump to content

[RESOLVIDO]IRC bot


JD557

Recommended Posts

Boas pessoal.

Estou a tentar fazer um IRC bot com C++ e SDL_net, mas por alguma razão ele não entra na sala.  ?

Segundo o meu debug, os inputs e outputs são estes:

output:NICK JDbot _JDbot_

input:NOTICE JDbot :*** If you are having problems connecting due to ping timeouts, please type /notice 3B9CC0F nosproof now.

PING :3B9CC0F

:world.PTnet.org NOTICE JDbot :*** If you need assistance with connecting to this server, world.PTnet.org, please refer to: http://www.PTnet.org/

output:PONG :3B9CC0F

output:USER JDbot hostname servername :JDbot

output:JOIN #JDtesting

No fim de cada mensagem enviada coloco sempre "\r\n".

No entanto o bot  nunca chega a entrar na sala.  😄

Estive a ver o código de outros bots e acho que é semelhante a este... O que será que estou a fazer de mal?  🙂

Tenho uma socket aberta em irc.ptnet.org:6667 e outra em localhost:22, no entanto não chego a usar a do local host (ouvi dizer num sitio qualquer que era necesário abrir... mas como ainda estou às cabeçadas com isto nem sei o que tenho nem o que não tenho de fazer :wallbash:)

MIEIC @ FEUP

http://project557.blogspot.com/ --- Development Blog

Proteja a sua pen: http://lastknight.pt.vu

Link to comment
Share on other sites

input:NOTICE JDbot :*** If you are having problems connecting due to ping timeouts, please type /notice 3B9CC0F nosproof now.

PING :3B9CC0F

:world.PTnet.org NOTICE JDbot :*** If you need assistance with connecting to this server, world.PTnet.org, please refer to: http://www.PTnet.org/

output:PONG :3B9CC0F

Ora aí está, eu acho que estou a enviar o valor direito 😛

Mas dali a uns minutos recebo uma mensagem de erro a dizer que o ping foi mal enviado ou uma coisa do género...

Bem, depois tenho de ver isso...

EDIT: Problema resolvido, estava a enviar um byte a mais em cada pacote, por isso tudo o que enviava a seguir ao primeiro pacote era inválido 🙂

MIEIC @ FEUP

http://project557.blogspot.com/ --- Development Blog

Proteja a sua pen: http://lastknight.pt.vu

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.