Difference between pages "Get ingredients" and "Have equipped"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Zarqon
m
 
imported>StDoodle
(Created page with '{{#vardefine:name|have_equipped}} {{#vardefine:return_type|boolean}} {{FunctionPage| name={{#var:name}}| function_category=Equipment| function1={{Function| name={{#var:name}}| …')
 
Line 1: Line 1:
{{
+
{{#vardefine:name|have_equipped}}
#vardefine:name|get_ingredients}}{{
+
{{#vardefine:return_type|boolean}}
#vardefine:return_type|int [item]}}{{
 
#vardefine:aggregate|yes}}{{
 
  
FunctionPage|
+
{{FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
function_category=Item Management|
+
function_category=Equipment|
  
 
function1={{Function|
 
function1={{Function|
Line 13: Line 11:
 
return_type={{#var:return_type}}|
 
return_type={{#var:return_type}}|
 
return_also={{#var:return_also}}|
 
return_also={{#var:return_also}}|
parameter1={{Param|item|parse_me}}|
+
parameter1={{Param|item|check}}|
p1desc={{Pspan|parse_me}} is the creatable item to list the ingredients for|
+
p1desc={{Pspan|check}} is the item to test for|
 
}}|
 
}}|
  
function_description=Returns a map keyed by item names with the values equal to the quantity of each ingredient required to make {{pspan|parse_me}}. Note that for multi-stage crafting (where you combine several items to get intermediate items, and then combine those for the final result), only the last stage of requirements is listed. This function will parse items that can be created through multi-use of items as well as "traditional" creation methods such as cooking, cocktailcrafting, and smithing.|
+
function_description=Returns true if you currently have the specified item {{pspan|check}} equipped, false if you do not. For familiar equipment, it only checks the familiar you currently have with you. Always returns false if {{pspan|check}} is not an item that can be equipped.|
  
 
needscode=yes|
 
needscode=yes|
  
more_info=See the Coldfront's wiki page on [http://kol.coldfront.net/thekolwiki/index.php/Discoveries Discoveries] for more information.|
+
see_also={{SeeAlso|can_equip|equip}}|
special= Returns an empty map for items that cannot be created at the moment, taking into account gender, skills, adventures remaining, tools in inventory, current date, and access to certain forms of crafting (e.g. Crimbo Town).|
+
cli_equiv=The CLI commands "equip" and others function similarly, if the parameter "list" or no parameters are given.|
 
}}
 
}}

Revision as of 21:09, 5 March 2010



needs(code_samples);

Function Syntax

boolean have_equipped(item check )

  • check is the item to test for

Returns true if you currently have the specified item check equipped, false if you do not. For familiar equipment, it only checks the familiar you currently have with you. Always returns false if check is not an item that can be equipped.

CLI Equivalent

The CLI commands "equip" and others function similarly, if the parameter "list" or no parameters are given.

See Also

can_equip() | equip()