Merge pull request #9 from geojak/master

Bugfixes and Improvement
This commit is contained in:
shirsig
2022-07-04 09:17:39 +02:00
committed by GitHub
4 changed files with 39 additions and 16 deletions
+4 -1
View File
@@ -10,4 +10,7 @@
10. disenchant values are calcualted from min(value,value_today), this protects users from low enchanting mat prices
11. advanced trade skill menu compabillity to display aux crafting cost
12. changed default post duration from 8 to 24, since turtle wow got no fees anyway
13. new filter "isgear" which can be used to generic filter out all white and green armor and weapons that have incosinstent market value
13. new filter "isgear" which can be used to generic filter out all white and green armor and weapons that have incosinstent market value
14. made ah data crossfaction on the server "Turtle WoW" (all chars are considered horde)
15. fixed a bug with the auto bid, bidding yoursefl up
16. adjusted the auto pricing to not post items and instead pprint a warning if it things its not profitable
+3
View File
@@ -93,6 +93,9 @@ end
function handle.LOAD2()
local key = format('%s|%s', GetCVar'realmName', UnitFactionGroup'player')
if GetCVar'realmName' == 'Turtle WoW' then
key = format('%s|%s', GetCVar'realmName', 'Horde')
end
aux.faction[key] = aux.faction[key] or {}
M.faction_data = assign(aux.faction[key], {
history = {},
+31 -13
View File
@@ -53,6 +53,7 @@ function post_auction(slot, k)
local kz_daily = 0
local kz_pricing = 0
local kz_warn = 0
local vendor_price = 0
if buyout_price > 0 then
kz_pricing=1
@@ -61,34 +62,34 @@ function post_auction(slot, k)
if history.market_value(state.item_key) ~= nil then
local tmp = tonumber(history.market_value(state.item_key))
tmp = max(0.99*tmp,tmp-50)
--tmp = max(0.99*tmp,tmp-50)
--buyout_price = max(buyout_price,tmp)
tmp = max(1,tmp-1)
buyout_price = max(buyout_price,tmp)
kz_daily = 1
end
if history.value(state.item_key) ~= nil then
if kz_pricing == 1 and kz_daily == 1 then
buyout_price = max(buyout_price,1.0*tonumber(history.value(state.item_key)))
--buyout_price = max(buyout_price,0.99*tonumber(history.value(state.item_key)))
buyout_price = max(buyout_price,0.50*tonumber(history.value(state.item_key)))
elseif kz_daily == 1 then
start_price = max(start_price,0.91*tonumber(history.value(state.item_key)))
--start_price = max(start_price,0.91*tonumber(history.value(state.item_key
start_price = max(start_price,0.80*tonumber(history.value(state.item_key)))
else
buyout_price = max(buyout_price,0.99* tonumber(history.value(state.item_key)))
--buyout_price = max(buyout_price,0.99* tonumber(history.value(state.item_key)))
buyout_price = max(buyout_price,0.95* tonumber(history.value(state.item_key)))
end
else
kz_warn = kz_warn + 1
end
if disenchant.value(item_info.slot, item_info.quality, item_info.level, item_info.item_id) ~= nil then
start_price = max(start_price,0.85* tonumber(disenchant.value(item_info.slot, item_info.quality, item_info.level, item_info.item_id)))
end
if aux.account_data.merchant_buy[item_info.item_id] ~= nil then
local tmp = tostring(aux.account_data.merchant_buy[item_info.item_id])
tmp = strsub(tmp,1,-3)
start_price = max(start_price,tonumber(tmp) * 1.1)
buyout_price = max(buyout_price,tonumber(tmp) * 1.15)
else
local vendor_price = 0
if aux.account_data.merchant_sell[item_info.item_id] ~= nil then
vendor_price = tonumber(aux.account_data.merchant_sell[item_info.item_id])
elseif ShaguTweaks and ShaguTweaks.SellValueDB[item_info.item_id] ~= nil then
@@ -100,7 +101,7 @@ function post_auction(slot, k)
end
if vendor_price > 0 then
if kz_daily == 0 then
start_price = max(start_price, vendor_price * (1.35+3.65*math.exp(-(1/4000)* vendor_price)))
start_price = max(start_price, vendor_price * (1.35+3.65*math.exp(-(1/4000)* vendor_price)))
else
start_price = max(start_price, vendor_price * 1.35)
end
@@ -109,16 +110,33 @@ function post_auction(slot, k)
end
end
if disenchant.value(item_info.slot, item_info.quality, item_info.level, item_info.item_id) ~= nil then
start_price = max(start_price,0.85* tonumber(disenchant.value(item_info.slot, item_info.quality, item_info.level, item_info.item_id)))
end
start_price = max(start_price,0.91 * buyout_price)
buyout_price = max(start_price, buyout_price)
if kz_warn == 2 and kz_pricing == 0 then
print("WARNING, insufficient data for autopricing!")
if start_price == 0 then
if disenchant.value(item_info.slot, item_info.quality, item_info.level, item_info.item_id) ~= nil then
if buyout_price < 0.95 * tonumber(disenchant.value(item_info.slot, item_info.quality, item_info.level, item_info.item_id)) -30 then
print("AUX: autopricing recommends disenchanting!")
return stop()
end
end
if kz_daily == 1 and vendor_price > 0 then
if tonumber(history.value(state.item_key)) < 1.35 * vendor_price
or tonumber(history.market_value(state.item_key)) < 1.35 * vendor_price then
print("AUX: autopricing recommends vendoring!")
return stop()
end
end
if start_price == 0 or (kz_warn == 2 and kz_pricing == 0) then
print("AUX: insufficient data for autopricing!")
return stop()
end
local gold = floor(start_price / COPPER_PER_GOLD)
local silver = floor(mod(start_price, COPPER_PER_GOLD) / COPPER_PER_SILVER)
local copper = aux.round(mod(start_price, COPPER_PER_SILVER))
+1 -2
View File
@@ -146,8 +146,7 @@ function scan_page(i)
auction_info.query_type = get_state().params.type
history.process_auction(auction_info)
if (get_state().params.auto_bid_validator or pass)(auction_info) and auction_info.owner ~= UnitName("player") then
if (get_state().params.auto_bid_validator or pass)(auction_info) and auction_info.owner ~= UnitName("player") and auction_info.high_bidder == nil then
local send_signal, signal_received = aux.signal()
aux.when(signal_received, scan_page, i)
return aux.place_bid(auction_info.query_type, auction_info.index, auction_info.bid_price, send_signal)