Raw IRC session with telnet

Any other programming language that is not covered in the Web Scripting category.

Raw IRC session with telnet

Postby Asbestos on Fri Jul 07, 2006 6:53 am

Understanding the following will be your first step to learning how an IRC bot connects to a server and then does what it's been programmed to do. (I'll be assuming you know how to use telnet, already)

For the purpose of this tutorial, we'll be setting up a raw IRC session with irc.anoxs.net on port 6667.

  • The first thing you'll see when you connect to irc.anoxs.net will be nothing. Generally, most IRC servers will issue some kind of indication that you've connected successfully which looks somewhat like this:

    :irc.server.net NOTICE AUTH :*** Checking ident...
    :irc.server.net NOTICE AUTH :*** No ident response; username prefixed with ~
    :irc.server.net NOTICE AUTH :*** Found your hostname
  • After you've connected, the server will then wait for a response from you. To save yourself from recieving a ping timeout you should now send a pong command to irc.anoxs.net. It will look like this:

    PONG irc.anoxs.net

    (Now would be a good time to copy that command and be ready to paste it every now and again to avoid a ping timeout)
  • Now you have to identify yourself by supplying a NICK and USER like so.

    NICK test
    USER test 8 * : this is a test for a tutorial

    These two are just telling the server what you'd like your nickname to be and some information about you, the user. In mIRC these fields are filled when input your email address and real name.

    (If you're told that you have not registered, you should probably send another pong and then try typing NICK and USER again)
  • Once you've completed this step you'll be greeted with the Message Of The Day. You can show this message again by simply typing MOTD at any time. (Please notice this is done without a forward slash).
  • Joining #phoenix is super easy:

    JOIN #phoenix
  • Sending a message to #phoenix is a little different....

    PRIVMSG #phoenix : Hi guys.
  • Sending a message to Tim is much the same as the above:

    PRIVMSG Tim : Hey Tim.

    I won't go on, but WHOIS, WHO, PING, KILL, KICK all work the same way as you'd expect them to, only without a forward slash.
  • By this stage you'll probably be missing your GUI and will want to leave:

    QUIT : brb
    or
    PART #phoenix

With all of this in mind and a basic understanding of PERL, you should now be ready to make your very own, simple, IRC bot.

NOTE: If you want to learn more about the IRC protocol, consult the RFC1459 or send me a PM- and I'll try to explain as best as I can.
Asbestos
Contributer
Contributer
 
Posts: 38
Joined: Mon May 22, 2006 1:43 am
Location: Brisbane, Australia

Postby Rommaster on Fri Jul 07, 2006 3:04 pm

This tutorial is nice! I'm going to sticky it, it can be useful for lots of users in this forum. Cool
SwiftIRC - irc.swiftirc.net - #phoenix
Phoenix-Network

(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(" )_(" ) signature to help him gain world domination.
Rommaster
Phoenix Veteran
Phoenix Veteran
 
Posts: 960
Joined: Thu Mar 10, 2005 1:05 pm
Location: The Netherlands

Postby crack0 on Sun Jul 16, 2006 8:21 am

Nice tutorial Asbestos, I'm glad you wrote it Smile
Remember happiness can be found even in the darkest of times who only remembers to turn on the light
crack0
Regular
Regular
 
Posts: 111
Joined: Sun Dec 18, 2005 7:48 pm
Location: serbia

Nice Information

Postby Shani on Thu Aug 24, 2006 5:34 am

Well this clears a lot of things for scripters and even newbie with the help of perl knowledge can made there own bot Smile very sticky and impressive
Hello all,
My name is Zeeshan Saeed Paracha , i m 21 years old and student of B.C.S Computers . My real intrest is networking speacially intranet works might i m able to help any one with my knowledge free of cost .
Shani
Contributer
Contributer
 
Posts: 27
Joined: Tue Aug 01, 2006 1:12 pm
Location: karachi, PAKISTAN

Postby Asbestos on Thu Aug 24, 2006 11:33 am

Thank you. Smile
Asbestos
Contributer
Contributer
 
Posts: 38
Joined: Mon May 22, 2006 1:43 am
Location: Brisbane, Australia

Postby zeeke on Tue Sep 05, 2006 7:15 am

It is really useful for newbies. Good work!
zeeke
Newbie
Newbie
 
Posts: 19
Joined: Tue Sep 05, 2006 6:31 am

Postby SmokeyMP on Tue Sep 12, 2006 9:17 pm

Cool! This will come in use, but for the most part learning about telnet.
SmokeyMP
Newbie
Newbie
 
Posts: 15
Joined: Tue Sep 12, 2006 9:00 pm

yes

Postby bondreal on Wed Sep 13, 2006 12:14 am

this is a very good tutorial
bondreal
Newbie
Newbie
 
Posts: 14
Joined: Tue Sep 12, 2006 11:49 pm

Postby Asbestos on Wed Dec 20, 2006 9:36 pm

I saw a story on digg yesterday which went through the details of making an IRC bot in Python from scratch.

Since it's relevant to this topic here's the link.
Asbestos
Contributer
Contributer
 
Posts: 38
Joined: Mon May 22, 2006 1:43 am
Location: Brisbane, Australia

Postby arn0ld on Sun Jan 07, 2007 1:23 pm

Uhm, just wanted to ask if how you can do a CTCP PING to a person? And how to reply when you're sent by a ping? Thanks in advance Wink
...in a sea of strangers where everybody is just a face, a person can stand out with a smile
May gina-admire ako galing nahuya ko magstorya sa iya nga face-to-face!!
arn0ld
Regular
Regular
 
Posts: 110
Joined: Fri Mar 31, 2006 7:09 pm
Location: Las Phelippinas

Postby De Kus on Mon Jan 08, 2007 2:33 pm

first you must know, that a CTCP is nothing else but a PRIVMSG.
A request begins with the ASCII Code "1". I am not sure, but I believe the replys start with something else. I have no time to lookup it now.
Image
User avatar
De Kus
Phoenix Veteran
Phoenix Veteran
 
Posts: 305
Joined: Mon Mar 14, 2005 2:15 pm
Location: Germany

Re: Raw IRC session with telnet

Postby Zanpakuto on Wed Jul 18, 2007 6:38 am

What about DCC chat?
Zanpakuto
Newbie
Newbie
 
Posts: 16
Joined: Fri Apr 13, 2007 10:58 pm

Re: Raw IRC session with telnet

Postby De Kus on Sun Jul 22, 2007 7:47 pm

is afaik a CTCP DCC <mode> <ip> <port>, while the ip is as integer.
For more details read: http://www.invlogic.com/irc/ctcp.html
Image
User avatar
De Kus
Phoenix Veteran
Phoenix Veteran
 
Posts: 305
Joined: Mon Mar 14, 2005 2:15 pm
Location: Germany

Re: Raw IRC session with telnet

Postby flippeh on Fri Oct 26, 2007 11:25 pm

Just a little bump.

If you send messages like this, they will appear to others like

<you>--fjdhfjdf
(replace the -- with 2 spaces - the forum strips it down to 1 space all the time)

2 spaces, wich is ugly

PRIVMSG <target> :<text>

for example

PRIVMSG FliPPeh :You suck :(

As with any other command using a colon :P
flippeh
Newbie
Newbie
 
Posts: 3
Joined: Sat Jun 23, 2007 11:05 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron