use Irssi;

use vars qw($VERSION %IRSSI);

$VERSION = "1.0";
%IRSSI = (
    author => 'pleia2',
    contact => 'lyz@princessleia.com ',
    name => 'systeminfo',
    description => 'Grabs certain information from the system the bot is on, and returns it.',
    license => 'GNU GPL v2 or later',
    url => 'http://www.princessleia.com'
);

sub event_privmsg {
my ($server, $data, $nick, $mask) =@_;
my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
    	return if ( $text !~ /^!day$|^!date$|^!time$|^!uptime$/i );
        if ( $text =~ /^!day$/i ) {
        my $day = (`date +\%j`);
        $server->command ( "msg $target Day of the year : $day" );
	}
        elsif ($text =~ /^!date$/i ) {
        my $date = (`date`);
        $server->command ( "msg $target The Date Is $date" );
	}       
        elsif ($text =~ /^!time$/ ) {
        my $time = (`date +\%r`); 
        $server->command ( "msg $target The Time Is $time" )
	}       
        elsif ($text =~ /^!uptime$/ ) {
        my $uptime = (`uptime`);
        $server->command ( "msg $target $uptime" )
	}
}

Irssi::signal_add('event privmsg', 'event_privmsg');
