Module:Sandbox/User:Alsang: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 19: Line 19:
function p.makeTable(args)
function p.makeTable(args)
local variants = {'Basic','Moderate','Fine','Strong','Superior','Perfect'}
local variants = {'basic','moderate','fine','strong','superior','perfect'}
local variants2 = {'Basic','Moderate','Fine','Strong','Superior','Perfect'}
local weaponsStone = {
local weaponsStone = {
'Hammerfist',
'Hammerfist',
Line 81: Line 82:
local allWeapons = {}
local allWeapons = {}
for j,jtem in ipairs(weapons) do
for j,wep in ipairs(weapons) do
table.insert(allWeapons,{suffixPage='[[' .. jtem .. ']]',prefixPage=''})
table.insert(allWeapons,{page='[[' .. wep .. ']]'})
end
end


for i,item in ipairs(variants) do
for i,var in ipairs(variants) do
for j,jtem in ipairs(weapons) do
for j,wep in ipairs(weapons) do
table.insert(allWeapons,{suffixPage='[[' .. jtem .. ' (' .. item .. ')]]',prefixPage='[[' .. item .. ' ' .. jtem .. ']]'})
table.insert(allWeapons,{page='[[' .. wep .. ' (' .. var .. ')]]',wrongPage1='[[' .. wep .. ' (' .. variants2[1] .. ')]]',wrongPage2='[[' .. var .. ' ' .. wep .. ']]'})
end
end
end
end
for i,item in ipairs(allWeapons) do
for i,item in ipairs(allWeapons) do
local query = mw.smw.ask(item.suffixPage .. '|?Name #- = data|mainlabel=-')
local query = mw.smw.ask(item.page .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
if type(query)=='table' then
item.suffixItem = query[1].data
item.item = query[1].data
end
end
local query = mw.smw.ask(item.suffixPage .. '|?Uses facility #- = data|mainlabel=-')
local query = mw.smw.ask(item.page .. '|?Uses facility #- = data|mainlabel=-')
if type(query)=='table' then
if type(query)=='table' then
item.suffixFacility = query[1].data
item.facility = query[1].data
end
local query = mw.smw.ask(item.prefixPage .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
item.prefixItem = query[1].data
end
local query = mw.smw.ask(item.prefixPage .. '|?Uses facility #- = data|mainlabel=-')
if type(query)=='table' then
item.prefixFacility = query[1].data
end
end
Line 118: Line 110:
:tag('tr')
:tag('tr')
:tag('th')
:tag('th')
:wikitext('Name of page (suffix)')
:wikitext('Name of page')
:done()
:done()
:tag('th')
:tag('th')
:wikitext('Item on page (suffix)')
:wikitext('Item on page')
:done()
:done()
:tag('th')
:tag('th')
:wikitext('Recipe Facility (suffix)')
:wikitext('Recipe Facility')
:done()
:done()
:tag('th')
:tag('th')
:wikitext('Name of page (prefix)')
:wikitext('Incorrect page names')
:done()
:tag('th')
:wikitext('Item on page (prefix)')
:done()
:tag('th')
:wikitext('Recipe Facility (prefix)')
:done()
:done()
:done()
:done()
Line 140: Line 126:
local row = out:tag('tr')
local row = out:tag('tr')
:tag('td')
:tag('td')
:wikitext(item.suffixPage)
:wikitext(item.page)
:done()
:tag('td')
:wikitext(item.suffixItem)
:done()
:tag('td')
:wikitext(item.suffixFacility)
:done()
:done()
:tag('td')
:tag('td')
:wikitext(item.prefixPage)
:wikitext(item.item)
:done()
:done()
:tag('td')
:tag('td')
:wikitext(item.prefixItem)
:wikitext(item.facility)
:done()
:done()
:tag('td')
:tag('td')
:wikitext(item.prefixFacility)
:wikitext(item.wrongPage1)
:wikitext('<br>')
:wikitext(item.wrongPage2)
:done()
:done()