From a910719c063aa4ed41eda3cb02bfb9fecf546ea7 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Wed, 10 Feb 2016 03:22:15 +0100 Subject: [PATCH] removed failed experiment of bid market price, small simplification in high bid calculation --- Aux-AddOn.toc | 2 +- core.lua | 4 ++-- history.lua | 31 +------------------------------ info.lua | 2 +- slash.lua | 6 ------ 5 files changed, 5 insertions(+), 40 deletions(-) diff --git a/Aux-AddOn.toc b/Aux-AddOn.toc index 7997d50..e1747ac 100644 --- a/Aux-AddOn.toc +++ b/Aux-AddOn.toc @@ -1,7 +1,7 @@ ## Interface: 11200 ## Title: Aux ## Notes: A lightweight addon designed to help manage auctions -## SavedVariablesPerCharacter: aux_recent_searches, aux_favorite_searches, aux_price_per_unit, aux_conservative_history, aux_scale +## SavedVariablesPerCharacter: aux_recent_searches, aux_favorite_searches, aux_price_per_unit, aux_scale ## SavedVariables: aux_database, aux_auctionable_items slash.lua diff --git a/core.lua b/core.lua index de07699..8f0a3a4 100644 --- a/core.lua +++ b/core.lua @@ -30,8 +30,8 @@ function Aux.on_load() value_line = value_line..EnhTooltip.GetTextGSC(value * count)..' / '..EnhTooltip.GetTextGSC(value) end - local _, _, _, market_values, max_bids = Aux.history.price_data() - if getn(aux_conservative_history and max_bids or market_values) < 5 then + local _, _, _, market_values = Aux.history.price_data() + if getn(market_values) < 5 then value_line = value_line..' (?)' end diff --git a/history.lua b/history.lua index b82014f..a1986d8 100644 --- a/history.lua +++ b/history.lua @@ -27,9 +27,6 @@ function private.read_record(item_key) market_values = Aux.util.map(Aux.persistence.deserialize(fields[5], ';'), function(value) return tonumber(value) end), - max_bids = Aux.util.map(Aux.persistence.deserialize(fields[6], ';'), function(value) - return tonumber(value) - end), } else record = private.new_record() @@ -51,7 +48,6 @@ function private.write_record(item_key, record) record.daily_min_buyout or '', record.daily_max_price or '', Aux.persistence.serialize(record.market_values, ';'), - Aux.persistence.serialize(record.max_bids, ';', 'x'), },'#') end @@ -78,18 +74,10 @@ end function public.price_data(item_key) local item_record = private.read_record(item_key) - return item_record.daily_max_bid, item_record.daily_min_buyout, item_record.daily_max_price, item_record.market_values, item_record.max_bids + return item_record.daily_max_bid, item_record.daily_min_buyout, item_record.daily_max_price, item_record.market_values end function public.value(item_key) - if aux_conservative_history then - return private.conservative_historical_value(item_key) - else - return private.historical_value(item_key) - end -end - -function private.historical_value(item_key) local item_record = private.read_record(item_key) if getn(item_record.market_values) > 0 then @@ -99,16 +87,6 @@ function private.historical_value(item_key) end end -function private.conservative_historical_value(item_key) - local item_record = private.read_record(item_key) - - if getn(item_record.max_bids) > 0 then - return private.median(item_record.max_bids) - else - return item_record.daily_max_bid - end -end - function private.market_value(item_record) local estimate @@ -151,13 +129,6 @@ function private.push_record(item_record) end end - if item_record.daily_max_bid then - tinsert(item_record.max_bids, item_record.daily_max_bid) - while getn(item_record.max_bids) > 11 do - tremove(item_record.max_bids, 1) - end - end - item_record.daily_max_bid = nil item_record.daily_min_buyout = nil item_record.daily_max_price = nil diff --git a/info.lua b/info.lua index e5447b9..01013ee 100644 --- a/info.lua +++ b/info.lua @@ -119,7 +119,7 @@ function public.auction(index, type) local tooltip = public.tooltip(function(tt) tt:SetAuctionItem(type, index) end) local charges = private.item_charges(tooltip) local aux_quantity = charges or count - local bid_price = (high_bid > 0 and high_bid or start_price) + min_increment + local bid_price = high_bid > 0 and (high_bid + min_increment) or start_price return { item_id = item_id, diff --git a/slash.lua b/slash.lua index 4b064a8..a06e669 100644 --- a/slash.lua +++ b/slash.lua @@ -11,11 +11,5 @@ function SlashCmdList.AUX(parameter) elseif parameter == 'delete item cache' then aux_auctionable_items = nil Aux.log('Item cache deleted; falling back to the default.') - elseif parameter == 'history conservative' then - aux_conservative_history = not aux_conservative_history - Aux.log('Conservative history '..(aux_conservative_history and 'enabled.' or 'disabled.')) --- elseif parameter == 'percentage conservative' then --- aux_percentage_conservative = false --- Aux.log('Conservative value deactivated.') end end \ No newline at end of file