LuaRecipe

A crafting recipe. Recipes belong to forces (see LuaForce) because some recipes are unlocked by research, and researches are per-force.

class LuaRecipe - sort
reload() Reload the recipe from the prototype.
name :: string [R] Name of the recipe.
localised_name :: LocalisedString [R] Localised name of the recipe.
localised_description :: LocalisedString [R]
prototype :: LuaRecipePrototype [R] The prototype for this recipe.
enabled :: boolean [RW] Can the recipe be used?
category :: string [R] Category of the recipe.
ingredients :: array[Ingredient] [R] Ingredients for this recipe.
products :: array[Product] [R] The results of this recipe.
hidden :: boolean [R] Is the recipe hidden?
hidden_from_flow_stats :: boolean [RW] Is the recipe hidden from flow statistics?
energy :: double [R] Energy required to execute this recipe.
order :: string [R] Order string.
group :: LuaGroup [R] Group of this recipe.
subgroup :: LuaGroup [R] Subgroup of this recipe.
force :: LuaForce [R] The force that owns this recipe.
valid :: boolean [R] Is this object valid?
object_name :: string [R] The class name of this object.
help() → string All methods and properties that this object supports.
reload()

Reload the recipe from the prototype.

name :: string [Read-only]

Name of the recipe. This can be different than the name of the result items as there could be more recipes to make the same item.

localised_name :: LocalisedString [Read-only]

Localised name of the recipe.

localised_description :: LocalisedString [Read-only]

prototype :: LuaRecipePrototype [Read-only]

The prototype for this recipe.

enabled :: boolean [Read-Write]

Can the recipe be used?

category :: string [Read-only]

Category of the recipe.

ingredients :: array[Ingredient] [Read-only]

Ingredients for this recipe.

Example
What the "steel-chest" recipe would return
{{type="item", name="steel-plate", amount=8}}
Example
What the "advanced-oil-processing" recipe would return
{{type="fluid", name="crude-oil", amount=10}, {type="fluid", name="water", amount=5}}
products :: array[Product] [Read-only]

The results of this recipe.

hidden :: boolean [Read-only]

Is the recipe hidden? Hidden recipe don't show up in the crafting menu.

hidden_from_flow_stats :: boolean [Read-Write]

Is the recipe hidden from flow statistics?

energy :: double [Read-only]

Energy required to execute this recipe. This directly affects the crafting time: Recipe's energy is exactly its crafting time in seconds, when crafted in an assembling machine with crafting speed exactly equal to one.

order :: string [Read-only]

Order string. This is used to sort the crafting menu.

group :: LuaGroup [Read-only]

Group of this recipe.

subgroup :: LuaGroup [Read-only]

Subgroup of this recipe.

force :: LuaForce [Read-only]

The force that owns this recipe.