#!/usr/local/bin/perl
#
#    BBS watchdog window
#

while($line = <STDIN>) {
    chop($line);
    if ($line =~ /eXpress message received from (.+) at \d+:\d\d/
	|| $line =~ /Question received from (.+) at \d+:\d\d/
	|| $line =~ /sent you this feeling at \d+:\d\d/) {
	print "$line\n";
    } elsif ($line =~ /\(\d+:\d+\) \S+ /) {		# emote received
	print "$line\n";
    } elsif ($line =~ /EMERGENCY/) {
	print "$line\n";
    } elsif ($line =~ /Bark!! Bark!!! Your watchdog noticed something at \d+:\d\d/) {
	$line = <STDIN>;
	chop($line);
	print "$line\n";

#	$name = '';
#	if ($line =~ /^Your friend (.+) has logged on./) {
#	    $name = $1;
#	} elsif ($line eq 'Kroelie Queen Skin Deep steps on her throne.') {
#	    $name = 'Skin Deep';
#	}
#	if ($name ne '' && $name ne 'Tisha') {
#	    open(UPLOAD, ">/home/zombie/walter/upload") || die "Failed to open 'upload', stopped";
#	    print UPLOAD "x$name\nheiho :)\r\n";
#	    close(UPLOAD);
#	}
    }
}

# EOB


