Recipes
Retrieve Recipe
GetRecipeSet
lua
recipe = GetRecipeSet(index)Retrieves a set of recipes.
Tip
Recipes must be created, imported, and set as default in advance on the Recipe Management Page.
Parameters
| Parameter | Type | Description |
|---|---|---|
| index | Integer | Recipe index |
Return Value
| Return Value | Type | Description |
|---|---|---|
| recipe | Table | The retrieved recipe; returns nil if the operation fails |
Switch Recipe
SwitchRecipe
lua
SwitchRecipe(recipe)Switches to the specified recipe.
Parameters
| Parameter | Type | Description |
|---|---|---|
| recipe | String | Name of the recipe |
Use Recipe
Assume there is a recipe file as follows:
json
{
"recipe": [
{
"pin": 1,
"PinHeight": 7.95,
"PinHeightMax": 0.5,
"PinHeightMin": 0.5,
"PinHeightSupply": 0,
"PinPositionX": 26.8,
"PinPositionXMax": 0.5,
"PinPositionXMin": 0.5,
"PinPositionXSupply": 0,
"PinPositionY": 8.8,
"PinPositionYMax": 0.5,
"PinPositionYMin": 0.5,
"PinPositionYSupply": 0,
"PinSideX": 3.5,
"PinSideXMax": 0.3,
"PinSideXMin": 0.3,
"PinSideY": 0,
"PinSideYMax": 0.3,
"PinSideYMin": 0.3,
"PinSideHight": 0,
"PinSideHightMax": 0.3,
"PinSideHightMin": 0.3
},
{
"pin": 2,
"PinHeight": 7.95,
"PinHeightMax": 0.5,
"PinHeightMin": 0.5,
"PinHeightSupply": 0,
"PinPositionX": 23.4,
"PinPositionXMax": 0.5,
"PinPositionXMin": 0.5,
"PinPositionXSupply": 0,
"PinPositionY": 8.8,
"PinPositionYMax": 0.5,
"PinPositionYMin": 0.5,
"PinPositionYSupply": 0,
"PinSideX": 3.5,
"PinSideXMax": 0.3,
"PinSideXMin": 0.3,
"PinSideY": 0,
"PinSideYMax": 0.3,
"PinSideYMin": 0.3,
"PinSideHight": 0,
"PinSideHightMax": 0.3,
"PinSideHightMin": 0.3
}
]
}To load the recipe using the Recipe Manager and retrieve the PinHeight parameter from the first set of parameters, use the following method:
lua
recipe = GetRecipeSet(0)
PinHeight0 = recipe.PinHeight
println(PinHeight0)Output:
7.95