refactoring
This commit is contained in:
@@ -72,7 +72,7 @@ function public.value(item_key)
|
||||
local weighted_values = {}
|
||||
local total_weight = 0
|
||||
for _, data_point in item_record.data_points do
|
||||
local weight = 0.99^Aux.round((item_record.data_points[1].time - data_point.time) / (60*60*24))
|
||||
local weight = 0.99^Aux.util.round((item_record.data_points[1].time - data_point.time) / (60*60*24))
|
||||
total_weight = total_weight + weight
|
||||
tinsert(weighted_values, {value = data_point.market_value, weight = weight})
|
||||
end
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ function private.post_auction(slot, k)
|
||||
ClickAuctionSellItemButton()
|
||||
ClearCursor()
|
||||
|
||||
StartAuction(max(1, Aux.round(m.state.unit_start_price * item_info.aux_quantity)), Aux.round(m.state.unit_buyout_price * item_info.aux_quantity), m.state.duration)
|
||||
StartAuction(max(1, Aux.util.round(m.state.unit_start_price * item_info.aux_quantity)), Aux.util.round(m.state.unit_buyout_price * item_info.aux_quantity), m.state.duration)
|
||||
|
||||
local c = Aux.control.await(function()
|
||||
m.state.posted = m.state.posted + 1
|
||||
|
||||
@@ -117,7 +117,7 @@ function private.extend_tooltip(tooltip, hyperlink, quantity)
|
||||
end
|
||||
if aux_tooltip_daily then
|
||||
local market_value = Aux.history.market_value(item_key)
|
||||
tooltip:AddLine('Today: '..(market_value and Aux.util.format_money(market_value * quantity)..' ('..Aux.auction_listing.percentage_historical(Aux.round(market_value / value * 100))..')' or GRAY_FONT_COLOR_CODE..'---'..FONT_COLOR_CODE_CLOSE), color.r, color.g, color.b)
|
||||
tooltip:AddLine('Today: '..(market_value and Aux.util.format_money(market_value * quantity)..' ('..Aux.auction_listing.percentage_historical(Aux.util.round(market_value / value * 100))..')' or GRAY_FONT_COLOR_CODE..'---'..FONT_COLOR_CODE_CLOSE), color.r, color.g, color.b)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user