buys_item()

From KoLMafia
Jump to: navigation, search

Function Syntax

boolean buys_item(coinmaster master ,item it )

  • master is the coinmaster to query
  • it is the item to query

Returns true if master will purchase it.

Code Samples

Checks what items, if any, in your inventory will be bought by coinmasters.

int[item] inventory = get_inventory();
foreach it in inventory
   foreach shop in $coinmasters[]
      if (buys_item(shop, it))
        print("The coinmaster "+shop+" will buy your "+it+".", "blue");

See Also