I was thinking about this, a friend did this code, and it works... just cant get on a chan 'yet'
#!/usr/bin/perl use IO::Socket; $s = IO::Socket::INET->new(Proto=>'tcp',PeerAddr=> 'irc.cyberarmy.com' +,PeerPort=> 6667); print $s "NICK b0t\nUSER b0t - - :b0t\n"; while($s) { my ($i,$j)= split/ /, $_ = <$s>; print; if ($_ eq 'PING') +{ print $s 'PONG '.$j;} }
I was thinking of doing it this way, to have it idle on a chan..here is my version
#!/usr/bin/perl use IO::Socket; #IO through sockets..;) $s = IO::Socket::INET->new(Proto=>'tcp',PeerAddr=> 'irc.dal.net',PeerP +ort=> 6667); #set up the server and info for the bot. print $s "NICK WhiteRav3n0wnz\nUSER b0t - - :b0t\n"; #Bot info to server. print $s "JOIN #hackerhost\n"; #Chan to enter. while($s){ #main bot loop my ($i,$j)= split/ /, $_ = <$s>; #split incomming text print; if ($_ eq 'PING') { #if you get a ping from the server, print $s 'PONG '.$j; #pong back.. } }
I havent had the time to really get into this, but it should work, based on what I can see from the IRC rfc (rfc 1459 if your interested), and would be interesting, since you could then run it from a server such as a free webhost that let you do cgi.. great in times nickserv or chanserv is offline, if it was alreaady idling with ops - then no-one could take over the chan from lack of chanserv or nickserv if no one was there.. has anybody has a simaler idea? I searched for something like this on perl monks, but I didnt find anything.. anybody got some ideas?

In reply to IRC bot in perl by Swordkeeper

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.