Module:Sandbox/User:Alsang: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 474:
:tag('td')
:wikitext(item.facility)
:done()
:tag('td')
:wikitext(item.XP)
:done()
:tag('td')
:wikitext(item.KP)
:done()
:tag('td')
:wikitext(item.duration)
:done()
:done()
:done()
end
return out
--for debugging
--return '<pre>'..mw.text.jsonEncode(allWeapons, mw.text.JSON_PRETTY)..'</pre>'
end
 
function p.metalgoods()
allJewels = {
{pagename = '[[Bangle Shinerium Jewelry]]', lvl = 20, tablematerial = '[[Softglow Shinerium]]'},
{pagename = '[[Locket Shinerium Jewelry]]', lvl = 26, tablematerial = '[[Softglow Shinerium]]'},
{pagename = '[[Circlet Shinerium Jewelry]]', lvl = 32, tablematerial = '[[Glitterstream Shinerium]]'},
{pagename = '[[Bangle Silver Jewelry]]', lvl = 39, tablematerial = '[[Winterspirit Silver]]'},
{pagename = '[[Locket Silver Jewelry]]', lvl = 43, tablematerial = '[[Winterspirit Silver]]'},
{pagename = '[[Earrings Shinerium Jewelry]]', lvl = 49, tablematerial = '[[Glitterstream Shinerium]]'},
{pagename = '[[Pendant Shinerium Jewelry]]', lvl = 56, tablematerial = '[[Firefly Shinerium]]'},
{pagename = '[[Necklace Shinerium Jewelry]]', lvl = 60, tablematerial = '[[Firefly Shinerium]]'},
{pagename = '[[Earrings Silver Jewelry]]', lvl = 67, tablematerial = '[[Brightspire Silver]]'},
{pagename = '[[Locket Gold Jewelry]]', lvl = 73, tablematerial = '[[Hearthlight Gold]]'},
{pagename = '[[Necklace Silver Jewelry]]', lvl = 77, tablematerial = '[[Brightspire Silver]]'},
{pagename = '[[Earrings Gold Jewelry]]', lvl = 84, tablematerial = '[[Hearthlight Gold]]'},
{pagename = '[[Circlet Silver Jewelry]]', lvl = 90, tablematerial = '[[Gallant Silver]]'},
{pagename = '[[Ring Shinerium Jewelry]]', lvl = 95, tablematerial = '[[Resplendent Shinerium]]'},
{pagename = '[[Choker Shinerium Jewelry]]', lvl = 101, tablematerial = '[[Resplendent Shinerium]]'},
{pagename = '[[Earrings Purpladium Jewelry]]', lvl = 107, tablematerial = '[[Violet Purpladium]]'},
{pagename = '[[Ring Silver Jewelry]]', lvl = 112, tablematerial = '[[Gallant Silver]]'},
{pagename = '[[Pendant Silver Jewelry]]', lvl = 118, tablematerial = '[[Fullmoon Silver]]'},
{pagename = '[[Bangle Gold Jewelry]]', lvl = 122, tablematerial = '[[Lionsmane Gold]]'},
{pagename = '[[Ring Gold Jewelry]]', lvl = 129, tablematerial = '[[Lionsmane Gold]]'},
{pagename = '[[Choker Silver Jewelry]]', lvl = 135, tablematerial = '[[Fullmoon Silver]]'},
{pagename = '[[Necklace Gold Jewelry]]', lvl = 140, tablematerial = '[[Hightower Gold]]'},
{pagename = '[[Ring Purpladium Jewelry]]', lvl = 146, tablematerial = '[[Violet Purpladium]]'},
{pagename = '[[Bracelet Shinerium Jewelry]]', lvl = 152, tablematerial = '[[Lastwish Shinerium]]'},
{pagename = '[[Signet Ring Shinerium Jewelry]]', lvl = 157, tablematerial = '[[Lastwish Shinerium]]'},
{pagename = '[[Choker Gold Jewelry]]', lvl = 163, tablematerial = '[[Hightower Gold]]'},
{pagename = '[[Locket Purpladium Jewelry]]', lvl = 169, tablematerial = '[[Mulberry Purpladium]]'},
{pagename = '[[Bracelet Silver Jewelry]]', lvl = 174, tablematerial = '[[Whitestar Silver]]'},
{pagename = '[[Signet Ring Silver Jewelry]]', lvl = 180, tablematerial = '[[Whitestar Silver]]'},
{pagename = '[[Choker Purpladium Jewelry]]', lvl = 187, tablematerial = '[[Mulberry Purpladium]]'},
{pagename = '[[Cuff Links Shinerium Jewelry]]', lvl = 191, tablematerial = '[[Constellation Shinerium]]'},
{pagename = '[[Bracelet Gold Jewelry]]', lvl = 197, tablematerial = '[[Morningsun Gold]]'},
{pagename = '[[Signet Ring Gold Jewelry]]', lvl = 206},
{pagename = '[[Brooch Shinerium Jewelry]]', lvl = 226},
{pagename = '[[Necklace Purpladium Jewelry]]', lvl = 247},
{pagename = '[[Circlet Gold Jewelry]]', lvl = 260},
{pagename = '[[Bangle Purpladium Jewelry]]', lvl = 280},
{pagename = '[[Pendant Gold Jewelry]]', lvl = 301},
{pagename = '[[Cuff Links Silver Jewelry]]', lvl = 314},
{pagename = '[[Brooch Silver Jewelry]]', lvl = 334},
{pagename = '[[Signet Ring Purpladium Jewelry]]', lvl = 355},
{pagename = '[[Bracelet Purpladium Jewelry]]', lvl = 368},
{pagename = '[[Circlet Purpladium Jewelry]]', lvl = 388},
{pagename = '[[Brooch Gold Jewelry]]', lvl = 409},
{pagename = '[[Cuff Links Gold Jewelry]]', lvl = 422},
{pagename = '[[Pendant Purpladium Jewelry]]', lvl = 442},
{pagename = '[[Brooch Purpladium Jewelry]]', lvl = 463},
{pagename = '[[Cuff Links Purpladium Jewelry]]', lvl = 476},
 
}
 
for i,item in ipairs(allJewels) do
local query = mw.smw.ask(item.pagename .. '|?Uses facility #- = data|mainlabel=-')
if type(query)=='table' then
item.facility = query[1].data
end
local query = mw.smw.ask(item.pagename .. '|?Activity XP #- = data|mainlabel=-')
if type(query)=='table' then
item.XP = query[1].data
end
local query = mw.smw.ask(item.pagename .. '|?Activity duration #- = data|mainlabel=-')
if type(query)=='table' then
item.duration = query[1].data
end
local query = mw.smw.ask(item.pagename .. '|?Activity KP #- = data|mainlabel=-')
if type(query)=='table' then
item.KP = query[1].data
end
local query = mw.smw.ask(item.pagename .. '|?Recipe output #- = data|mainlabel=-')
if type(query)=='table' then
item.output = query[1].data
end
local query = mw.smw.ask(item.pagename .. '|?Uses item #- = data|mainlabel=-')
if type(query)=='table' then
item.input = query[1].data
end
local query = mw.smw.ask(item.pagename .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
item.name = query[1].data
end
local query = mw.smw.ask(item.pagename .. '|?Profession Level A #- = data|mainlabel=-')
if type(query)=='table' then
item.recipelvl = query[1].data
end
end
local out = mw.html.create('table')
:addClass('wikitable sortable')
:tag('tr')
:tag('th')
:wikitext('Page name')
:done()
:tag('th')
:wikitext('table lvl')
:done()
:tag('th')
:wikitext('Table resource')
:done()
:tag('th')
:wikitext('Item name')
:done()
:tag('th')
:wikitext('Recipe Output')
:done()
:tag('th')
:wikitext('Recipe Resource')
:done()
:tag('th')
:wikitext('Facility')
:done()
:tag('th')
:wikitext('Item lvl')
:done()
:tag('th')
:wikitext('XP')
:done()
:tag('th')
:wikitext('KP')
:done()
:tag('th')
:wikitext('duration')
:done()
:done()
for i,item in ipairs(allJewels) do
local row = out:tag('tr')
:tag('td')
:wikitext(item.pagename)
:done()
:tag('td')
:wikitext(item.lvl)
:done()
:tag('td')
:wikitext(item.tablematerial)
:done()
:tag('td')
:wikitext(item.name)
:done()
:tag('td')
:wikitext(item.output)
:done()
:tag('td')
:wikitext(item.input[1])
:done()
:tag('td')
:wikitext(item.facility)
:done()
:tag('td')
:wikitext(item.recipelvl)
:done()
:tag('td')
11,756

edits