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 Inputcontainer::' .. item .. ']]',
'?ActivityRecipe InputJSON',
'?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)
-- if Array.any(json.materials, function(mat) -- Bypass this for now will need to address this before going live
-- return mat.name == item
-- end) then
table.insert(parsed, json)
-- end
end
table.sort(parsed, recipe_sort)
11,305

edits