Module:Sandbox/User:Alsang: Difference between revisions

no edit summary
(make table to check pages and recipes for stonemason)
No edit summary
Line 1:
p = {}
 
function p.main(args)
local variants = {'Basic','Moderate','Fine','Strong','Superior','Perfect'}
Line 14:
for i,item in ipairs(variants) do
for j,jtem in ipairs(weapons) do
table.insert(allWeapons,{namepagename=variants'[i[' .. weapons[j] .. ' (' .. weaponsvariants[ji] .. ')]]'})
table.insert(allWeapons,{name=weapons[j] .. ' (' .. variants[i] .. ')'})
end
end
Line 21 ⟶ 20:
for i,item in ipairs(allWeapons) do
local query = mw.smw.ask('[[Name::' .. item.namepagename .. ']]|?Uses facility #- = data|mainlabel=-')
if type(query)=='table' then
allWeapons[i].facility = query[1].data
end
local query = mw.smw.ask('[[Name::' .. item.namepagename .. ']]|?Activity XP #- = data|mainlabel=-')
if type(query)=='table' then
allWeapons[i].XP = query[1].data
end
local query = mw.smw.ask('[[Name::' .. item.namepagename .. ']]|?Activity duration #- = data|mainlabel=-')
if type(query)=='table' then
allWeapons[i].duration = query[1].data
end
local query = mw.smw.ask('[[Name::' .. item.namepagename .. ']]|?Activity KP #- = data|mainlabel=-')
if type(query)=='table' then
allWeapons[i].KP = query[1].data
end
local query = mw.smw.ask('[[Name::' .. item.namepagename .. ']]|?Recipe output #- = data|mainlabel=-')
if type(query)=='table' then
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
Line 49 ⟶ 54:
local out = mw.html.create('table')
out:addClass('wikitable sortable')
out:tag('thtr')
out:wikitexttag('Pageth')
out :donewikitext('Page')
out :tagdone('th')
out:wikitexttag('Outputth')
out :donewikitext('Name')
out :tagdone('th')
out:wikitexttag('Facilityth')
out :donewikitext('Output')
out :tagdone('th')
out:wikitexttag('XPth')
:wikitext('Facility')
out:done()
out :tagdone('th')
out:wikitexttag('KPth')
out :donewikitext('XP')
out :tagdone('th')
out:wikitexttag('durationth')
out :donewikitext('KP')
out :done()
:tag('th')
out:wikitext(allWeapons[i].'duration')
out:done()
out:done()
for i,item in ipairs(allWeapons) do
local row = out:tag('tdtr')
out:wikitexttag('[[' .. item.name .. ']]td')
:wikitext(item.pagename)
out:done()
out :tagdone('td')
:tag('td')
out:wikitext(allWeapons[i].output)
out :donewikitext(item.name)
out :tagdone('td')
:tag('td')
out:wikitext(allWeapons[i].facility)
out :donewikitext(item.output)
out :tagdone('td')
out:wikitexttag(allWeapons[i].XP'td')
out :wikitext(allWeapons[i]item.facility)
out:done()
out :tagdone('td')
out:wikitexttag(allWeapons[i].KP'td')
out :donewikitext(item.XP)
out :tagdone('td')
:tag('td')
out:wikitext(allWeapons[i].duration)
out :donewikitext(item.KP)
:done()
:tag('td')
:wikitext(item.duration)
:done()
:done()
:done()
end
11,305

edits