The parameter passed to the function is now the number of days you want including today. The indices into the map are now the days from today. So, suppose you wanted the last 30 days worth of session logs (which is really where this was made). Instead of having to write a for loop, it's a single function call. If you wanted to read things line by line, you would then take a single day and split it, using the new split_string method.
int [item] food_list;
int [item] booze_list;
string [int] my_logs = session_logs( my_name(), 30 );
foreach day in my_logs
print( "Parsing day " + day + "..." );
if ( my_logs[day] == "" )
string [int] lines = my_logs[day].split_string();
foreach line in lines
// It will always be "eat # itemname"
if ( lines[line].index_of( "eat" ) == 0 )
food_list[ string_to_item( lines[line].substring(6) ) ] = day;
// It will always be "drink # itemname"
if ( lines[line].index_of( "drink" ) == 0 )
booze_list[ string_to_item( lines[line].substring(8) ) ] = day;
print( "Food history:" );
foreach food in food_list
print( food + " (" + food_list[food] + " days ago)" );
print( "\n\n" );
print( "Booze history:" );
foreach booze in booze_list
print( booze + " (" + booze_list[booze] + " days ago)" );