Equip

From Kolmafia
Revision as of 21:01, 5 March 2010 by imported>StDoodle
Jump to navigation Jump to search



needs(code_samples);

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 where is set to $item[none], this function will unequip whatever is in slot where and return true. If where is not specified and where is set to $item[none], the function aborts and you get a funky error. 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.

CLI Equivalent

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

See Also

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


Attention KoLmafia Experts!

We need your help; some details of this function's operation are unknown or unclear.

The following specific questions have been raised:

  • What's up with the abort message when no slot is unspecified and item is $item[none]?
  • I'm sure there are other edge-case I haven't thought of; if you do, please test and edit in.