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; $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 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?#!/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.. } }
In reply to IRC bot in perl by Swordkeeper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |