Get monsters: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
No edit summary
imported>StDoodle
mNo edit summary
Line 1: Line 1:
{{#vardefine:name|get_monsters}}
{{
{{#vardefine:return_type|monster [int]}}
#vardefine:name|get_monsters}}{{
{{#vardefine:aggregate|yes}}
#vardefine:return_type|monster [int]}}{{
#vardefine:aggregate|yes}}{{


{{FunctionPage|
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|
function_category=Adventuring|
function_category=Adventuring|

Revision as of 21:25, 8 March 2010

Function Syntax

monster [int] get_monsters(location loc )

  • loc is the location you want to get the monsters for.

This function returns a map of every monster in a given location. Useful for iterating over for more specific information on an area.

Code Samples

This function returns predicted meat drop rates for a specified location.

monster [int] monster_list = get_monsters($location[giant castle]);
float total_meat = 0;
int counter = 0;
foreach int in monster_list {
   total_meat = total_meat + meat_drop(monster_list[int]);
   counter = counter + 1;
}
float final = total_meat / counter;
print(final);

See Also

appearance_rates() | meat_drop()

Special

When not logged in, this function returns $monster[none] ??