void main( string player )
{
string[int] sess = session_logs( player , 30 );
string[int] lines;
int[item] foods;
int[item] boozes;
int[item] all_foods;
int[item] all_booze;
file_to_map( "fullness.txt" , all_foods );
file_to_map( "inebriety.txt" , all_booze );
matcher m_food = create_matcher( "eat (\\d+) (.*)" , "" );
matcher m_booze = create_matcher( "drink (\\d+) (.*)" , "" );
foreach key in sess
{
lines = split_string( sess[key] );
foreach key2,line in lines
{
m_food.reset( line );
m_booze.reset( line );
if( m_food.find() ) foods[m_food.group( 2 ).to_item()] = foods[m_food.group( 2 ).to_item()] + m_food.group( 1 ).to_int();
else if( m_booze.find() ) boozes[m_booze.group( 2 ).to_item()] = boozes[m_booze.group( 2 ).to_item()] + m_booze.group( 1 ).to_int();
}
}
cli_execute( "mirror pvphistory.txt" );
print_html( "Foods" );
foreach food in foods
{
print( "Eaten " + foods[food] + " " + food + " in the last 30 days" );
}
print_html( "
Booze" );
foreach booze in boozes
{
print( "Drank " + boozes[booze] + " " + booze + " in the last 30 days" );
}
cli_execute( "mirror" );
cli_execute( "mirror stillneed.txt" );
print( "Still need" );
print( "Foods:" );
print( "" );
foreach food in all_foods
{
if( !( foods contains food ) && food != $item[none] ) print( food );
}
print( "" );
print( "Boozes:" );
print( "" );
foreach booze in all_booze
{
if( !( boozes contains booze ) && booze != $item[none] ) print( booze );
}
cli_execute( "mirror" );
}