Difference between revisions of "Module:Item Recipes/doc"
Jump to navigation
Jump to search
(Add to Category:Module) |
(Add documentation for named argument 'ids') |
||
| Line 1: | Line 1: | ||
| + | For basic use of <code>Template:Item Recipes</code>, see [[Template:Item Recipes/doc]] | ||
| + | |||
| + | <code>Module:Item Recipes</code> supports the use of named argument <code>ids</code>. Using this argument, a table with item ids can be passed: | ||
| + | <pre><nowiki> | ||
| + | local itemRecipes = require('Module:Item Recipes') | ||
| + | local tbl = { | ||
| + | { ['id'] = 4510}, | ||
| + | { ['id'] = 511}, | ||
| + | { ['id'] = 1601}, | ||
| + | { ['id'] = 207}, | ||
| + | } | ||
| + | local html = itemRecipes._itemRecipes({['ids'] = tbl}) | ||
| + | </nowiki></pre> | ||
| + | |||
| + | The variable <code>html</code> holds a <code>mw.html</code> table and can be returned as template output. The table in this example renders as: | ||
| + | |||
| + | {{Item Recipes| | ||
| + | Worm Composting Bin; | ||
| + | Earth Rune; | ||
| + | Scroll of Embers; | ||
| + | Stygian Bar; | ||
| + | }} | ||
| + | |||
[[Category:Module]] | [[Category:Module]] | ||
Revision as of 05:33, 25 April 2025
For basic use of Template:Item Recipes, see Template:Item Recipes/doc
Module:Item Recipes supports the use of named argument ids. Using this argument, a table with item ids can be passed:
local itemRecipes = require('Module:Item Recipes')
local tbl = {
{ ['id'] = 4510},
{ ['id'] = 511},
{ ['id'] = 1601},
{ ['id'] = 207},
}
local html = itemRecipes._itemRecipes({['ids'] = tbl})
The variable html holds a mw.html table and can be returned as template output. The table in this example renders as:
| Icon | Name | Skill: Level | Experience | Recipe |
|---|---|---|---|---|
![]() | Worm Composting Bin | 750 | x150, x1 | |
x150, x1 | ||||
x150, x1 | ||||
x150, x1 | ||||
![]() | Earth Rune | 25 | x1, x400 | |
![]() | Scroll of Embers | Scrollcrafting: 61 | 4,200 | x1, x700, x70, x70 |
![]() | Stygian Bar | 1,500 | x15, x5, |










Scrollcrafting





