Module:Sandbox/User:Alsang: Difference between revisions

no edit summary
(remove completed lists)
Tag: Manual revert
No edit summary
Line 4:
local variants = {'Basic','Moderate','Fine','Strong','Superior','Perfect'}
local weaponsStone = {
local weapons1 = {'Hammerfist','Throwing Stones','Stone Slab Shield',
'Hammerfist',
'Stone Mace','Stone Discs','War Hammer',
'Throwing Stones',
'Bolas','Stone Chunk Shield','Double Headed Hammer',
'Throwing Clubs','Great Stone Mace',' Polished StoneSlab Shield',
'Stone Mace',
'Throwing Hammers','Great Hammer','Sling'}
'Stone Discs',
local weapons2 = {'Hammerfist','Throwing Stones','Stone Slab Shield',
'Stone Mace','Stone Discs','War Hammer',
'Bolas',
'Bolas','Stone Chunk Shield','Double Headed Hammer',
'Throwing Clubs','Great Stone Mace',' Polished StoneChunk Shield',
'ThrowingDouble Hammers','GreatHeaded Hammer','Sling'}
'Throwing Clubs',
local weapons3 = {'Hammerfist','Throwing Stones','Stone Slab Shield',
'Great Stone Mace','Stone Discs','War Hammer',
'Bolas',' Polished Stone Chunk Shield','Double Headed Hammer',
'Throwing Clubs','Great Stone Mace',' Polished Stone ShieldHammers',
'Throwing Hammers','Great Hammer','Sling'}
'Sling'}
local weaponsMetal = {
weapons = weapons1
'Rapier ',
'Throwing Twinblades',
'Metal Kite Shield',
'Flanged Mace',
'Throwing Rings',
'Shortsword',
'Metal Javelins',
'Metal Heater Shield',
'Longsword',
'Throwing Knives',
'Broadsword',
'Metal Buckler',
'Throwing Axes',
'Battleaxe',
'Metal Bow'}
local weaponsBone = {
'Truncheon',
'Blowpipe',
'Wooden Round Shield',
'Cudgel',
'Javelins',
'Club',
'Light Crossbow',
'Wooden Square Shield',
'Quarterstaff',
'Recurve Bow',
'Spear',
'Wooden Hexagon Shield',
'Longbow',
'Poleaxe',
'Heavy Crossbow'}
if args=='stone' then
weapons = weaponsStone
elseif args=='metal' then
weapons = weaponsMetal
elseif args=='bone' then
weapons = weapons1weaponsBone
else
return nil
end
local allWeapons = {}
for i,item in ipairs(variants) do
Line 29 ⟶ 70:
end
 
for i,item in ipairs(allWeapons) do
local query = mw.smw.ask(item.pagename .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
item.KPitemname = query[1].data
end
local query = mw.smw.ask(item.pagename .. '|?Uses facility #- = data|mainlabel=-')
Line 37 ⟶ 82:
end
local query = mw.smw.ask(item.pagenamewrongname .. '|?Activity XPName #- = data|mainlabel=-')
if type(query)=='table' then
item.XPwrongitemname = query[1].data
end
local query = mw.smw.ask(item.pagenamewrongname .. '|?ActivityUses durationfacility #- = data|mainlabel=-')
if type(query)=='table' then
item.durationwrongfacility = 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 .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
item.name = query[1].data
end
Line 72 ⟶ 102:
:tag('th')
:wikitext('Item name')
:done()
:tag('th')
:wikitext('Recipe Output')
:done()
:tag('th')
Line 80 ⟶ 107:
:done()
:tag('th')
:wikitext('XPWrong Page (shouldnt exist)')
:done()
:tag('th')
:wikitext('KPWrongpage Item name')
:done()
:tag('th')
:wikitext('durationWrongpage Facility')
:done()
:tag('th')
:wikitext('Wrong Page (shouldnt exist)')
:done()
:done()
Line 99 ⟶ 123:
:done()
:tag('td')
:wikitext(item.nameitemname)
:done()
:tag('td')
:wikitext(item.output)
:done()
:tag('td')
Line 108 ⟶ 129:
:done()
:tag('td')
:wikitext(item.XPwrongname)
:done()
:tag('td')
:wikitext(item.KPwrongitemname)
:done()
:tag('td')
:wikitext(item.durationwrongfacility)
:done()
:tag('td')
:wikitext(item.wrongname)
:done()
Line 127 ⟶ 145:
--for debugging
--return '<pre>'..mw.text.jsonEncode(allWeaponsargs, mw.text.JSON_PRETTY)..'</pre>'
end
12,054

edits