Module:RecipeTreeSearch/doc: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
mNo edit summary |
m (update documentation for 19th dec changes) |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
{{Helper module|name=RecipeTreeSearch |
{{Helper module|name=RecipeTreeSearch |
||
|fname1=main(item) |
|fname1=main(item) |
||
|ftype1=name of an item page |
|ftype1=<code>item</code>: string, name of an item page |
||
|fuse1=Returns a Lua Table structured as a Recipe, but containing additional information about a multi-stage crafting process such including: |
|fuse1=Returns a Lua Table structured as a Recipe, but containing additional information about a multi-stage crafting process such including:<br> |
||
All base materials, including their buy price in shops |
All base materials, including their buy price in shops |
||
Line 10: | Line 10: | ||
Total values for XP, KP, duration |
Total values for XP, KP, duration |
||
|fname2=treeSearch(inputs) |
|fname2=treeSearch(inputs) |
||
|ftype2=table of name/quantity pairs for the inputs to a recipe |
|ftype2=<code>inputs</code>: table of name/quantity pairs, for the inputs to a recipe |
||
|fuse2=Use this function on the inputs to a recipe rather than the name of the output of a recipe. This allows the tree to be searched before the final recipe has been made. |
|fuse2=Use this function on the inputs to a recipe rather than the name of the output of a recipe. This allows the tree to be searched before the final recipe has been made. |
||
Line 16: | Line 16: | ||
Returns a the same structure Lua Table as main(), however it lacks any information on the final step. |
Returns a the same structure Lua Table as main(), however it lacks any information on the final step. |
||
|fname3 = getRecipe(item) |
|||
|ftype3 = <code>item</code>: string, name of an item page |
|||
|fuse3 = Returns the Lua Table of the Recipe for the single step.<br> |
|||
Will also find an activitiy which produce the item on the specified page.<br> |
|||
Will only ever return one recipe/activity, the one it finds first. |
|||
|fname4 = getShopBuyPrice(item) |
|||
|ftype4 = <code>item</code>: string, name of an item page |
|||
|fuse4 = Returns the value that the item can be bought at, or nil if it cannot be bought |
|||
|fname5 = getShopSellPrice(item) |
|||
|ftype5 = <code>item</code>: string, name of an item page |
|||
|fuse5 = Returns the value that the item can be sold for, or nil if it cannot be sold |
|||
}} |
}} |
Latest revision as of 01:51, 20 December 2024
Module:RecipeTreeSearch requires Module:Break Isolation.
Module:RecipeTreeSearch is required by Module:Infobox Recipe.
Module:RecipeTreeSearch is required by Module:LeatherworkerList.
Module:RecipeTreeSearch is required by Module:ProfessionList.
This module is a helper module to be used by other modules; it may not designed to be invoked directly. See Brighter Shores:Lua/Helper modules for a full list and more information.
Function | Type | Use |
---|---|---|
main(item) | item : string, name of an item page | Returns a Lua Table structured as a Recipe, but containing additional information about a multi-stage crafting process such including: All base materials, including their buy price in shops All intermediate materials, including both the number of materials and the number of times the crafting step needs to be performed Total values for XP, KP, duration |
treeSearch(inputs) | inputs : table of name/quantity pairs, for the inputs to a recipe | Use this function on the inputs to a recipe rather than the name of the output of a recipe. This allows the tree to be searched before the final recipe has been made.
IMPORTANT: within the Infobox Recipe that constructs a recipe, it is imporant to use this function instead of main(), so that this module will not attempt to use the recipe before it has been constructed. Returns a the same structure Lua Table as main(), however it lacks any information on the final step. |
getRecipe(item) | item : string, name of an item page | Returns the Lua Table of the Recipe for the single step. Will also find an activitiy which produce the item on the specified page. |
getShopBuyPrice(item) | item : string, name of an item page | Returns the value that the item can be bought at, or nil if it cannot be bought |
getShopSellPrice(item) | item : string, name of an item page | Returns the value that the item can be sold for, or nil if it cannot be sold |