Difference between revisions of "To coinmaster"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
(r9555)
 
imported>Lostcalpolydude
(The code sample didn't work. A new one is needed.)
Line 15: Line 15:
 
}}|
 
}}|
  
function_description=Returns the coinmaster that matches the string {{pspan|store}}. This is useful so that the coinmaster datatype can be used by other functions. If {{pspan|store}} does not match the name of any coinmaster, then the function returns $coinmaster[none]. This works on partial matches so that if {{pspan|store}} is "dime", this function will return $coinmaster[Dimemaster].|
+
needscode=yes|
 
 
code1={{CodeSample|
 
title=Code Sample|
 
description=This sells off all the Island War vendor trash to the appropriate coinmasters for quarters and dimes.|
 
code=
 
<syntaxhighlight>
 
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);
 
</syntaxhighlight>
 
}}|
 
  
 
see_also={{SeeAlso|visit|is_accessible|buys_item|sells_item}}|
 
see_also={{SeeAlso|visit|is_accessible|buys_item|sells_item}}|

Revision as of 04:08, 18 March 2012

needs(code_samples);

Function Syntax

boolean to_coinmaster(string store )

  • store is hopefully the name of a coinmaster

See Also

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