Craft: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Bale
No edit summary
imported>Bale
fixed for current template
Line 1: Line 1:
{{FunctionPage |
{{#vardefine:name|craft}}
page_name=craft|
{{#vardefine:return_type|int}}
 
{{FunctionPage|
name={{#var:name}}|
function_category=Miscellaneous|
function_category=Miscellaneous|
function1_return_type=int |
 
function1_parameter1={{Param|string|mode}} |
function1={{Function|
function1_parameter2={{Param|int|count}} |
name={{#var:name}}|
function1_parameter3={{Param|int|item1}} |
aggregate={{#var:aggregate}}|
function1_parameter4={{Param|int|item2}} |
return_type={{#var:return_type}}|
function1_parameter1_desc=mode can be "combine", "cook", "cocktail", "smith", "jewelry".|
return_also={{#var:return_also}}|
function1_parameter2_desc=count is how many of each ingredient to use.|
parameter1={{Param|string|mode}}|
function1_parameter3_desc=item1 and item2 are the ingredients.|
parameter2={{Param|int|count}} |
parameter3={{Param|int|item1}} |
parameter4={{Param|int|item2}} |
p1desc={{Pspan|mode}} can be "combine", "cook", "cocktail", "smith", "jewelry".|
p2desc={{Pspan|count}} count is how many of each ingredient to use.|
p3desc={{Pspan|item1, item2}} are the ingredients expressed as integers, not items|}}|
 
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>


<p>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.
<p>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.</p>


It returns the number of each ingredient used. Ideally, this is equal to the
<p>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
"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.|
up, you require box servants, and auto-repair was either disabled or failed.|
code1={{CodeSample |
code1={{CodeSample |
title=Simple Example|
title=Simple Example|
description=Just an example of how to make vials of brown slime in two different ways.|
description=Just an example of how to make vials of brown slime in two different ways.|
code=<syntaxhighlight>
code=
<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]), to_int($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]), to_int($item[vial of chartreuse slime]));
</syntaxhighlight>}}|


</syntaxhighlight>}} |
}}
}}

Revision as of 04:54, 1 March 2010



Function Syntax

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

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

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]), to_int($item[vial of green slime]));
craft("cook", 1, to_int($item[vial of red slime]), to_int($item[vial of chartreuse slime]));