big filter refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-01 21:07:51 +02:00
parent 353820ede2
commit 1098be024c
9 changed files with 68 additions and 753 deletions
+5 -5
View File
@@ -23,7 +23,7 @@ function private.current_thread()
end
function public.start(params)
Aux.safe(m).abort(Aux.safe(m).threads[params.type].id)
m.abort(Aux.safe(m.threads[params.type]).id/0)
local thread_id = Aux.control.new_thread(Aux.f(m.wait_for_callback, params.on_scan_start, m.scan))
@@ -189,11 +189,11 @@ function private.scan_auctions_helper(i, k)
Aux.history.process_auction(auction_info)
if Aux.safe(m).current_thread().params.auto_buy_validator(auction_info)/false then
if Aux.safe(m.current_thread().params.auto_buy_validator)(auction_info)/false then
local c = Aux.control.wait_for(recurse)
Aux.place_bid(auction_info.query_type, auction_info.index, auction_info.buyout_price, Aux.f(c, true))
Aux.control.new_thread(Aux.control.sleep, 10, Aux.f(c, false))
elseif Aux.safe(m).current_query().validator(auction_info)/true then
elseif Aux.safe(m.current_query().validator)(auction_info)/true then
return m.wait_for_callback(m.current_thread().params.on_auction, auction_info, function(removed)
if removed then
return recurse(true)
@@ -210,14 +210,14 @@ end
function private.submit_query(k)
Aux.control.when(function() return m.current_thread().params.type ~= 'list' or CanSendAuctionQuery() end, function()
Aux.safe(m).current_thread().params.on_submit_query()
Aux.safe(m.current_thread().params.on_submit_query)()
if m.current_thread().params.type == 'bidder' then
GetBidderAuctionItems(m.current_thread().page)
elseif m.current_thread().params.type == 'owner' then
GetOwnerAuctionItems(m.current_thread().page)
else
local blizzard_query = Aux.safe(m).current_query().blizzard_query/{}
local blizzard_query = Aux.safe(m.current_query().blizzard_query)/{}
QueryAuctionItems(
blizzard_query.name,
blizzard_query.min_level,