use strict; use vars qw($NAME $VERSION %IRSSI); use Irssi qw(command_bind signal_add_first); $VERSION = "1.03"; %IRSSI = ( authors => "Stuart Freeman", contact => "stuart\@tyro.homelinux.com", name => "greet", description => "Greets your friends with a message from a file named after them.", license => "GPL" ); sub greet ($server, $channel, $nick, $address) { my ($server, $channel, $nick, $address) = @_; $address =~ s/\~(.*)\@.*/$1/; my $filename = glob( "~/.quotes/$address"); if (-r $filename) { my @quote=split(/\n/,`/usr/games/fortune $filename`); foreach my $quote (@quote) { $server->command('msg '.$channel.' '.$nick.'> '.$quote); } } } signal_add_first 'message join' => 'greet';