Is is possible to fully parse internal data files?

Sandiman

Member
I've been trying to load the KoLMafia data files into maps. Specifically, I'm interested in the data in fullness.txt and inebriety.txt.

I can get a record of the items with the following code:
Code:
item[item] fullnessMap;
fullnessMap = file_to_map("fullness.txt", fullnessMap);

"fullnessMap" then contains all the items within the fullness.txt file. However, I'm at a loss when I try to determine the fullness of an item. It seems like I should be able to declare fullnessMap in a different way so that file_to_map will put the Fullness, Level Req, Adventures, and stat bonuses from fullness.txt into fullnessMap, but I've been unable to do so.

Is there a way to extract this (and similar) information from the KoLMafia data files?
 

Alhifar

Member
You have to use a record to create a type that you can call with each of the possible parts.

The following example would find the fullness and level requirement of every food in the database and print it out with the item.

Code:
record _full
{
	int fullness;
	int level;
};

void main()
{
	
	
	_full[item] fullnessMap;
	file_to_map("fullness.txt", fullnessMap);
	
	foreach thing in fullnessMap
	 print( thing + " - " + fullnessMap[thing].fullness + " fullness. Requires level " + fullnessMap[thing].level + "." );
	
}
 
Top