Module:Sandbox/User:Alsang: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 79:
end
local allWeapons = {}
for j,jtem in ipairs(weapons) do
table.insert(allWeapons,{suffixPage='[[' .. jtem .. ']]',prefixPage=''})
end
 
for i,item in ipairs(variants) do
for j,jtem in ipairs(weapons) do
table.insert(allWeapons,{pagenamesuffixPage='[[' .. jtem .. ' (' .. item .. ')]]',wrongnameprefixPage='[[' .. item .. ' ' .. jtem .. ']]'})
end
end
 
for i,item in ipairs(allWeapons) do
local query = mw.smw.ask(item.pagenamesuffixPage .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
item.itemnamesuffixItem = query[1].data
end
local query = mw.smw.ask(item.pagenamesuffixPage .. '|?Uses facility #- = data|mainlabel=-')
if type(query)=='table' then
item.facilitysuffixFacility = query[1].data
end
local query = mw.smw.ask(item.wrongnameprefixPage .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
item.wrongitemnameprefixItem = query[1].data
end
local query = mw.smw.ask(item.wrongnameprefixPage .. '|?Uses facility #- = data|mainlabel=-')
if type(query)=='table' then
item.wrongfacilityprefixFacility = query[1].data
end
Line 114 ⟶ 118:
:tag('tr')
:tag('th')
:wikitext('Suffix PagenamesuffixPage')
:done()
:tag('th')
:wikitext('Suffix ItemnamesuffixItem')
:done()
:tag('th')
Line 123 ⟶ 127:
:done()
:tag('th')
:wikitext('Prefix PagenamesuffixPage')
:done()
:tag('th')
:wikitext('Prefix ItemnamesuffixItem')
:done()
:tag('th')
Line 136 ⟶ 140:
local row = out:tag('tr')
:tag('td')
:wikitext(item.pagenamesuffixPage)
:done()
:tag('td')
:wikitext(item.itemnamesuffixItem)
:done()
:tag('td')
:wikitext(item.facilitysuffixFacility)
:done()
:tag('td')
:wikitext(item.wrongnameprefixPage)
:done()
:tag('td')
:wikitext(item.wrongitemnameprefixItem)
:done()
:tag('td')
:wikitext(item.wrongfacilityprefixFacility)
:done()
12,633

edits