Module:Sandbox/User:Alsang: Difference between revisions
starting to work
No edit summary |
(starting to work) |
||
Line 34:
limit = 500
end
-- Query for data
local smw_data = mw.smw.ask{
'[[Uses item::' .. item .. ']] OR [[Activity input::' .. item .. ']] OR [[Activity
'?
'?Activity JSON',
showValues and '?Value',
Line 52:
local produced_items = {}
for _, product in ipairs(smw_data) do
local jsons = product['Recipe JSON'] or product['Activity JSON']
if type(jsons) == 'string' then
jsons = { jsons }
Line 61:
json.Value = product.Value
-- Filter out when this item isn't actually used (Will happen on pages with multiple recipes)
table.insert(parsed, json)
end
table.sort(parsed, recipe_sort)
|