Difference between revisions of "Equipped item"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m
imported>Bale
m
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{#vardefine:name|equipped_item}}
+
{{
{{#vardefine:return_type|item}}
+
#vardefine:name|equipped_item}}{{
 +
#vardefine:return_type|item}}{{
  
{{FunctionPage|
+
FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
function_category=Equipment|
 
  
 
function1={{Function|
 
function1={{Function|
Line 33: Line 33:
 
cli_equiv=When used with the "list" and "filter" parameters, the CLI command "equip" has similar functionality.|
 
cli_equiv=When used with the "list" and "filter" parameters, the CLI command "equip" has similar functionality.|
 
}}
 
}}
 +
 +
[[Category:Equipment]]

Latest revision as of 22:10, 21 May 2010

Function Syntax

item equipped_item(slot check )

  • check is the item slot to check

Returns the item equipped in the slot to check or $item[none] if your character has nothing equipped there.

Code Sample

If you're wearing a maiden's wig, switch to a chef's hat if possible.

boolean equip_chef_hat() {
   if ((equipped_item($slot[hat]) == $item[maiden wig]) && (item_amount($item[chef's hat]) > 0) && can_equip($item[chef's hat]))
      return equip($item[chef's hat);
   }
   return false;
}

CLI Equivalent

When used with the "list" and "filter" parameters, the CLI command "equip" has similar functionality.

See Also

can_equip() | equip() | have_equipped()