Equip: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Bale
fixed formatting.
imported>Heeheehee
m Lame workaround to maintain formatting. =D
Line 26: Line 26:
}}|
}}|


function_description=Attempts to equip the item {{pspan|equip_me}} in the slot {{pspan|where}} if specified, and returns true if the operation was successful, and false if it was not. If parameter {{pspan|where}} is not specified, it defaults to the "standard" place for such an item (main-hand for 1-handed weapons, first open slot for accessories or acc1 if no slots are open). </p>
function_description=Attempts to equip the item {{pspan|equip_me}} in the slot {{pspan|where}} if specified, and returns true if the operation was successful, and false if it was not. If parameter {{pspan|where}} is not specified, it defaults to the "standard" place for such an item (main-hand for 1-handed weapons, first open slot for accessories or acc1 if no slots are open).  
<p>If {{pspan|where}} is specified and {{pspan|equip_me}} is set to $item[none], this function will unequip whatever is in slot {{pspan|where}} and return true. </p>
*If {{pspan|where}} is specified and {{pspan|equip_me}} is set to $item[none], this function will unequip whatever is in slot {{pspan|where}} and return true.  
<p>If {{pspan|where}} is not specified and {{pspan|equip_me}} is set to $item[none], the function aborts and you get a funky error because that makes no sense. </p>
*If {{pspan|where}} is not specified and {{pspan|equip_me}} is set to $item[none], the function aborts and you get a funky error because that makes no sense.  
<p>If you cannot equip {{pspan|equip_me}}, or {{pspan|where}} is supplied and the item cannot be used in that slot, you will be given an error message and this function will return false.|
*If you cannot equip {{pspan|equip_me}}, or {{pspan|where}} is supplied and the item cannot be used in that slot, you will be given an error message and this function will return false.
&nbsp;|


code1={{CodeSample|
code1={{CodeSample|

Revision as of 20:42, 21 March 2010

Function Syntax

boolean equip(item equip_me )

boolean equip(slot where ,item equip_me )

  • where is the slot to place the item in (optional)
  • equip_me is the item to equip

Attempts to equip the item equip_me in the slot where if specified, and returns true if the operation was successful, and false if it was not. If parameter where is not specified, it defaults to the "standard" place for such an item (main-hand for 1-handed weapons, first open slot for accessories or acc1 if no slots are open).

  • If where is specified and equip_me is set to $item[none], this function will unequip whatever is in slot where and return true.
  • If where is not specified and equip_me is set to $item[none], the function aborts and you get a funky error because that makes no sense.
  • If you cannot equip equip_me, or where is supplied and the item cannot be used in that slot, you will be given an error message and this function will return false.

 

Code Sample

Equips the Swashbuckling Getup carefully to ensure that the parot is in the second accessory slot.

equip($item[eyepatch]);
equip($item[swashbuckling pants]);
equip($slot[acc2], $item[stuffed shoulder parrot]);

CLI Equivalent

The CLI commands "equip" (and others, for specific slots) function similarly.

See Also

can_equip() | equipped_amount() | equipped_item() | have_equipped()