Assembler

Assembles items as configured when the structure is supplied with the required power and resources. It is a craftable and spawnable non-flammable solid.
It consumes 3 power per tick.
It cannot be resized.
At its default size (8x8x8) it has a durability of 1.
By default, its colour is #000000.
Methods
CalculateCraftingRecipe(items) → recipe
Returns the ingredients (including Power
), products, and time cost of a specified crafting operation.
The items parameter is a list of parts or a dictionary of each part with how many of said part to craft. It can be any of the following types:
-
{ string }
-
{ [string]: number }
The recipe return is information relating to the crafting recipe. It is a dictionary with keys that are string
s and values that are number
s.
Craft(itemName) → success
Will pause and craft the desired item at the next available point, returning a boolean representing whether or not the item was successfully crafted.
This uses a queue under the hood, the first thing to call it gets to craft first, and then finally the assembler performs its configured craft if nothing else is queued.
The itemName parameter is a string
.
The success return is a boolean
.
GetCraftCooldown() → craftCooldown
How long until the assembler can craft again.
The craftCooldown return is a number
.
GetRecipe(itemName) → recipe
Returns the resource(s) required to craft the given item, or nil if the item doesn't have a recipe/doesn't exist.
The itemName parameter is a string
.
The recipe return is a dictionary with keys that are string
s and values that are number
s.
CraftItems(items)
This method is deprecated.
Will craft the specified set of items.
The items parameter can be any of the following types:
-
{ string }
-
{ [string]: number }
GetInventory() → inventory
This method is deprecated. Returns an empty, frozen table.
The inventory return is a dictionary with keys that are string
s and values that are number
s.
Configurables
Assemble
The name of the object to be assembled. It is a string
.
Events
Configured(configurerId)
Fires when the object is configured.
The configurerId parameter is the UserId
of the player who configured the object. It is a number
.
Loop(tickInterval)
Fires when the object is updated by the game loop.
The tickInterval parameter is the inverse of the tick rate. For example, if the tick rate is 20
, this will be 1 / 20
(or just 0.05
). If the tick rate commands are accessible, running them will change this value. It is a number
.