mend
This commit is contained in:
+33
-20
@@ -30,52 +30,65 @@ m.filters = {
|
|||||||
['item'] = {
|
['item'] = {
|
||||||
arity = 1,
|
arity = 1,
|
||||||
test = function(name)
|
test = function(name)
|
||||||
local item_id = Aux.static.item_id(strupper(name or ''))
|
if not name then
|
||||||
if item_id then
|
|
||||||
return function(auction_record)
|
|
||||||
return auction_record.item_id == item_id
|
|
||||||
end
|
|
||||||
else
|
|
||||||
return false, Aux.completion.sorted_item_names(), 'Erroneous Item Modifier'
|
return false, Aux.completion.sorted_item_names(), 'Erroneous Item Modifier'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local item_id = Aux.static.item_id(strupper(name or ''))
|
||||||
|
if not item_id then
|
||||||
|
return false, {}, 'Erroneous Item Modifier'
|
||||||
|
end
|
||||||
|
|
||||||
|
return function(auction_record)
|
||||||
|
return auction_record.item_id == item_id
|
||||||
|
end
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
['left'] = {
|
['left'] = {
|
||||||
arity = 1,
|
arity = 1,
|
||||||
test = function(duration)
|
test = function(duration)
|
||||||
|
if not duration then
|
||||||
|
return false, {'30m', '2h', '8h', '24h'}, 'Erroneous Time Left Modifier'
|
||||||
|
end
|
||||||
|
|
||||||
local code = ({
|
local code = ({
|
||||||
['30m'] = 1,
|
['30m'] = 1,
|
||||||
['2h'] = 2,
|
['2h'] = 2,
|
||||||
['8h'] = 3,
|
['8h'] = 3,
|
||||||
['24h'] = 4,
|
['24h'] = 4,
|
||||||
})[duration or '']
|
})[duration or '']
|
||||||
if code then
|
|
||||||
return function(auction_record)
|
if not code then
|
||||||
return auction_record.duration == code
|
return false, {}, 'Erroneous Time Left Modifier'
|
||||||
end
|
end
|
||||||
else
|
|
||||||
return false, {'30m', '2h', '8h', '24h'}, 'Erroneous Time Left Modifier'
|
return function(auction_record)
|
||||||
|
return auction_record.duration == code
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
['rarity'] = {
|
['rarity'] = {
|
||||||
arity = 1,
|
arity = 1,
|
||||||
test = function(duration)
|
test = function(rarity)
|
||||||
|
if not rarity then
|
||||||
|
return false, {'poor', 'common', 'uncommon', 'rare', 'epic'}, 'Erroneous Time Left Modifier'
|
||||||
|
end
|
||||||
|
|
||||||
local code = ({
|
local code = ({
|
||||||
['poor'] = 1,
|
['poor'] = 1,
|
||||||
['common'] = 2,
|
['common'] = 2,
|
||||||
['uncommon'] = 3,
|
['uncommon'] = 3,
|
||||||
['rare'] = 4,
|
['rare'] = 4,
|
||||||
['epic'] = 5,
|
['epic'] = 5,
|
||||||
})[duration or '']
|
})[rarity or '']
|
||||||
if code then
|
if not code then
|
||||||
return function(auction_record)
|
return false, {}, 'Erroneous Time Left Modifier'
|
||||||
return auction_record.quality == code
|
end
|
||||||
end
|
|
||||||
else
|
return function(auction_record)
|
||||||
return false, {}, {'poor', 'common', 'uncommon', 'rare', 'epic'}, 'Erroneous Time Left Modifier'
|
return auction_record.quality == code
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user