is_displayable()

From KoLMafia
Jump to: navigation, search

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