Module:Sandbox/User:Alsang: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(make table to check pages and recipes for stonemason) |
No edit summary |
||
Line 1: | Line 1: | ||
p = {} |
p = {} |
||
function p.main() |
function p.main(args) |
||
local variants = {'Basic','Moderate','Fine','Strong','Superior','Perfect'} |
local variants = {'Basic','Moderate','Fine','Strong','Superior','Perfect'} |
||
Line 14: | Line 14: | ||
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,{ |
table.insert(allWeapons,{pagename='[[' .. weapons[j] .. ' (' .. variants[i] .. ')]]'}) |
||
table.insert(allWeapons,{name=weapons[j] .. ' (' .. variants[i] .. ')'}) |
|||
end |
end |
||
end |
end |
||
Line 21: | Line 20: | ||
for i,item in ipairs(allWeapons) do |
for i,item in ipairs(allWeapons) do |
||
local query = mw.smw.ask( |
local query = mw.smw.ask(item.pagename .. '|?Uses facility #- = data|mainlabel=-') |
||
if type(query)=='table' then |
if type(query)=='table' then |
||
allWeapons[i].facility = query[1].data |
allWeapons[i].facility = query[1].data |
||
end |
end |
||
local query = mw.smw.ask( |
local query = mw.smw.ask(item.pagename .. '|?Activity XP #- = data|mainlabel=-') |
||
if type(query)=='table' then |
if type(query)=='table' then |
||
allWeapons[i].XP = query[1].data |
allWeapons[i].XP = query[1].data |
||
end |
end |
||
local query = mw.smw.ask( |
local query = mw.smw.ask(item.pagename .. '|?Activity duration #- = data|mainlabel=-') |
||
if type(query)=='table' then |
if type(query)=='table' then |
||
allWeapons[i].duration = query[1].data |
allWeapons[i].duration = query[1].data |
||
end |
end |
||
local query = mw.smw.ask( |
local query = mw.smw.ask(item.pagename .. '|?Activity KP #- = data|mainlabel=-') |
||
if type(query)=='table' then |
if type(query)=='table' then |
||
allWeapons[i].KP = query[1].data |
allWeapons[i].KP = query[1].data |
||
end |
end |
||
local query = mw.smw.ask( |
local query = mw.smw.ask(item.pagename .. '|?Recipe output #- = data|mainlabel=-') |
||
if type(query)=='table' then |
if type(query)=='table' then |
||
allWeapons[i].output = query[1].data |
allWeapons[i].output = query[1].data |
||
end |
|||
local query = mw.smw.ask(item.pagename .. '|?Name #- = data|mainlabel=-') |
|||
if type(query)=='table' then |
|||
allWeapons[i].name = query[1].data |
|||
end |
end |
||
Line 49: | Line 54: | ||
local out = mw.html.create('table') |
local out = mw.html.create('table') |
||
:addClass('wikitable sortable') |
|||
:tag('tr') |
|||
:tag('th') |
|||
:wikitext('Page') |
|||
:done() |
|||
:tag('th') |
|||
:wikitext('Name') |
|||
:done() |
|||
:tag('th') |
|||
:wikitext('Output') |
|||
:done() |
|||
:tag('th') |
|||
:wikitext('Facility') |
|||
⚫ | |||
:done() |
|||
:tag('th') |
|||
:wikitext('XP') |
|||
:done() |
|||
:tag('th') |
|||
:wikitext('KP') |
|||
⚫ | |||
:tag('th') |
|||
⚫ | |||
⚫ | |||
⚫ | |||
for i,item in ipairs(allWeapons) do |
for i,item in ipairs(allWeapons) do |
||
out:tag(' |
local row = out:tag('tr') |
||
:tag('td') |
|||
:wikitext(item.pagename) |
|||
⚫ | |||
:done() |
|||
:tag('td') |
|||
out:wikitext(allWeapons[i].output) |
|||
:wikitext(item.name) |
|||
:done() |
|||
:tag('td') |
|||
⚫ | |||
:wikitext(item.output) |
|||
:done() |
|||
:tag('td') |
|||
⚫ | |||
⚫ | |||
:done() |
|||
:tag('td') |
|||
:wikitext(item.XP) |
|||
:done() |
|||
:tag('td') |
|||
⚫ | |||
:wikitext(item.KP) |
|||
:done() |
|||
:tag('td') |
|||
:wikitext(item.duration) |
|||
:done() |
|||
:done() |
|||
:done() |
|||
end |
end |
||