closet_amount()

From KoLMafia
Jump to: navigation, search

Function Syntax

int closet_amount(item it )

  • 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

Special

Returns 0 when not logged in.