Closet amount: Difference between revisions
Jump to navigation
Jump to search
imported>Alhifar mNo edit summary |
imported>Bale mNo edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{#vardefine:name|closet_amount}} | {{ | ||
{{#vardefine:return_type|int}} | #vardefine:name|closet_amount}}{{ | ||
#vardefine:return_type|int}}{{ | |||
FunctionPage| | |||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 12: | Line 12: | ||
return_also={{#var:return_also}}| | return_also={{#var:return_also}}| | ||
parameter1={{Param|item|it}}| | parameter1={{Param|item|it}}| | ||
p1desc={{Pspan|it}} is the item | p1desc={{Pspan|it}} is the item to check| | ||
}}| | }}| | ||
Line 22: | Line 22: | ||
code= | code= | ||
<syntaxhighlight> | <syntaxhighlight> | ||
item coin = $item[filthy lucre]; | |||
if( item_amount( | // Just to save some space later on. | ||
if(!have_skill($skill[transcendent olfaction]) { | |||
// This code will only fire if you don't have Olfaction yet. | |||
if ((item_amount(coin) + display_amount(coin) + closet_amount(coin)) >= 200) | |||
print( "Go get olfaction!" ); | |||
else print( "Keep going, you need more lucre!" ); | else print( "Keep going, you need more lucre!" ); | ||
} | } | ||
Line 29: | Line 33: | ||
}}| | }}| | ||
see_also={{SeeAlso|item_amount| | see_also={{SeeAlso|display_amount|equipped_amount|item_amount|shop_amount|stash_amount|storage_amount}}| | ||
special= | special=Returns 0 when not logged in. | ||
}} | }} | ||
[[Category:Item Management]] |
Latest revision as of 21:45, 21 May 2010
Function Syntax
- it is the item to check
Returns the amount of a given item that is contained in your closet.
Sample Code
Checks if you have enough filthy lucre for Olfaction
item coin = $item[filthy lucre];
// Just to save some space later on.
if(!have_skill($skill[transcendent olfaction]) {
// This code will only fire if you don't have Olfaction yet.
if ((item_amount(coin) + display_amount(coin) + closet_amount(coin)) >= 200)
print( "Go get olfaction!" );
else print( "Keep going, you need more lucre!" );
}
See Also
display_amount() | equipped_amount() | item_amount() | shop_amount() | stash_amount() | storage_amount()
Special
Returns 0 when not logged in.