Have equipped: Difference between revisions
Jump to navigation
Jump to search
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}}| …' |
imported>Bale mNo edit summary |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{#vardefine:name|have_equipped}} | {{ | ||
{{#vardefine:return_type|boolean}} | #vardefine:name|have_equipped}}{{ | ||
#vardefine:return_type|boolean}}{{ | |||
FunctionPage| | |||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 17: | Line 17: | ||
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.| | 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.| | ||
code1={{CodeSample| | |||
title=Code Sample| | |||
description=This example will check if you have the Pirate fledges equipped, and equip it if not.| | |||
code= | |||
<syntaxhighlight> | |||
if ( !have_equipped($item[pirate fledges]) ) | |||
equip( $slot[acc1], $item[pirate fledges] ); | |||
</syntaxhighlight>}}| | |||
see_also={{SeeAlso|can_equip|equip}}| | see_also={{SeeAlso|can_equip|equip}}| | ||
cli_equiv=The CLI commands "equip" and others function similarly, if the parameter "list" or no parameters are given.| | cli_equiv=The CLI commands "equip" and others function similarly, if the parameter "list" or no parameters are given.| | ||
}} | }} | ||
[[Category:Equipment]] |
Latest revision as of 22:10, 21 May 2010
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.
Code Sample
This example will check if you have the Pirate fledges equipped, and equip it if not.
if ( !have_equipped($item[pirate fledges]) )
equip( $slot[acc1], $item[pirate fledges] );
CLI Equivalent
The CLI commands "equip" and others function similarly, if the parameter "list" or no parameters are given.