Module:Sandbox/User:Alsang: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(remove completed lists) Tag: Manual revert |
No edit summary |
||
Line 4: | Line 4: | ||
local variants = {'Basic','Moderate','Fine','Strong','Superior','Perfect'} |
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', |
|||
'Stone Slab Shield', |
|||
'Stone Mace', |
|||
'Throwing Hammers','Great Hammer','Sling'} |
|||
'Stone Discs', |
|||
local weapons2 = {'Hammerfist','Throwing Stones','Stone Slab Shield', |
|||
'War Hammer', |
|||
'Bolas', |
|||
'Bolas','Stone Chunk Shield','Double Headed Hammer', |
|||
'Stone Chunk Shield', |
|||
'Double Headed Hammer', |
|||
'Throwing Clubs', |
|||
local weapons3 = {'Hammerfist','Throwing Stones','Stone Slab Shield', |
|||
'Great Stone Mace', |
|||
' Polished Stone Shield', |
|||
'Throwing Hammers', |
|||
'Great Hammer', |
|||
'Sling'} |
|||
local weaponsMetal = { |
|||
⚫ | |||
'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 |
|||
⚫ | |||
else |
|||
return nil |
|||
⚫ | |||
⚫ | |||
local allWeapons = {} |
local allWeapons = {} |
||
for i,item in ipairs(variants) do |
for i,item in ipairs(variants) do |
||
Line 29: | Line 70: | ||
end |
end |
||
⚫ | |||
for i,item in ipairs(allWeapons) do |
for i,item in ipairs(allWeapons) do |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
local query = mw.smw.ask(item.pagename .. '|?Uses facility #- = data|mainlabel=-') |
local query = mw.smw.ask(item.pagename .. '|?Uses facility #- = data|mainlabel=-') |
||
Line 37: | Line 82: | ||
end |
end |
||
local query = mw.smw.ask(item. |
local query = mw.smw.ask(item.wrongname .. '|?Name #- = data|mainlabel=-') |
||
if type(query)=='table' then |
if type(query)=='table' then |
||
item. |
item.wrongitemname = query[1].data |
||
end |
end |
||
local query = mw.smw.ask(item. |
local query = mw.smw.ask(item.wrongname .. '|?Uses facility #- = data|mainlabel=-') |
||
if type(query)=='table' then |
if type(query)=='table' then |
||
item. |
item.wrongfacility = query[1].data |
||
⚫ | |||
⚫ | |||
local query = mw.smw.ask(item.pagename .. '|?Activity KP #- = data|mainlabel=-') |
|||
⚫ | |||
⚫ | |||
⚫ | |||
local query = mw.smw.ask(item.pagename .. '|?Recipe output #- = data|mainlabel=-') |
|||
if type(query)=='table' then |
|||
item.output = query[1].data |
|||
end |
|||
⚫ | |||
if type(query)=='table' then |
|||
item.name = query[1].data |
|||
end |
end |
||
Line 72: | Line 102: | ||
:tag('th') |
:tag('th') |
||
:wikitext('Item name') |
:wikitext('Item name') |
||
:done() |
|||
:tag('th') |
|||
:wikitext('Recipe Output') |
|||
:done() |
:done() |
||
:tag('th') |
:tag('th') |
||
Line 80: | Line 107: | ||
:done() |
:done() |
||
:tag('th') |
:tag('th') |
||
:wikitext(' |
:wikitext('Wrong Page (shouldnt exist)') |
||
:done() |
:done() |
||
:tag('th') |
:tag('th') |
||
:wikitext(' |
:wikitext('Wrongpage Item name') |
||
:done() |
:done() |
||
:tag('th') |
:tag('th') |
||
:wikitext(' |
:wikitext('Wrongpage Facility') |
||
:done() |
|||
:tag('th') |
|||
:wikitext('Wrong Page (shouldnt exist)') |
|||
:done() |
:done() |
||
:done() |
:done() |
||
Line 99: | Line 123: | ||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:wikitext(item. |
:wikitext(item.itemname) |
||
:done() |
|||
:tag('td') |
|||
:wikitext(item.output) |
|||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
Line 108: | Line 129: | ||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:wikitext(item. |
:wikitext(item.wrongname) |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:wikitext(item. |
:wikitext(item.wrongitemname) |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |
||
:wikitext(item. |
:wikitext(item.wrongfacility) |
||
:done() |
|||
:tag('td') |
|||
:wikitext(item.wrongname) |
|||
:done() |
:done() |
||
Line 127: | Line 145: | ||
--for debugging |
--for debugging |
||
--return '<pre>'..mw.text.jsonEncode( |
--return '<pre>'..mw.text.jsonEncode(args, mw.text.JSON_PRETTY)..'</pre>' |
||
end |
end |