fixed /aux scan, made a small market value change
This commit is contained in:
+13
@@ -104,6 +104,14 @@ function private.daily_market_value(histogram)
|
||||
return sum / limit
|
||||
end
|
||||
|
||||
function private.daily_min_value(histogram)
|
||||
for i, frequency in ipairs(histogram) do
|
||||
if frequency > 0 then
|
||||
return 1.1 ^ (i - 1) * 1.05
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function private.push_data()
|
||||
local data = private.load_data()
|
||||
local item_data = data.item_data
|
||||
@@ -115,6 +123,11 @@ function private.push_data()
|
||||
if getn(item_record.histogram) ~= 0 then
|
||||
|
||||
local daily_market_value = private.daily_market_value(item_record.histogram)
|
||||
local daily_min_value = private.daily_min_value(item_record.histogram)
|
||||
|
||||
if daily_market_value > 2 * public.market_value(item_key) then -- prevent people from poisoning our market value by posting lots of 200k auctions
|
||||
daily_market_value = daily_min_value
|
||||
end
|
||||
|
||||
if item_record.day_count == 0 then
|
||||
item_record.EMA7 = Aux.round(daily_market_value)
|
||||
|
||||
+17
-15
@@ -18,18 +18,26 @@ function public.start_scan()
|
||||
-- AuxHistoryScanButton:Hide()
|
||||
-- AuxHistoryStopButton:Show()
|
||||
|
||||
private.scanned_signatures = Aux.util.set()
|
||||
-- private.scanned_signatures = Aux.util.set()
|
||||
|
||||
Aux.log('Scanning auctions ...')
|
||||
Aux.scan.start{
|
||||
query = {},
|
||||
page = 0,
|
||||
queries = {{
|
||||
type = 'list',
|
||||
start_page = 0,
|
||||
next_page = function(page, total_pages)
|
||||
local last_page = max(total_pages - 1, 0)
|
||||
if page < last_page then
|
||||
return page + 1
|
||||
end
|
||||
end,
|
||||
}},
|
||||
on_page_loaded = function(page, total_pages)
|
||||
Aux.log('Scanning page '..(page+1)..' out of '..total_pages..' ...')
|
||||
end,
|
||||
on_read_auction = function(auction_info)
|
||||
private.process_auction(auction_info)
|
||||
end,
|
||||
-- on_read_auction = function(auction_info)
|
||||
-- private.process_auction(auction_info)
|
||||
-- end,
|
||||
on_complete = function()
|
||||
Aux.log('Scan complete.')
|
||||
-- AuxHistoryStopButton:Hide()
|
||||
@@ -40,12 +48,6 @@ function public.start_scan()
|
||||
-- AuxHistoryStopButton:Hide()
|
||||
-- AuxHistoryScanButton:Show()
|
||||
end,
|
||||
next_page = function(page, total_pages)
|
||||
local last_page = max(total_pages - 1, 0)
|
||||
if page < last_page then
|
||||
return page + 1
|
||||
end
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
@@ -53,6 +55,6 @@ function public.stop_scan()
|
||||
Aux.scan.abort()
|
||||
end
|
||||
|
||||
function private.process_auction(auction_info)
|
||||
private.scanned_signatures.add(auction_info.signature)
|
||||
end
|
||||
--function private.process_auction(auction_info)
|
||||
-- private.scanned_signatures.add(auction_info.signature)
|
||||
--end
|
||||
|
||||
Reference in New Issue
Block a user