$kernel->post( $src, $replypath, "From: ".$memo[0].", $response ago: ".$memo[2], $dest );
}
delete $heap->{ 'memo' }->{ uc( $who ) };
+ DumpFile( "memos.yaml", $heap->{ 'memo' } );
}
MEMO: |-
sub {
my( $kernel, $heap, $who, $what, $src, $dest, $replypath ) = @_;
+ if( ($what =~ s/ / /g) < 1 ) {
+ $kernel->post( $src, $replypath, "Usage: MEMO <recipient> <message>", $dest );
+ return;
+ }
my( $rec, $msg ) = split( / /, $what, 2 );
if( !exists( $heap->{ 'memo' } ) ) {
$heap->{ 'memo' } = {};
$heap->{ 'memo' }->{ uc( $rec ) } = [];
}
push @{ $heap->{ 'memo' }->{ uc( $rec ) } }, [ $who, time, $msg ];
+ DumpFile( "memos.yaml", $heap->{ 'memo' } );
$kernel->post( $src, $replypath, "Memo left for $rec.", $dest );
}
print( "CORE: No commands found.\n" );
}
+ if( -e "memos.yaml" ) {
+ $heap->{ 'memo' } = \%{ LoadFile( "memos.yaml" ) };
+ print( "CORE: Memos loaded.\n" );
+ } else {
+ print( "CORE: No memos found.\n" );
+ }
+
if( -e "factoids.yaml" ) {
$heap->{ 'db' } = \%{ LoadFile( "factoids.yaml" ) };
print( "CORE: Factoids loaded.\n" );