Is npc item: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
Created page with '{{#vardefine:name|is_npc_item}} {{#vardefine:return_type|boolean}} {{FunctionPage| name={{#var:name}}| function_category=Item Management| function1={{Function| name={{#var:name…'
 
imported>StDoodle
mNo edit summary
Line 12: Line 12:
return_also={{#var:return_also}}|
return_also={{#var:return_also}}|
parameter1={{Param|item|check}}||
parameter1={{Param|item|check}}||
p1desc={{pspan|check}} is an item to check for npc store availability.|
p1desc={{pspan|check}} is an item to check for npc store availability|
}}|
}}|


function_description=Returns '''[[true]]''' if the item can be bought from an npc store, '''[[false]]''' if it cannot be.</p>
function_description=Returns true if the item can be bought from an NPCc store, false if it cannot be.</p>
<p>Note that the function will return '''[[true]]''' for items that can be bought in sign stores, even if you can't currently access them.|
<p>Note that the function will return true for items that can be bought in sign stores, even if you can't currently access them.|


code1={{CodeSample|
code1={{CodeSample|
title=Code Samples|
title=Code Samples|
description=The following would return '''[[true]]''' even if you are not a moxie sign.|
description=The following would return true even if you are not a moxie sign.|
code=
code=
<syntaxhighlight>
<syntaxhighlight>

Revision as of 19:40, 5 March 2010



Function Syntax

boolean is_npc_item(item check )

  • check is an item to check for npc store availability

Returns true if the item can be bought from an NPCc store, false if it cannot be.

Note that the function will return true for items that can be bought in sign stores, even if you can't currently access them.

Code Samples

The following would return true even if you are not a moxie sign.

is_npc_item($item[meleegra pills]);