Jump to content

Digital Crafter: Difference between revisions

From Advanced Computers Wiki
No edit summary
No edit summary
Line 10: Line 10:
!Description
!Description
|-
|-
|<code>isBusy</code>
|<code>cooldownRemaining</code>
|<code>boolean</code>
|<code>number</code>
|READ
|READ
|Whether the auto crafter is currently crafting something and thus not able to accept another :craft call.
|How much more time needs to pass before <code>:craft</code> may be called again.
|}
|}
{| class="wikitable"
{| class="wikitable"
Line 21: Line 21:
!Description
!Description
|-
|-
| style="white-space: nowrap;" |<code>:searchRecipesWithIngredient("modname:itemname")</code>
| style="white-space: nowrap;" |<code>:searchRecipesWithIngredient(string"modname:itemname")</code>
|<code>recipe[]</code>
|<code>recipe[]</code>
|
|
|-
|-
| style="white-space: nowrap;" |<code>:searchRecipesWithResult("modname:itemname")</code>
| style="white-space: nowrap;" |<code>:searchRecipesWithResult(string"modname:itemname")</code>
|<code>recipe[]</code>
|<code>recipe[]</code>
|
|
|-
|-
| style="white-space: nowrap;" |<code>:searchItemByName("partial name")</code>
| style="white-space: nowrap;" |<code>:searchItemByName(string:partialName)</code>
|<code>string</code>
|<code>string</code>
|Returns the full name of the item
|Returns the full name of the item
|-
|-
|<code>:craftAsync(9x ingredientModnameItemname, resultModnameItemname, amount)</code>
|<code>:craft(string"modname:itemname"[]:ingredients, string"modname:itemname":resultItem, int:amount, boolean:outputIntoOwnInventory)</code>
|number
|<code>integer</code>
|If all required items are available, begins crafting and returns amount of seconds that this crafting operation will take.
|If all required items are available, crafts the result. If <code>outputIntoOwnInventory</code> is <code>true</code> the result is put into the own inventory. Otherwise it is pushed into the inventory that may be above, or it is ejected above in-world. '''Beware that there is no destination check to make sure that there is room in the inventory above, so items may spill if the destination is full.'''
Otherwise throws an error describing the problem.
|}
|}

Revision as of 21:28, 24 August 2026

This page describes unreleased, experimental content that is still in development which might undergo significant changes or be removed entirely.

Description

Provided component

This block provides the autoCrafter component, offering the following properties:

AutoCrafterUD component properties
Name Type Read/Write Description
cooldownRemaining number READ How much more time needs to pass before :craft may be called again.
AutoCrafterUD component methods
Name Type Description
:searchRecipesWithIngredient(string"modname:itemname") recipe[]
:searchRecipesWithResult(string"modname:itemname") recipe[]
:searchItemByName(string:partialName) string Returns the full name of the item
:craft(string"modname:itemname"[]:ingredients, string"modname:itemname":resultItem, int:amount, boolean:outputIntoOwnInventory) integer If all required items are available, crafts the result. If outputIntoOwnInventory is true the result is put into the own inventory. Otherwise it is pushed into the inventory that may be above, or it is ejected above in-world. Beware that there is no destination check to make sure that there is room in the inventory above, so items may spill if the destination is full.