Module:Sandbox/User:Alsang: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
Line 87:
function p.intermediates()
local allRecipes = mw.smw.ask('[[Recipe JSON::~*]]|? #- = name|?Uses facility = facility|?-Sold item.Sold by #- = seller|?Variant of = variant|limit=1200')
local allFacilities = {'Standard Potion Station',
Line 110:
'Jewelry Bench'}
local allShops = {'Head Chef (shop)','Timber Merchant Shop','Leather stall','Leather Goods','Waiter'}
local intermediateRecipes = {}
for
intermediate = true
-- check facility
for
if item.facility==facility then
intermediate = false
Line 124:
-- check shops
for
if item.seller==shop then
intermediate = false
end
if type(item.seller)=='table' then
for _,seller in ipairs(item.seller) do
if seller==shop then
intermediate = false
end
end
end
end
Line 132 ⟶ 139:
end
if intermediate then
table.insert(intermediateRecipes,item
end
Line 142 ⟶ 149:
:tag('th')
:wikitext('Page')
:done()
:tag('th')
:wikitext('Variant')
:done()
:done()
Line 148 ⟶ 158:
local row = out:tag('tr')
:tag('td')
:wikitext('[[' .. item.name .. ']]')
:done()
:tag('td')
:wikitext(item.variant)
:done()
:done()
|