User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion

Reply
Thread Tools Display Modes
Unread 5 Mar 2003, 16:35   #1
King Elessar
Guest
 
Posts: n/a
Need a PERL irc socket connection

I'm looking to create an IRC bot in PERL. And I know nothing about socket programming with PERL.

Would someone please give me a small, commented example script of connecting to an IRC server as well as sending and reciving data?

Thank you very much,
King Elessar
  Reply With Quote
Unread 5 Mar 2003, 17:06   #2
xtothez
ŻŻŻŻŻŻŻŻŻ
 
xtothez's Avatar
 
Join Date: May 2001
Location: Sept 2057
Posts: 1,813
xtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud of
I dont do much perl myself, but I can sort out a php bot to do the same job if thats any use to you.
__________________
in my sig i write down all my previous co-ords and alliance positions as if they matter because I'm not important enough to be remembered by nickname alone.
xtothez is offline   Reply With Quote
Unread 5 Mar 2003, 17:07   #3
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
POE::Component::IRC is the best way to do Perl IRC bots, see http://poe.perl.org/?POE_Cookbook/IRC_Bots

If you really must use TCP sockets, google gives http://b0iler.eyeonsecurity.org/tuto...ircperlbot.htm
queball is offline   Reply With Quote
Unread 5 Mar 2003, 21:02   #4
King Elessar
Guest
 
Posts: n/a
Quote:
Originally posted by xtothez
I dont do much perl myself, but I can sort out a php bot to do the same job if thats any use to you.
No thanks, I'd like to mostly do this myself

King Elessar
  Reply With Quote
Unread 5 Mar 2003, 21:04   #5
xtothez
ŻŻŻŻŻŻŻŻŻ
 
xtothez's Avatar
 
Join Date: May 2001
Location: Sept 2057
Posts: 1,813
xtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud of
Quote:
Originally posted by King Elessar
No thanks, I'd like to mostly do this myself

King Elessar
I meant a client with the description you provided, I'm not writing a full bot for you : )
__________________
in my sig i write down all my previous co-ords and alliance positions as if they matter because I'm not important enough to be remembered by nickname alone.
xtothez is offline   Reply With Quote
Unread 5 Mar 2003, 23:49   #6
King Elessar
Guest
 
Posts: n/a
Quote:
Originally posted by xtothez
I meant a client with the description you provided, I'm not writing a full bot for you : )
I see... Well, again, thanks anyway, I've done that before, but I don't really know enough PHP to do all the stuff I want to do :P

King Elessar
  Reply With Quote
Unread 6 Mar 2003, 00:30   #7
MT
/dev/zero
Retired Mod
 
MT's Avatar
 
Join Date: May 2000
Posts: 415
MT is an unknown quantity at this point
Not IRC, but an example fo how to use sockets in perl..

Code:
#!/usr/bin/perl
use IO::Socket;
$data = "GET / HTTP/1.0\r\n\r\n";
my $sock = new IO::Socket::INET (
                  PeerAddr => 'www.planetarion.com',
                  PeerPort => '80',
                  Proto => 'tcp',
            );
die "Could not create socket: $!\n" unless $sock;
print $sock "$data";
while (<$sock>) {
  print;
}
close($sock);
__________________
#linux : Home of Genius

<idimmu> ok i was chained to a desk with this oriental dude
MT is offline   Reply With Quote
Unread 6 Mar 2003, 10:32   #8
Slidey
Registered User
 
Join Date: Mar 2001
Posts: 205
Slidey is an unknown quantity at this point
Quote:
Originally posted by King Elessar
I see... Well, again, thanks anyway, I've done that before, but I don't really know enough PHP to do all the stuff I want to do :P

King Elessar
so you know all the perl you need to know to do all you want to do..?
__________________
#linux - home of idiots

#impulsed - home of genius..?
Slidey is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Forum Jump


All times are GMT +1. The time now is 21:40.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright İ2002 - 2018