Script Help

Ivan Panarusky <[email protected]> Sun, 4 Jul 2010 23:33:35 -0400
Newsgroups gmane.network.irc.irssi.user
Message-ID <[email protected]>
I'm trying to write a script so that when a message is sent to a
certain that contains "thetime", I will automatically reply with "!msg
11:27:04 4-7-2010".

Here is what I have already

sub time_printer {
($sec,$min,$hour,$mday,$mon,$year,$wday, $yday,$isdst)=localtime(time);
if ($hour>12) {$hour-=12;}
$thetime = "!msg ".sprintf("%02d", $hour).":".sprintf("%02d",
$min).":".sprintf("%02d", $sec)." ".sprintf("%02d",
$mday)."-".sprintf("%02d", $mon+1)."-".sprintf("%02d", $year+1900);
print $thetime;
}

Irssi::signal_add("message public", "time_printer");

Right now it just prints the time in the status window anytime
somebody says something. How do I get it to print it in a certain
channel, only when a message containing "thetime" is sent?

Thanks in advance