Create: Difference between revisions
Jump to navigation
Jump to search
imported>StDoodle Created page with '{{#vardefine:name|create}} {{#vardefine:return_type|boolean}} {{FunctionPage| name={{#var:name}}| function_category=Item Management| function1={{Function| name={{#var:name}}| a…' |
imported>Joesus m Fixed typo. |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{#vardefine:name|create}} | {{ | ||
{{#vardefine:return_type|boolean}} | #vardefine:name|create}}{{ | ||
#vardefine:return_type|boolean}}{{ | |||
FunctionPage| | |||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 19: | Line 19: | ||
function_description=Attempts to create {{pspan|qty}} of {{pspan|make}}, following your KoLmafia settings regarding purchases to gather ingredients & require boxen. Returns true if all items are successfully created, and false otherwise.| | function_description=Attempts to create {{pspan|qty}} of {{pspan|make}}, following your KoLmafia settings regarding purchases to gather ingredients & require boxen. Returns true if all items are successfully created, and false otherwise.| | ||
code1={{CodeSample| | |||
title=Code Sample| | |||
description=Create an item and report on its success.| | |||
code= | |||
<syntaxhighlight> | |||
boolean success = create(1, $item[mandarina colada]); | |||
if(success) | |||
print("You have made 1 mandarina colada."); | |||
else print("You failed to make a mandarina colada."); | |||
</syntaxhighlight> | |||
}}| | |||
see_also={{SeeAlso|retrieve_item}}| | see_also={{SeeAlso|retrieve_item}}| | ||
Line 25: | Line 35: | ||
}} | }} | ||
{{RFI|Is the return value given correct? Any exceptions?}} | {{RFI|Is the return value given correct? Any exceptions?}} | ||
[[Category:Item Management]] |
Latest revision as of 22:34, 7 October 2013
Function Syntax
boolean create(int qty ,item make )
- qty is the quantity to create
- make is the item to create
Attempts to create qty of make, following your KoLmafia settings regarding purchases to gather ingredients & require boxen. Returns true if all items are successfully created, and false otherwise.
Code Sample
Create an item and report on its success.
boolean success = create(1, $item[mandarina colada]);
if(success)
print("You have made 1 mandarina colada.");
else print("You failed to make a mandarina colada.");
CLI Equivalent
The CLI command "create" works similarly when supplied with an item as a parameter.
See Also
Attention KoLmafia Experts!
We need your help; some details of this function's operation are unknown or unclear.
The following specific question has been raised:
- Is the return value given correct? Any exceptions?