Module:Sandbox/User:Alsang: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 79: Line 79:
end
end
local allWeapons = {}
local allWeapons = {}
for j,jtem in ipairs(weapons) do
table.insert(allWeapons,{suffixPage='[[' .. jtem .. ']]',prefixPage=''})
end

for i,item in ipairs(variants) do
for i,item in ipairs(variants) do
for j,jtem in ipairs(weapons) do
for j,jtem in ipairs(weapons) do
table.insert(allWeapons,{pagename='[[' .. jtem .. ' (' .. item .. ')]]',wrongname='[[' .. item .. ' ' .. jtem .. ']]'})
table.insert(allWeapons,{suffixPage='[[' .. jtem .. ' (' .. item .. ')]]',prefixPage='[[' .. item .. ' ' .. jtem .. ']]'})
end
end
end
end

for i,item in ipairs(allWeapons) do
for i,item in ipairs(allWeapons) do
local query = mw.smw.ask(item.pagename .. '|?Name #- = data|mainlabel=-')
local query = mw.smw.ask(item.suffixPage .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
if type(query)=='table' then
item.itemname = query[1].data
item.suffixItem = query[1].data
end
end
local query = mw.smw.ask(item.pagename .. '|?Uses facility #- = data|mainlabel=-')
local query = mw.smw.ask(item.suffixPage .. '|?Uses facility #- = data|mainlabel=-')
if type(query)=='table' then
if type(query)=='table' then
item.facility = query[1].data
item.suffixFacility = query[1].data
end
end
local query = mw.smw.ask(item.wrongname .. '|?Name #- = data|mainlabel=-')
local query = mw.smw.ask(item.prefixPage .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
if type(query)=='table' then
item.wrongitemname = query[1].data
item.prefixItem = query[1].data
end
end
local query = mw.smw.ask(item.wrongname .. '|?Uses facility #- = data|mainlabel=-')
local query = mw.smw.ask(item.prefixPage .. '|?Uses facility #- = data|mainlabel=-')
if type(query)=='table' then
if type(query)=='table' then
item.wrongfacility = query[1].data
item.prefixFacility = query[1].data
end
end
Line 114: Line 118:
:tag('tr')
:tag('tr')
:tag('th')
:tag('th')
:wikitext('Suffix Pagename')
:wikitext('Suffix suffixPage')
:done()
:done()
:tag('th')
:tag('th')
:wikitext('Suffix Itemname')
:wikitext('Suffix suffixItem')
:done()
:done()
:tag('th')
:tag('th')
Line 123: Line 127:
:done()
:done()
:tag('th')
:tag('th')
:wikitext('Prefix Pagename')
:wikitext('Prefix suffixPage')
:done()
:done()
:tag('th')
:tag('th')
:wikitext('Prefix Itemname')
:wikitext('Prefix suffixItem')
:done()
:done()
:tag('th')
:tag('th')
Line 136: Line 140:
local row = out:tag('tr')
local row = out:tag('tr')
:tag('td')
:tag('td')
:wikitext(item.pagename)
:wikitext(item.suffixPage)
:done()
:done()
:tag('td')
:tag('td')
:wikitext(item.itemname)
:wikitext(item.suffixItem)
:done()
:done()
:tag('td')
:tag('td')
:wikitext(item.facility)
:wikitext(item.suffixFacility)
:done()
:done()
:tag('td')
:tag('td')
:wikitext(item.wrongname)
:wikitext(item.prefixPage)
:done()
:done()
:tag('td')
:tag('td')
:wikitext(item.wrongitemname)
:wikitext(item.prefixItem)
:done()
:done()
:tag('td')
:tag('td')
:wikitext(item.wrongfacility)
:wikitext(item.prefixFacility)
:done()
:done()