Editing Module:WoodcutterPassiveList

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 12: Line 12:
-- returns only directly needed parameter needed for the row,
-- returns only directly needed parameter needed for the row,
-- other parameters are determined by subqueries of chained pages
-- other parameters are determined by subqueries of chained pages
-- Woodcutter cannot sort by any parameter, as Branches use Profession B but Split Wood uses profession A
local query = {
local query = {
'[[Variant of::~*Tree||~Split Wood for*]]',
'[[Variant of::~*Tree||~Split Wood for*]]',
'?Profession Level B = lvl',
'? #- = name',
'? #- = name',
'?Image #- = Image',
'?Image #- = Image',
'?Activity JSON = activityJSON',
'?Activity JSON = activityJSON',
'?Activity coins = coins',
'?Activity coins = coins',
-- 'sort = Profession Level B',
'limit = 500'
'limit = 500'
}
}
Line 76: Line 77:
end
end
-- sort the results by recipe level
table.sort(resultsScreened, function(item1, item2)
local lvl1 = item1.lvl
local lvl2 = item2.lvl
if (lvl1 == nil) ~= (lvl2 == nil) then --one of two are empty
return lvl2 == nil -- true if lvl2 is nil but not lvl1, false if lvl1 is nil but not lvl2
end
if lvl1 == nil then
return false -- Both empty, equivalent
end
return lvl1 < lvl2 -- normal comparison
end)

return resultsScreened
return resultsScreened


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: