refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-09-30 18:32:19 +02:00
parent 4414ccf084
commit f29cb9ae1d
36 changed files with 531 additions and 298 deletions
+10 -2
View File
@@ -1,4 +1,12 @@
aux 'cache' local info, persistence = aux.info, aux.persistence
aux_cache = module
include (green_t)
include (aux)
include (aux_util)
include (aux_control)
include (aux_util_color)
local info, persistence = aux_info, aux_persistence
local MIN_ITEM_ID = 1
local MAX_ITEM_ID = 30000
@@ -28,7 +36,7 @@ function LOAD()
event_listener('NEW_AUCTION_UPDATE', function()
for info in present(info.auction_sell_item()) do
for item_id in present(item_id(info.name)) do
aux_merchant_sell[_E.item_id(info.name)] = info.vendor_price / (aux.info.max_item_charges(item_id) or info.count)
aux_merchant_sell[_M.item_id(info.name)] = info.vendor_price / (aux_info.max_item_charges(item_id) or info.count)
end
end
end)
+8 -2
View File
@@ -1,4 +1,10 @@
aux 'disenchant'
aux_disenchant = module
include (green_t)
include (aux)
include (aux_util)
include (aux_control)
include (aux_util_color)
local UNCOMMON, RARE, EPIC = 2, 3, 4
@@ -69,7 +75,7 @@ local WEAPON = S(
function public.value(slot, quality, level)
local expectation
for _, event in distribution(slot, quality, level) do
local value = aux.history.value(event.item_id .. ':' .. 0)
local value = aux_history.value(event.item_id .. ':' .. 0)
if not value then
return
else
+9 -1
View File
@@ -1,4 +1,12 @@
aux 'history' local persistence = aux.persistence
aux_history = module
include (green_t)
include (aux)
include (aux_util)
include (aux_control)
include (aux_util_color)
local persistence = aux_persistence
local history_schema = {'record', '#', {next_push='number'}, {daily_min_buyout='number'}, {daily_max_price='number'}, {data_points={'list', ';', {'record', '@', {market_value='number'}, {time='number'}}}} }
+10 -4
View File
@@ -1,4 +1,10 @@
aux 'post'
aux_post = module
include (green_t)
include (aux)
include (aux_util)
include (aux_control)
include (aux_util_color)
local state
@@ -17,15 +23,15 @@ function private.process()
end
end)
return aux.stack.start(state.item_key, state.stack_size, send_signal)
return aux_stack.start(state.item_key, state.stack_size, send_signal)
end
return stop()
end
function private.post_auction(slot, k)
local item_info = aux.info.container_item(unpack(slot))
if item_info.item_key == state.item_key and aux.info.auctionable(item_info.tooltip) and item_info.aux_quantity == state.stack_size then
local item_info = aux_info.container_item(unpack(slot))
if item_info.item_key == state.item_key and aux_info.auctionable(item_info.tooltip) and item_info.aux_quantity == state.stack_size then
ClearCursor()
ClickAuctionSellItemButton()
+9 -1
View File
@@ -1,4 +1,12 @@
aux 'scan' local info, history = aux.info, aux.history
aux_scan = module
include (green_t)
include (aux)
include (aux_util)
include (aux_control)
include (aux_util_color)
local info, history = aux_info, aux_history
local PAGE_SIZE = 50
+10 -2
View File
@@ -1,4 +1,12 @@
aux 'slash' local persistence = aux.persistence
aux_slash = module
include (green_t)
include (aux)
include (aux_util)
include (aux_control)
include (aux_util_color)
local persistence = aux_persistence
aux_ignore_owner = true
@@ -27,7 +35,7 @@ function SlashCmdList.AUX(command)
aux_auctionable_items = t
print 'Item cache cleared.'
elseif arguments[1] == 'populate' and arguments[2] == 'wdb' then
aux.cache.populate_wdb()
aux_cache.populate_wdb()
elseif arguments[1] == 'tooltip' and arguments[2] == 'value' then
aux_tooltip_value = not aux_tooltip_value
print('Historical value in tooltip ' .. (aux_tooltip_value and 'enabled' or 'disabled') .. '.')
+9 -1
View File
@@ -1,4 +1,12 @@
aux 'stack' local info = aux.info
aux_stack = module
include (green_t)
include (aux)
include (aux_util)
include (aux_control)
include (aux_util_color)
local info = aux_info
local state
+10 -2
View File
@@ -1,4 +1,12 @@
aux 'tooltip' local info, disenchant, cache, money, history = aux.info, aux.disenchant, aux.cache, aux.money, aux.history
aux_tooltip = module
include (green_t)
include (aux)
include (aux_util)
include (aux_control)
include (aux_util_color)
local info, disenchant, cache, money, history = aux_info, aux_disenchant, aux_cache, aux_money, aux_history
aux_tooltip_value = true
@@ -101,7 +109,7 @@ function extend_tooltip(tooltip, link, quantity)
end
if aux_tooltip_daily then
local market_value = history.market_value(item_key)
tooltip:AddLine('Today: ' .. (market_value and money.to_string2(market_value * quantity) .. ' (' .. aux.auction_listing.percentage_historical(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 money.to_string2(market_value * quantity) .. ' (' .. aux_auction_listing.percentage_historical(round(market_value / value * 100)) .. ')' or GRAY_FONT_COLOR_CODE .. '---' .. FONT_COLOR_CODE_CLOSE), color.r, color.g, color.b)
end
end