No edit summary |
No edit summary |
||
| Line 51: | Line 51: | ||
|- | |- | ||
|]] .. '[[File: ' .. e.itemImage .. '.png|35px|link=' .. e. | |]] .. '[[File: ' .. e.itemImage .. '.png|35px|link=' .. e.item .. ']]' .. [[ | ||
|]] .. '[[' .. e. | |]] .. '[[' .. e.item .. ']]' .. [[ | ||
|]] .. e.level .. '[[File:CraftingSigil.png|20px|link=]]' .. [[ | |]] .. e.level .. '[[File:CraftingSigil.png|20px|link=]]' .. [[ | ||
Revision as of 15:50, 16 April 2024
This module uses the data from Module:Crafting_DB to create a exhibition of all the craftable items of the game
{{#invoke:Lua|crafting}}
Lua error in Module:Lua at line 100: attempt to call field 'craftingTable' (a nil value).
u = require("Module:Util")
db = require("Module:Crafting_DB")
inspect = require("Module:InspectLua")
local p = {}
function p.furnace()
recipes = {}
for _, e in ipairs(db) do
local itemName = e[1]
if not recipes[itemName] then
recipes[itemName] = {
item = itemName,
itemImage = e[2],
level = e[3],
description = e[7],
xp = e[4],
materials = {}
}
end
for _, f in ipairs(e[5]) do
table.insert(recipes[itemName].materials, f)
end
end
result = [[
{| class="wikitable"
! colspan="2" style="width: 30%" |Item
!]] .. inspect(recipes) .. [[
! style="width: 20%" |Materials
! style="width: 25%" |Description
!XP
]]
for _, e in pairs(recipes) do
local materialStr = ''
for i, m in ipairs(e.materials) do
materialStr = materialStr .. m[2] .. " " .. m[1]
end
result = result .. [[
|-
|]] .. '[[File: ' .. e.itemImage .. '.png|35px|link=' .. e.item .. ']]' .. [[
|]] .. '[[' .. e.item .. ']]' .. [[
|]] .. e.level .. '[[File:CraftingSigil.png|20px|link=]]' .. [[
|]] .. materialStr .. [[
|]] .. inspect(recipes) .. [[
|]] .. e.xp .. 'xp' .. [[
]]
end
return result .. [[
|}
]]
end
return p