Editing Module:Sandbox/User:Alsang
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
local p = {} |
local p = {} |
||
function p. |
function p.gathererPages1() |
||
local queryString = '[[Variant of::Globeplant||Dandelion||Apple||Haleberries||Chestnut||Catkin||Clover||Snake Scale||Orchid||Dock Leaf||Sage||Thistle]]' |
|||
return p.main(queryString) |
|||
end |
|||
function p.gathererPages2() |
|||
⚫ | |||
local queryString = '[[Variant of::Bone Spike||Femur Shard||Goat Horn||Rams Horn]]' |
|||
return p.main(queryString) |
|||
end |
|||
function p.gathererPages3() |
|||
local queryString = '[[Variant of::Leek||Bitterfruit||Tangfruit]]' |
|||
return p.main(queryString) |
|||
end |
|||
function p.main(queryString) |
|||
local query = { |
|||
queryString, |
|||
'? #- = name', |
|||
'?Profession Level A = level', |
|||
'?Variant of #-= variant', |
|||
'sort = Variant of,Profession Level A', |
|||
'limit = 500' |
|||
} |
|||
local results = mw.smw.ask(query) |
|||
for _,page in ipairs(results) do |
|||
if string.find(page.name,'Mine') then |
|||
page.node = page.name |
|||
page.nodevar = page.variant |
|||
else |
|||
page.node = page.name .. ' (skill node)' |
|||
page.nodevar = page.variant .. ' (skill node)' |
|||
end |
|||
local result = mw.smw.ask('[['..page.node..']]|?Activity JSON = data') |
|||
page.JSON = (result and result[1] and result[1].data) or '' |
|||
if type(page.JSON)=='table' then |
|||
page.JSON = table.concat(page.JSON,'<br>') |
|||
end |
|||
end |
|||
local out = mw.html.create('table') |
|||
:addClass('wikitable sortable') |
|||
:tag('tr') |
|||
:tag('th') |
|||
:wikitext('Variant') |
|||
:done() |
|||
:tag('th') |
|||
:wikitext('Node Variant') |
|||
:done() |
|||
:tag('th') |
|||
:wikitext('Level') |
|||
:done() |
|||
:tag('th') |
|||
:wikitext('Page') |
|||
:done() |
|||
:tag('th') |
|||
:wikitext('Node') |
|||
:done() |
|||
:tag('th') |
|||
:wikitext('Node JSON') |
|||
:done() |
|||
:done() |
|||
for i, item in ipairs(results) do |
|||
local row = out:tag('tr') |
|||
--level |
|||
:tag('td') |
|||
:wikitext('[['..item.variant..']]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[['..item.nodevar..']]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext(item.level) |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[['..item.name..']]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext('[['..item.node..']]') |
|||
:done() |
|||
:tag('td') |
|||
:wikitext(item.JSON) |
|||
:done() |
|||
end |
|||
⚫ | |||
end |
end |
||