removed failed experiment of bid market price, small simplification in high bid calculation

This commit is contained in:
Manuel Simon Hirsig
2016-02-10 03:22:15 +01:00
parent 5ce55bdd1d
commit a910719c06
5 changed files with 5 additions and 40 deletions
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+1 -30
View File
@@ -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
+1 -1
View File
@@ -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,
-6
View File
@@ -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