Is displayable

From Kolmafia
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Function Syntax

boolean is_displayable(item check_me )

  • check_me is an item to test

This function checks to see if the item check_me can be put in a display case, returning true if it can and false otherwise.

Code Sample

The following code attempts to fill your display case with one of every item, only using the ones you have in your inventory. This is essentially a mock-up of HolderofSecrets(Warning: large page), who is striving to get one of every item in the game.

batch_open();
foreach itm, quantity in get_inventory()
{
   if ( is_displayable( itm ) && display_amount( itm ) == 0 )
      put_display( 1 , itm );
}
batch_close();

Note that put_display() returns a boolean value indicating whether the operation is successful or not.

See Also

is_giftable() | is_tradeable()