Add files via upload
reupload in right folder
This commit is contained in:
+60
-3
@@ -248,6 +248,58 @@ function post_auctions()
|
||||
end
|
||||
end
|
||||
|
||||
function M.post_auctions_bind()
|
||||
if selected_item then
|
||||
local unit_start_price = get_unit_start_price()
|
||||
local unit_buyout_price = get_unit_buyout_price()
|
||||
local stack_size = stack_size_slider:GetValue()
|
||||
local stack_count
|
||||
stack_count = stack_count_slider:GetValue()
|
||||
local duration = UIDropDownMenu_GetSelectedValue(duration_dropdown)
|
||||
local key = selected_item.key
|
||||
|
||||
local duration_code
|
||||
if duration == DURATION_2 then
|
||||
duration_code = 2
|
||||
elseif duration == DURATION_8 then
|
||||
duration_code = 3
|
||||
elseif duration == DURATION_24 then
|
||||
duration_code = 4
|
||||
end
|
||||
|
||||
post.start(
|
||||
key,
|
||||
stack_size,
|
||||
duration,
|
||||
unit_start_price,
|
||||
unit_buyout_price,
|
||||
stack_count,
|
||||
function(posted)
|
||||
if not frame:IsShown() then
|
||||
return
|
||||
end
|
||||
for i = 1, posted do
|
||||
record_auction(key, stack_size, unit_start_price * stack_size, unit_buyout_price, duration_code, UnitName'player')
|
||||
end
|
||||
update_inventory_records()
|
||||
local same
|
||||
for _, record in inventory_records do
|
||||
if record.key == key then
|
||||
same = record
|
||||
break
|
||||
end
|
||||
end
|
||||
if same then
|
||||
update_item(same)
|
||||
else
|
||||
selected_item = nil
|
||||
end
|
||||
refresh = true
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
function validate_parameters()
|
||||
if not selected_item then
|
||||
post_button:Disable()
|
||||
@@ -258,7 +310,7 @@ function validate_parameters()
|
||||
return
|
||||
end
|
||||
if get_unit_start_price() == 0 then
|
||||
post_button:Disable()
|
||||
post_button:Enable()
|
||||
return
|
||||
end
|
||||
if stack_count_slider:GetValue() == 0 then
|
||||
@@ -379,18 +431,23 @@ function update_item(item)
|
||||
UIDropDownMenu_SetSelectedValue(duration_dropdown, settings.duration)
|
||||
|
||||
hide_checkbox:SetChecked(settings.hidden)
|
||||
|
||||
local ii = 1
|
||||
if selected_item.max_charges then
|
||||
for i = selected_item.max_charges, 1, -1 do
|
||||
if selected_item.availability[i] > 0 then
|
||||
stack_size_slider:SetMinMaxValues(1, i)
|
||||
ii=i
|
||||
break
|
||||
end
|
||||
end
|
||||
else
|
||||
ii = min(selected_item.max_stack, selected_item.aux_quantity)
|
||||
stack_size_slider:SetMinMaxValues(1, min(selected_item.max_stack, selected_item.aux_quantity))
|
||||
end
|
||||
stack_size_slider:SetValue(aux.huge)
|
||||
|
||||
stack_size_slider:SetValue(math.random(1,ii))
|
||||
--stack_size_slider:SetValue(aux.huge)
|
||||
--stack_size_slider:SetValue(1)
|
||||
quantity_update(true)
|
||||
|
||||
unit_start_price_input:SetText(money.to_string(settings.start_price, true, nil, nil, true))
|
||||
|
||||
@@ -323,7 +323,7 @@ function set_filter_display_offset(x_offset, y_offset)
|
||||
end
|
||||
|
||||
function initialize_filter_dropdown()
|
||||
for _, filter in ipairs(T.temp-T.list('and', 'or', 'not', 'price', 'profit', 'vendor-profit', 'disenchant-profit', 'percent', 'bid-price', 'bid-profit', 'bid-vendor-profit', 'bid-disenchant-profit', 'bid-percent', 'item', 'tooltip', 'min-level', 'max-level', 'rarity', 'left', 'utilizable', 'seller')) do
|
||||
for _, filter in ipairs(T.temp-T.list('and', 'or', 'not', 'price', 'profit', 'vendor-profit', 'disenchant-profit', 'percent', 'disenchant-percent', 'bid-price', 'bid-profit', 'bid-vendor-profit', 'bid-disenchant-profit', 'bid-percent', 'bid-disenchant-percent', 'item', 'tooltip', 'min-level', 'max-level', 'rarity', 'left', 'utilizable', 'seller')) do
|
||||
UIDropDownMenu_AddButton(T.map(
|
||||
'text', filter,
|
||||
'value', filter,
|
||||
|
||||
@@ -547,7 +547,7 @@ for _ = 1, 5 do
|
||||
end
|
||||
|
||||
favorite_searches_listing = listing.new(frame.saved.favorite)
|
||||
favorite_searches_listing:SetColInfo{{name='Auto Buy', width=.07, align='CENTER'}, {name='Favorite Searches', width=.93}}
|
||||
favorite_searches_listing:SetColInfo{{name='Auto', width=.07, align='CENTER'}, {name='Favorite Searches', width=.93}}
|
||||
|
||||
recent_searches_listing = listing.new(frame.saved.recent)
|
||||
recent_searches_listing:SetColInfo{{name='Recent Searches', width=1}}
|
||||
|
||||
@@ -151,6 +151,7 @@ function start_real_time_scan(query, search, continuation)
|
||||
type = 'list',
|
||||
queries = {query},
|
||||
auto_buy_validator = search.auto_buy_validator,
|
||||
auto_bid_validator = search.auto_bid_validator,
|
||||
on_scan_start = function()
|
||||
search.status_bar:update_status(.9999, .9999)
|
||||
search.status_bar:set_text('Scanning last page ...')
|
||||
@@ -227,6 +228,7 @@ function start_search(queries, continuation)
|
||||
type = 'list',
|
||||
queries = queries,
|
||||
auto_buy_validator = search.auto_buy_validator,
|
||||
auto_bid_validator = search.auto_bid_validator,
|
||||
on_scan_start = function()
|
||||
search.status_bar:update_status(0, 0)
|
||||
if continuation then
|
||||
@@ -336,6 +338,7 @@ function M.execute(resume, real_time)
|
||||
search.last_page = last_page
|
||||
search.real_time = real_time
|
||||
search.auto_buy_validator = get_auto_buy_validator()
|
||||
search.auto_bid_validator = get_auto_bid_validator()
|
||||
end
|
||||
|
||||
local continuation = resume and current_search().continuation
|
||||
|
||||
+35
-1
@@ -15,7 +15,7 @@ function update_search_listings()
|
||||
local search = favorite_searches[i]
|
||||
local name = strsub(search.prettified, 1, 250)
|
||||
tinsert(favorite_search_rows, T.map(
|
||||
'cols', T.list(T.map('value', search.auto_buy and aux.color.red'X' or ''), T.map('value', name)),
|
||||
'cols', T.list(T.map('value', search.auto_buy and aux.color.red'X' or search.auto_bid and aux.color.red'Y' or ''), T.map('value', name)),
|
||||
'search', search,
|
||||
'index', i
|
||||
))
|
||||
@@ -68,8 +68,10 @@ handlers = {
|
||||
u(d)
|
||||
elseif st == favorite_searches_listing then
|
||||
local auto_buy = data.search.auto_buy
|
||||
local auto_bid = data.search.auto_bid
|
||||
gui.menu(
|
||||
(auto_buy and 'Disable' or 'Enable') .. ' Auto Buy', function() if auto_buy then data.search.auto_buy = nil else enable_auto_buy(data.search) end u() end,
|
||||
(auto_bid and 'Disable' or 'Enable') .. ' Auto Bid', function() if auto_bid then data.search.auto_bid = nil else enable_auto_bid(data.search) end u() end,
|
||||
'Move Up', function() move_up(favorite_searches, data.index); u() end,
|
||||
'Move Down', function() move_down(favorite_searches, data.index); u() end,
|
||||
'Delete', function() tremove(favorite_searches, data.index); u() end
|
||||
@@ -106,6 +108,23 @@ function get_auto_buy_validator()
|
||||
end
|
||||
end
|
||||
|
||||
function get_auto_bid_validator()
|
||||
local validators = T.acquire()
|
||||
for _, search in favorite_searches do
|
||||
if search.auto_bid then
|
||||
local queries, error = filter_util.queries(search.filter_string)
|
||||
if queries then
|
||||
tinsert(validators, queries[1].validator)
|
||||
else
|
||||
aux.print('Invalid auto bid filter:', error)
|
||||
end
|
||||
end
|
||||
end
|
||||
return function(record)
|
||||
return aux.any(validators, function(validator) return validator(record) end)
|
||||
end
|
||||
end
|
||||
|
||||
function add_favorite(filter_string)
|
||||
local queries, error = filter_util.queries(filter_string)
|
||||
if queries then
|
||||
@@ -134,6 +153,21 @@ function enable_auto_buy(search)
|
||||
end
|
||||
end
|
||||
|
||||
function enable_auto_bid(search)
|
||||
local queries, error = filter_util.queries(search.filter_string)
|
||||
if queries then
|
||||
if getn(queries) > 1 then
|
||||
aux.print('Error: Auto Bid does not support multi-queries')
|
||||
elseif aux.size(queries[1].blizzard_query) > 0 and not filter_util.parse_filter_string(search.filter_string).blizzard.exact then
|
||||
aux.print('Error: Auto Bid does not support Blizzard filters')
|
||||
else
|
||||
search.auto_bid = true
|
||||
end
|
||||
else
|
||||
aux.print('Invalid filter:', error)
|
||||
end
|
||||
end
|
||||
|
||||
function move_up(list, index)
|
||||
if list[index - 1] then
|
||||
list[index], list[index - 1] = list[index - 1], list[index]
|
||||
|
||||
Reference in New Issue
Block a user