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 = {' |
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, |
for j,wep in ipairs(weapons) do |
||
table.insert(allWeapons,{ |
table.insert(allWeapons,{page='[[' .. wep .. ']]'}) |
||
end |
end |
||
for i, |
for i,var in ipairs(variants) do |
||
for j, |
for j,wep in ipairs(weapons) do |
||
table.insert(allWeapons,{ |
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. |
local query = mw.smw.ask(item.page .. '|?Name #- = data|mainlabel=-') |
||
if type(query)=='table' then |
if type(query)=='table' then |
||
item. |
item.item = query[1].data |
||
end |
end |
||
local query = mw.smw.ask(item. |
local query = mw.smw.ask(item.page .. '|?Uses facility #- = data|mainlabel=-') |
||
if type(query)=='table' then |
if type(query)=='table' then |
||
item. |
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 |
:wikitext('Name of page') |
||
:done() |
:done() |
||
:tag('th') |
:tag('th') |
||
:wikitext('Item on page |
:wikitext('Item on page') |
||
:done() |
:done() |
||
:tag('th') |
:tag('th') |
||
:wikitext('Recipe Facility |
:wikitext('Recipe Facility') |
||
:done() |
:done() |
||
:tag('th') |
:tag('th') |
||
:wikitext(' |
:wikitext('Incorrect page names') |
||
:done() |
|||
:tag('th') |
|||
⚫ | |||
: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. |
:wikitext(item.page) |
||
:done() |
|||
:tag('td') |
|||
⚫ | |||
:done() |
|||
:tag('td') |
|||
:wikitext(item.suffixFacility) |
|||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:wikitext(item. |
:wikitext(item.item) |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:wikitext(item. |
:wikitext(item.facility) |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:wikitext(item. |
:wikitext(item.wrongPage1) |
||
⚫ | |||
⚫ | |||
:done() |
:done() |
||