Difference between revisions of "Module:Item Recipes/doc"

From Idlescape Wiki
Jump to navigation Jump to search
m (Better)
m (They see me stylin'...)
Line 1: Line 1:
For basic use of <code>Template:Item Recipes</code>, see [[Template:Item Recipes/doc]]
+
''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:
 
<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:

Revision as of 05:42, 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 the example above renders as:

IconNameSkill: LevelExperienceRecipe
Worm Composting Bin Crafting (Farming): 6750Filleted Fish x150, Fertilizer x1
Diced Fruit x150, Fertilizer x1
Chopped Vegetables x150, Fertilizer x1
Minced Meat x150, Fertilizer x1
Earth Rune Runecrafting: 125Rune Slate x1, Earth Essence x400
Scroll of Embers Scrollcrafting: 614,200Scroll x1, Silver x700, Fire Rune x70, Nature Rune x70
Stygian Bar Smithing: 601,500Stygian Ore x15, Ichor x5, Heat x500