User Tools

Site Tools


recipes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
recipes [2020/06/01 15:00] – [Using recipe on the dashboard] emozolyakrecipes [2020/06/01 15:13] – [Using recipes in scripts] emozolyak
Line 58: Line 58:
 ===== Using recipes in scripts ===== ===== Using recipes in scripts =====
  
-To apply recipes within scripts, the **ApplyRecipe (recipeId, userId)** function is used. [[working_with_recipes|See here]]. After it is executed, if a list is displayed on one of the dashboards, the contents of the recipe from the ApplyRecipe functionyou must also write the recipe number in the register tied to the list - to synchronize the display of the list.+To apply recipes within scripts, the **ApplyRecipe (recipeId, userId)** function is used. [[working_with_recipes|See here]]. The example of such script: 
 + 
 +<code lua> 
 +function main (userId) 
 +    local id = GetReg("rcpSelector"
 +    ApplyRecipe(iduserId) 
 +    AddInfoMessage("The recipe with id = " .. id .. " was applied!"
 +end 
 +</code> 
 + 
 +{{ recipe_in_scripts.gif?600 |}}
recipes.txt · Last modified: 2022/01/15 15:41 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki