Is giftable

From Kolmafia
Jump to navigation Jump to search

Function Syntax

boolean is_giftable(item check_me )

  • check_me is an item to test

This function checks to see if the item check_me can be sent as a gift, returning true if it can and false otherwise. Note that this will return true for all items that are not untradeable, not merely gift items. If you want to specifically know if an item is a gift item, then check the gift.item proxy record.

Code Sample

Differentiate between Gift item and giftable item.

void gift_kind( item check ) {
   if( check.gift == true )
      print( check + " is a gift item." );
   else if( is_giftable(check) )
      print( check + " can be sent to another player." );
   else
      print( check + " cannot be kMailed or traded to another player." );
}

See Also

is_displayable() | is_tradeable()