Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,487 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,712 people online right now. Registration is fast and FREE... Join Now!




IRC bot

 
Reply to this topicStart new topic

IRC bot

k0b13r
13 Feb, 2008 - 04:36 PM
Post #1

D.I.C Head
Group Icon

Joined: 18 Jul, 2006
Posts: 196



Thanked: 1 times
Dream Kudos: 250
My Contributions
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 confused.gif Even RFC 1413 (Identification Protocol) gave me no help confused.gif Maybe someone got some experience with this and could help ? Thanks for answers
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: IRC Bot
13 Feb, 2008 - 04:48 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,212



Thanked: 216 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
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! smile.gif
User is online!Profile CardPM
+Quote Post

k0b13r
RE: IRC Bot
14 Feb, 2008 - 06:38 AM
Post #3

D.I.C Head
Group Icon

Joined: 18 Jul, 2006
Posts: 196



Thanked: 1 times
Dream Kudos: 250
My Contributions
Yay, thanks. But I have an other problem confused.gif How to get Ident that server send ?
CODE

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 Feb, 2008 - 06:45 AM
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: IRC Bot
14 Feb, 2008 - 09:49 PM
Post #4

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,212



Thanked: 216 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
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.

smile.gif
User is online!Profile CardPM
+Quote Post

k0b13r
RE: IRC Bot
15 Feb, 2008 - 08:57 AM
Post #5

D.I.C Head
Group Icon

Joined: 18 Jul, 2006
Posts: 196



Thanked: 1 times
Dream Kudos: 250
My Contributions
Thnx again ! I'll try this ASAP ^^
User is offlineProfile CardPM
+Quote Post

k0b13r
RE: IRC Bot
15 Feb, 2008 - 05:37 PM
Post #6

D.I.C Head
Group Icon

Joined: 18 Jul, 2006
Posts: 196



Thanked: 1 times
Dream Kudos: 250
My Contributions
Haha biggrin.gif It's working, it's working ! biggrin.gif Thanks a lot biggrin.gif

This post has been edited by k0b13r: 15 Feb, 2008 - 05:44 PM
User is offlineProfile CardPM
+Quote Post

supra
RE: IRC Bot
12 Jul, 2008 - 07:26 AM
Post #7

New D.I.C Head
*

Joined: 12 Jul, 2008
Posts: 1

QUOTE(k0b13r @ 15 Feb, 2008 - 06:37 PM) *

Haha biggrin.gif It's working, it's working ! biggrin.gif Thanks a lot biggrin.gif


Hi
how do u send to server?

User is offlineProfile CardPM
+Quote Post

ibbie
RE: IRC Bot
12 Jul, 2008 - 01:44 PM
Post #8

New D.I.C Head
Group Icon

Joined: 7 Jul, 2008
Posts: 8


Dream Kudos: 75
My Contributions
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. biggrin.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 07:28PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month