Module:Sandbox/User:Alsang/NodeDescriptionChecker: Difference between revisions

remove unused subroutine
(working for stonemason, need to check all data)
(remove unused subroutine)
Line 28:
}
local results = mw.smw.ask(query)
 
results = p.screenResults(results,false)
 
results = p.formatResults(results)
Line 52 ⟶ 50:
end
return currency._cell(amount, { html = 'yes' })
end
 
-- Need to split the table into two, lines with crates are passive and lines without are not
function p.screenResults(results,isPassive)
local resultsPassive = {}
local resultsNotPassive = {}
-- iterate through products
for _, item in ipairs(results) do
local hasCrate = item.recipeJSON and string.find(item.recipeJSON,'Crate')
if hasCrate then
table.insert(resultsPassive,item)
else
table.insert(resultsNotPassive,item)
end
end
if isPassive then
return resultsPassive
else
return resultsNotPassive
end
end
 
21,580

edits