7 Replies - 6409 Views - Last Post: 12 July 2008 - 02:44 PM Rate Topic: -----

#1 k0b13r  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 15
  • View blog
  • Posts: 243
  • Joined: 18-July 06

IRC bot

Posted 13 February 2008 - 05:36 PM

I wanted to write a little IRC bot in Python. I started with socket, connection etc. and then I've send NICK and USER commands to server, but in answer I get: "No ident response". I was looking around on google for some info, but I've found nothing :/ Even RFC 1413 (Identification Protocol) gave me no help :/ Maybe someone got some experience with this and could help ? Thanks for answers

Is This A Good Question/Topic? 0
  • +

Replies To: IRC bot

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4354
  • View blog
  • Posts: 12,160
  • Joined: 18-April 07

Re: IRC bot

Posted 13 February 2008 - 05:48 PM

No problem, my scripting crew covered this topic awhile ago back in 2000. It still relevant. We mimic identd using sockets through a mIRC script, but you can do it through any language.

The process is relatively straight forward. The server sends you a message on port 113 (typical identd server for chat networks). So setup a socket listening on this port. It sends you two port numbers. You then have to respond by reversing the port numbers, specify a Response Type, System, and Identity as well.

So for example the server sends you 1234, 6667 and you will respond with 6667 , 1234 : USERID : UNIX : nickname. For compatibility across most networks, keep the nickname to 10 or less characters. Not all servers support long nicknames.

Notice in our response that the ports are reversed, we have specified a user id of UNIX and then a nickname we wish to ident with.

Good luck! :)
Was This Post Helpful? 1

#3 k0b13r  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 15
  • View blog
  • Posts: 243
  • Joined: 18-July 06

Re: IRC bot

Posted 14 February 2008 - 07:38 AM

Yay, thanks. But I have an other problem :/ How to get Ident that server send ?
s.recv(1024)


("s" is opened connection with IRC server)
is ain't working this way ... any advice?
I was thinking about connecting on port 113 to server, but I get "Connection refused" ...

This post has been edited by k0b13r: 14 February 2008 - 07:45 AM

Was This Post Helpful? 0
  • +
  • -

#4 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4354
  • View blog
  • Posts: 12,160
  • Joined: 18-April 07

Re: IRC bot

Posted 14 February 2008 - 10:49 PM

No, you have to listen on port 113 on your own machine. The server will contact you. Accept the request and the first line it should spit out at you is the port numbers. Then you must respond with the response I gave you. It will not accept requests from clients on 113.

:)
Was This Post Helpful? 0
  • +
  • -

#5 k0b13r  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 15
  • View blog
  • Posts: 243
  • Joined: 18-July 06

Re: IRC bot

Posted 15 February 2008 - 09:57 AM

Thnx again ! I'll try this ASAP ^^
Was This Post Helpful? 0
  • +
  • -

#6 k0b13r  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 15
  • View blog
  • Posts: 243
  • Joined: 18-July 06

Re: IRC bot

Posted 15 February 2008 - 06:37 PM

Haha :D It's working, it's working ! :D Thanks a lot :D

This post has been edited by k0b13r: 15 February 2008 - 06:44 PM

Was This Post Helpful? 0
  • +
  • -

#7 supra  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 12-July 08

Re: IRC bot

Posted 12 July 2008 - 08:26 AM

View Postk0b13r, on 15 Feb, 2008 - 06:37 PM, said:

Haha :D It's working, it's working ! :D Thanks a lot :D


Hi
how do u send to server?
Was This Post Helpful? 0
  • +
  • -

#8 ibbie  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 19
  • Joined: 07-July 08

Re: IRC bot

Posted 12 July 2008 - 02:44 PM

While I can totally understand writing it from the ground up with socket to learn, if you have plans of making a large project of the bot, you might also consider checking out the twisted framework. There's an example bot written with it here.

For that matter, if you get stumped during implementation, you can also get some hints by looking at the source code for Supybot.

Anyway, good luck. :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1