Get monsters: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
Created page with '{{#vardefine:name|get_monsters}} {{#vardefine:return_type|monster}} {{#vardefine:aggregate|ANYTHING_IF_AGG_OR_DELETE}} {{FunctionPage| name={{#var:name}}| function_category=CATE…'
 
imported>Bale
mNo edit summary
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{#vardefine:name|get_monsters}}
{{
{{#vardefine:return_type|monster}}
#vardefine:name|get_monsters}}{{
{{#vardefine:aggregate|ANYTHING_IF_AGG_OR_DELETE}}
#vardefine:return_type|monster [int]}}{{
#vardefine:aggregate|yes}}{{


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


function1={{Function|
function1={{Function|
Line 12: Line 12:
return_type={{#var:return_type}}|
return_type={{#var:return_type}}|
return_also={{#var:return_also}}|
return_also={{#var:return_also}}|
parameter1={{Param|DATATYPE|SHORT_DESC}}|
parameter1={{Param|location|loc}}|
parameter2={{Param|DATATYPE|SHORT_DESC}}|
p1desc={{pspan|loc}} is the location you want to get the monsters for.
parameter3={{Param|DATATYPE|SHORT_DESC}}|
parameter4={{Param|DATATYPE|SHORT_DESC}}|
parameter5={{Param|DATATYPE|SHORT_DESC}}|
p1desc=LONG_DESCRIPTION_OF_PARAMETER|
p2desc=LONG_DESCRIPTION_OF_PARAMETER|
p3desc=LONG_DESCRIPTION_OF_PARAMETER|
p4desc=LONG_DESCRIPTION_OF_PARAMETER|
p5desc=LONG_DESCRIPTION_OF_PARAMETER
}}|
}}|


function_description=DESCRIPTION_OF_FUNCTION|
function_description=This function returns a map of every monster in a given location. Useful for iterating over for more specific information on an area.  Be aware that this also includes monsters that result from choice adventures, such as the Clownlord Beelzebozo, the Guy Made of Bees, etc.|


code1={{CodeSample|
code1={{CodeSample|
title=CODE EXAMPLE TITLE|
title=Code Samples|
description=DESCRIPTION OF CODE|
description=This function returns predicted meat drop rates for a specified location.|
code=
code=
<syntaxhighlight>
<syntaxhighlight>
CODE GOES HERE
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);
 
</syntaxhighlight>
</syntaxhighlight>
}}|
}}|


see_also={{SeeAlso|FIRST|SECOND|ETC}}|
see_also={{SeeAlso|appearance_rates|meat_drop}}|
cli_equiv=LIST_CLI_EQUIVALENT_INFO|
special=When not logged in, this function returns $monster[none] ??
more_info=A_LINE_TO_NOTIFY_OF_EXTERNAL_INFO|
special=SPECIAL_NOTES_SUCH_AS_NOT-LOGGED-IN_VALUE
}}
}}
[[Category:Adventuring]]

Latest revision as of 22:21, 21 May 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. Be aware that this also includes monsters that result from choice adventures, such as the Clownlord Beelzebozo, the Guy Made of Bees, etc.

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] ??