Module:Sandbox/User:Alsang: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 19:
function p.makeTable(args)
local variants = {'Basicbasic','Moderatemoderate','Finefine','Strongstrong','Superiorsuperior','Perfectperfect'}
local variants2 = {'Basic','Moderate','Fine','Strong','Superior','Perfect'}
local weaponsStone = {
'Hammerfist',
Line 81 ⟶ 82:
local allWeapons = {}
for j,jtemwep in ipairs(weapons) do
table.insert(allWeapons,{suffixPagepage='[[' .. jtemwep .. ']]',prefixPage=''})
end
 
for i,itemvar in ipairs(variants) do
for j,jtemwep in ipairs(weapons) do
table.insert(allWeapons,{suffixPagepage='[[' .. jtemwep .. ' (' .. itemvar .. ')]]',prefixPagewrongPage1='[[' .. itemwep .. ' (' .. variants2[1] .. ')]]',wrongPage2='[[' .. var .. ' ' .. jtemwep .. ']]'})
end
end
for i,item in ipairs(allWeapons) do
local query = mw.smw.ask(item.suffixPagepage .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
item.suffixItemitem = query[1].data
end
local query = mw.smw.ask(item.suffixPagepage .. '|?Uses facility #- = data|mainlabel=-')
if type(query)=='table' then
item.suffixFacilityfacility = 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
Line 118 ⟶ 110:
:tag('tr')
:tag('th')
:wikitext('Name of page (suffix)')
:done()
:tag('th')
:wikitext('Item on page (suffix)')
:done()
:tag('th')
:wikitext('Recipe Facility (suffix)')
:done()
:tag('th')
:wikitext('Name ofIncorrect page (prefix)names')
:done()
:tag('th')
:wikitext('Item on page (prefix)')
:done()
:tag('th')
:wikitext('Recipe Facility (prefix)')
:done()
:done()
Line 140 ⟶ 126:
local row = out:tag('tr')
:tag('td')
:wikitext(item.suffixPagepage)
:done()
:tag('td')
:wikitext(item.suffixItem)
:done()
:tag('td')
:wikitext(item.suffixFacility)
:done()
:tag('td')
:wikitext(item.prefixPageitem)
:done()
:tag('td')
:wikitext(item.prefixItemfacility)
:done()
:tag('td')
:wikitext(item.prefixFacilitywrongPage1)
:wikitext('Item on page (prefix)<br>')
:wikitext(item.suffixItemwrongPage2)
:done()
13,097

edits