Editing Module:Sandbox/User:Alsang/PriceChecker
Jump to navigation
Jump to search
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 6: | Line 6: | ||
-- other parameters are determined by subqueries of chained pages |
-- other parameters are determined by subqueries of chained pages |
||
local query = { |
local query = { |
||
'[[-Sold item |
'[[-Sold item::~*]]', |
||
'?=Name', |
'?=Name', |
||
'?-Sold item.Shop sell price=ShopValue', |
'?-Sold item.Shop sell price=ShopValue', |
||
Line 17: | Line 17: | ||
local out = {'List of items:'} |
local out = {'List of items:'} |
||
for _,item in ipairs(results) do |
for _,item in ipairs(results) do |
||
if not(tonumber(item.ShopValue)==tonumber(item.InfoboxValue)) then |
|||
local s = item.ShopValue |
|||
local add = true |
|||
if type(s)=='string' then |
|||
if i==tonumber(s) or not(tonumber(s)) then |
|||
add = false |
|||
end |
|||
elseif type(s)=='table' then |
|||
for _,shop in ipairs(s) do |
|||
if i==tonumber(shop) or not(tonumber(shop)) then |
|||
add = false |
|||
end |
|||
end |
|||
end |
|||
if add then |
|||
table.insert(out,item.Name) |
table.insert(out,item.Name) |
||
end |
end |