Difference between revisions of "Craft"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
(fixed for current template)
imported>Bale
Line 13: Line 13:
 
parameter1={{Param|string|mode}}|
 
parameter1={{Param|string|mode}}|
 
parameter2={{Param|int|count}} |
 
parameter2={{Param|int|count}} |
parameter3={{Param|int|item1}} |
+
parameter3={{Param|item|item1}} |
parameter4={{Param|int|item2}} |
+
parameter4={{Param|item|item2}} |
 
p1desc={{Pspan|mode}} can be "combine", "cook", "cocktail", "smith", "jewelry".|
 
p1desc={{Pspan|mode}} can be "combine", "cook", "cocktail", "smith", "jewelry".|
 
p2desc={{Pspan|count}} count is how many of each ingredient to use.|
 
p2desc={{Pspan|count}} count is how many of each ingredient to use.|
p3desc={{Pspan|item1, item2}} are the ingredients expressed as integers, not items|}}|
+
p3desc={{Pspan|item1, item2}} are the ingredients.|}}|
  
 
function_description=This is a raw crafting function that will attempt to craft raw materials without considering the outcome of that crafting. </p>
 
function_description=This is a raw crafting function that will attempt to craft raw materials without considering the outcome of that crafting. </p>
Line 32: Line 32:
 
code=
 
code=
 
<syntaxhighlight>
 
<syntaxhighlight>
craft("cook", 1, to_int($item[vial of red slime]), to_int($item[vial of green slime]));
+
craft("cook", 1, to_int($item[vial of red slime]), $item[vial of green slime]);
craft("cook", 1, to_int($item[vial of red slime]), to_int($item[vial of chartreuse slime]));
+
craft("cook", 1, to_int($item[vial of red slime]), $item[vial of chartreuse slime]);
 
</syntaxhighlight>}}|
 
</syntaxhighlight>}}|
  
 
}}
 
}}

Revision as of 04:55, 1 March 2010



Function Syntax

int craft(string mode ,int count ,item item1 ,item item2 )

  • mode can be "combine", "cook", "cocktail", "smith", "jewelry".
  • count count is how many of each ingredient to use.
  • item1, item2 are the ingredients.

This is a raw crafting function that will attempt to craft raw materials without considering the outcome of that crafting.

It can be useful for specialized tasks such as gaining the "Color Wheel of Yuck" trophy since that requires you to craft many items using different methods to create the same results.

It returns the number of each ingredient used. Ideally, this is equal to the "count" parameter, but could be less if, for example, your box servant blew up, you require box servants, and auto-repair was either disabled or failed.

Simple Example

Just an example of how to make vials of brown slime in two different ways.

craft("cook", 1, to_int($item[vial of red slime]), $item[vial of green slime]);
craft("cook", 1, to_int($item[vial of red slime]), $item[vial of chartreuse slime]);