To coinmaster

From Kolmafia
Revision as of 04:12, 21 July 2011 by imported>Bale (r9555)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Syntax

boolean to_coinmaster(string store )

  • store is hopefully the name of a coinmaster

Returns the coinmaster that matches the string store. This is useful so that the coinmaster datatype can be used by other functions. If store does not match the name of any coinmaster, then the function returns $coinmaster[none]. This works on partial matches so that if store is "dime", this function will return $coinmaster[Dimemaster].

Code Sample

This sells off all the Island War vendor trash to the appropriate coinmasters for quarters and dimes.

foreach trash in $items[red class ring, blue class ring, white class ring, PADL Phone, 
 pink clay bead, purple clay bead, green clay bead, communications windchimes]
   if(item_amount(trash) > 0)
      sell(to_coinmaster(trash.buyer), item_amount(trash), trash);

See Also

visit() | is_accessible() | buys_item() | sells_item()