Editing Module:Sandbox/User:Alsang

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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:
p = {}


function p.main(args)
local p = {}

function p.minerPages()
local variants = {'Basic','Moderate','Fine','Strong','Superior','Perfect'}
local queryString = '[[Variant of::Flint||Andesite||Granite||Basalt||Deathstone||Iron Ore||Cabranese Ore||Adathril Ore||Flantium Ore||Mine Cart Work]]'
local weapons1 = {'Hammerfist','Throwing Stones','Stone Slab Shield',

'Stone Mace','Stone Discs','War Hammer',
return p.main(queryString)
'Bolas','Stone Chunk Shield','Double Headed Hammer',

'Throwing Clubs','Great Stone Mace',' Polished Stone Shield',
end
'Throwing Hammers','Great Hammer','Sling'}

local weapons2 = {'Hammerfist','Throwing Stones','Stone Slab Shield',
function p.foragerPages()
'Stone Mace','Stone Discs','War Hammer',
'Bolas','Stone Chunk Shield','Double Headed Hammer',
'Throwing Clubs','Great Stone Mace',' Polished Stone Shield',
'Throwing Hammers','Great Hammer','Sling'}
local weapons3 = {'Hammerfist','Throwing Stones','Stone Slab Shield',
'Stone Mace','Stone Discs','War Hammer',
'Bolas','Stone Chunk Shield','Double Headed Hammer',
'Throwing Clubs','Great Stone Mace',' Polished Stone Shield',
'Throwing Hammers','Great Hammer','Sling'}
weapons = weapons1
local queryString = '[[Variant of::Kelp||Wallplant||Periwinkle||Shell||Potato||Pond Weed||Bellplant||Monument Piece||Water Lily||Starfish||Hogberries||Limpet||Nettle||Wrack]]'

local allWeapons = {}
return p.main(queryString)
for i,item in ipairs(variants) do
for j,jtem in ipairs(weapons) do
table.insert(allWeapons,{pagename='[[' .. jtem .. ' (' .. item .. ')]]',wrongname='[[' .. item .. ' ' .. jtem .. ']]'})
end
end


for i,item in ipairs(allWeapons) 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 .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
item.name = query[1].data
end
end
local out = mw.html.create('table')
:addClass('wikitable sortable')
:tag('tr')
:tag('th')
:wikitext('Page')
:done()
:tag('th')
:wikitext('Item name')
:done()
:tag('th')
:wikitext('Recipe Output')
:done()
:tag('th')
:wikitext('Facility')
:done()
:tag('th')
:wikitext('XP')
:done()
:tag('th')
:wikitext('KP')
:done()
:tag('th')
:wikitext('duration')
:done()
:tag('th')
:wikitext('Wrong Page (shouldnt exist)')
:done()
:done()
for i,item in ipairs(allWeapons) do
local row = out:tag('tr')
:tag('td')
:wikitext(item.pagename)
:done()
:tag('td')
:wikitext(item.name)
:done()
:tag('td')
:wikitext(item.output)
:done()
:tag('td')
:wikitext(item.facility)
:done()
:tag('td')
:wikitext(item.XP)
:done()
:tag('td')
:wikitext(item.KP)
:done()
:tag('td')
:wikitext(item.duration)
:done()
:tag('td')
:wikitext(item.wrongname)
:done()
:done()
:done()
end
return out
--for debugging
--return '<pre>'..mw.text.jsonEncode(allWeapons, mw.text.JSON_PRETTY)..'</pre>'
end
end


function p.gathererPages1()
function p.stones()
local variants = {'Coarse','Rugged','Average','Fine','Sturdy','Perfect'}
local queryString = '[[Variant of::Globeplant||Dandelion||Goat Horn||Apple||Leek||Haleberries||Rams Horn||Bitterfruit||Chestnut||Bone Spike]]'
local stones ={'Flint','Basalt','Andesite','Granite','Deathstone'}

return p.main(queryString)
local allStones = {}
for i,item in ipairs(variants) do
for j,jtem in ipairs(stones) do
table.insert(allStones,{pagename='[[' .. item .. ' ' .. jtem .. ' (Etched)]]',resource='[[' .. item .. ' ' .. jtem .. ']]'})
end
end


for i,item in ipairs(allStones) 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 .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
item.name = 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('Item name')
:done()
:tag('th')
:wikitext('Resource')
:done()
:tag('th')
:wikitext('Recipe Output')
:done()
:tag('th')
:wikitext('Facility')
:done()
:tag('th')
:wikitext('XP')
:done()
:tag('th')
:wikitext('KP')
:done()
:tag('th')
:wikitext('duration')
:done()
:done()
for i,item in ipairs(allStones) do
local row = out:tag('tr')
:tag('td')
:wikitext(item.pagename)
:done()
:tag('td')
:wikitext(item.name)
:done()
:tag('td')
:wikitext(item.resource)
:done()
:tag('td')
:wikitext(item.output)
:done()
: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
end


function p.gathererPages2()
function p.metals()
local metals ={'Laterite Iron','Folrian Cabranese','Sylentnite Flantium','Maloic Adathril',
local queryString = '[[Variant of::Tangfruit||Catkin||Femur Shard||Clover||Snake Scale||Orchid||Dock Leaf||Sage||Thistle]]'
'Limonite Iron','Aulsian Cabranese','Yehrite Flantium','Rigic Adathril',

'Goethite Iron','Babian Cabranese','Holmitite Flantium','Portoic Adathril',
return p.main(queryString)
'Hematite Iron','Morian Cabranese','Amirite Flantium','Caric Adathril',
'Magnetite Iron','Shaprian Cabranese','Eysite Flantium','Masic Adathril',
'Siderite Iron','Temberian Cabranese','Seethalite Flantium','Fortoic Adathril'}
local allMetals = {}
for i,item in ipairs(metals) do
table.insert(allMetals,{pagename='[[' .. item .. ' Ingot]]',resource='[[' .. item .. ' Ore]]'})
end


for i,item in ipairs(allMetals) 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 .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
item.name = 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('Item name')
:done()
:tag('th')
:wikitext('Resource')
:done()
:tag('th')
:wikitext('Recipe Output')
:done()
:tag('th')
:wikitext('Facility')
:done()
:tag('th')
:wikitext('XP')
:done()
:tag('th')
:wikitext('KP')
:done()
:tag('th')
:wikitext('duration')
:done()
:done()
for i,item in ipairs(allMetals) do
local row = out:tag('tr')
:tag('td')
:wikitext(item.pagename)
:done()
:tag('td')
:wikitext(item.name)
:done()
:tag('td')
:wikitext(item.resource)
:done()
:tag('td')
:wikitext(item.output)
:done()
: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
end


function p.main(queryString)
function p.bones()

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)
local bones ={'Crooked Goat Horn',
for _,page in ipairs(results) do
'Yellowing Rams Horn',
if string.find(page.name,'Mine') then
'Streaky Bone Spike',
page.node = page.name
'Cracked Femur Shard',
else
'Gray Goat Horn',
page.node = page.name .. ' (skill node)'
'Mottled Rams Horn',
'Dappled Bone Spike',
'Dusty Femur Shard',
'Ridged Goat Horn',
'Sturdy Rams Horn',
'Bistre Bone Spike',
'Weathered Femur Shard',
'Smooth Goat Horn',
'Chunky Rams Horn',
'Pointed Bone Spike',
'Striated Femur Shard',
'Long Goat Horn',
'Pristine Rams Horn',
'Jagged Bone Spike',
'Sharp Femur Shard',
'Robust Goat Horn',
'Immaculate Rams Horn',
'Razor Bone Spike',
'Chunky Femur Shard'}
local allBones = {}
for i,item in ipairs(bones) do
table.insert(allBones,{pagename='[[' .. item .. ' (Brewed)]]',resource='[[' .. item .. ']]'})
end

for i,item in ipairs(allBones) do
local query = mw.smw.ask(item.pagename .. '|?Uses facility #- = data|mainlabel=-')
if type(query)=='table' then
item.facility = query[1].data
end
end
local result = mw.smw.ask('[['..page.node..']]|?Activity JSON = data')
local query = mw.smw.ask(item.pagename .. '|?Activity XP #- = data|mainlabel=-')
page.JSON = (result and result[1] and result[1].data) or ''
if type(page.JSON)=='table' then
if type(query)=='table' then
item.XP = query[1].data
page.JSON = table.concat(page.JSON,'<br>')
end
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 .. '|?Name #- = data|mainlabel=-')
if type(query)=='table' then
item.name = query[1].data
end
end
end
Line 63: Line 433:
:tag('tr')
:tag('tr')
:tag('th')
:tag('th')
:wikitext('Variant')
:wikitext('Page name')
:done()
:done()
:tag('th')
:tag('th')
:wikitext('Level')
:wikitext('Item name')
:done()
:done()
:tag('th')
:tag('th')
:wikitext('Page')
:wikitext('Resource')
:done()
:done()
:tag('th')
:tag('th')
:wikitext('Node')
:wikitext('Recipe Output')
:done()
:done()
:tag('th')
:tag('th')
:wikitext('Node JSON')
:wikitext('Facility')
:done()
:tag('th')
:wikitext('XP')
:done()
:tag('th')
:wikitext('KP')
:done()
:tag('th')
:wikitext('duration')
:done()
:done()
:done()
:done()
for i,item in ipairs(allBones) do
local row = out:tag('tr')
:tag('td')
:wikitext(item.pagename)
:done()
:tag('td')
:wikitext(item.name)
:done()
:tag('td')
:wikitext(item.resource)
:done()
:tag('td')
:wikitext(item.output)
:done()
: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()
for i, item in ipairs(results) do
local row = out:tag('tr')
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=-')
--level
if type(query)=='table' then
:tag('td')
item.facility = query[1].data
:wikitext(item.variant)
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()
:done()
:tag('td')
:tag('th')
:wikitext(item.level)
:wikitext('table lvl')
:done()
:done()
:tag('td')
:tag('th')
:wikitext('[['..item.name..']]')
:wikitext('Table resource')
:done()
:done()
:tag('td')
:tag('th')
:wikitext('[['..item.node..']]')
:wikitext('Item name')
:done()
:done()
:tag('td')
:tag('th')
:wikitext(item.JSON)
:wikitext('Recipe Output')
:done()
:done()
:tag('th')
:wikitext('Recipe Resource')
end
: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')
:wikitext(item.XP)
:done()
:tag('td')
:wikitext(item.KP)
:done()
:tag('td')
:wikitext(item.duration)
:done()
:done()
:done()
end
return out
return out

--for debugging
--return '<pre>'..mw.text.jsonEncode(allWeapons, mw.text.JSON_PRETTY)..'</pre>'
end
end


Please note that all contributions to Brighter Shores Wiki are considered to be released under the CC BY-NC-SA 3.0 (see Brighter Shores:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template

This page is a member of a hidden category: