Appearance rates

From Kolmafia
Revision as of 21:25, 8 March 2010 by imported>StDoodle
Jump to navigation Jump to search

Function Syntax

float [monster] appearance_rates(location place )

  • place is the adventuring location to parse

Returns a map, keyed by monster, with the appearance rate percentages as decimal values (ie a 30% rate monster has a value of 30.0). Bosses, semirare encounters, and other one-time-only monsters have a value of 0.0; ultra-rare monsters have a negative value (the actual value varies; test by looking for value < 0, not value == -1). Does not account for combat rate modifiers, olfaction, etc.

Simple Example

Prints the encounters in a zone and their rates of appearing.

float[monster] freq = appearance_rates($location[Castle]);
print("Encounters in the Castle:");
foreach m in freq {
   string str = m.to_string();
   if(str=="none") str = "Noncombats";
   if(freq[m]>0 && m != $monster[none]) print("Frequency of " + str + ": " + freq[m] + "%");
   if(freq[m]==-1) print("Frequency of " + str + ": Unknown");
   else print("Frequency of " + str + ": Unlikely (either semirare, boss, or ultra-rare)");
}

special=When not logged in, this function still returns the same data, as it is pulled from KoLmafia's data files.