Add config for buyer to always pay calc price on bid

This commit is contained in:
NathanHandley
2025-09-19 07:08:46 -05:00
parent 52e0e19b5a
commit be50926f30
3 changed files with 18 additions and 2 deletions

View File

@@ -156,6 +156,12 @@ AuctionHouseBot.Neutral.MaxItems = 15000
# of what the seller sells for), but do not go lower than 0 # of what the seller sells for), but do not go lower than 0
# Default: 1 # Default: 1
# #
# AuctionHouseBot.Buyer.AlwaysBidMaxCalculatedPrice
# When enabled, the buyer bot will use the calculated max price they
# were willing to pay as the amount they bid with, instead of minimum
# bid amount.
# Default: false
#
# AuctionHouseBot.Buyer.PreventOverpayingForVendorItems # AuctionHouseBot.Buyer.PreventOverpayingForVendorItems
# When enabled, the buyer bot will avoid purchasing auction house items # When enabled, the buyer bot will avoid purchasing auction house items
# that are being sold for more than the vendor sell price. This prevents # that are being sold for more than the vendor sell price. This prevents
@@ -174,6 +180,7 @@ AuctionHouseBot.Neutral.MaxItems = 15000
AuctionHouseBot.Buyer.Enabled = false AuctionHouseBot.Buyer.Enabled = false
AuctionHouseBot.Buyer.BuyCandidatesPerBuyCycle = 1 AuctionHouseBot.Buyer.BuyCandidatesPerBuyCycle = 1
AuctionHouseBot.Buyer.AcceptablePriceModifier = 1 AuctionHouseBot.Buyer.AcceptablePriceModifier = 1
AuctionHouseBot.Buyer.AlwaysBidMaxCalculatedPrice = false
AuctionHouseBot.Buyer.PreventOverpayingForVendorItems = true AuctionHouseBot.Buyer.PreventOverpayingForVendorItems = true
AuctionHouseBot.Buyer.BidAgainstPlayers = false AuctionHouseBot.Buyer.BidAgainstPlayers = false

View File

@@ -52,6 +52,7 @@ AuctionHouseBot::AuctionHouseBot() :
ListingExpireTimeInSecondsMin(900), ListingExpireTimeInSecondsMin(900),
ListingExpireTimeInSecondsMax(86400), ListingExpireTimeInSecondsMax(86400),
BuyingBotAcceptablePriceModifier(1), BuyingBotAcceptablePriceModifier(1),
BuyingBotAlwaysBidMaxCalculatedPrice(false),
BuyingBotWillBidAgainstPlayers(false), BuyingBotWillBidAgainstPlayers(false),
AHCharactersGUIDsForQuery(""), AHCharactersGUIDsForQuery(""),
ItemsPerCycle(75), ItemsPerCycle(75),
@@ -1106,11 +1107,17 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player* AHBplayer, AHBConfig *con
if (auction->bid == 0 && auction->startbid <= willingToPayForStackPrice) if (auction->bid == 0 && auction->startbid <= willingToPayForStackPrice)
{ {
doBid = true; doBid = true;
if (BuyingBotAlwaysBidMaxCalculatedPrice == true)
calcBidAmount = willingToPayForStackPrice;
else
calcBidAmount = auction->startbid; calcBidAmount = auction->startbid;
} }
else if (auction->bid != 0 && (auction->bid + auction->GetAuctionOutBid()) < willingToPayForStackPrice) else if (auction->bid != 0 && (auction->bid + auction->GetAuctionOutBid()) < willingToPayForStackPrice)
{ {
doBid = true; doBid = true;
if (BuyingBotAlwaysBidMaxCalculatedPrice == true)
calcBidAmount = willingToPayForStackPrice;
else
calcBidAmount = auction->bid + auction->GetAuctionOutBid(); calcBidAmount = auction->bid + auction->GetAuctionOutBid();
} }
} }
@@ -1304,6 +1311,7 @@ void AuctionHouseBot::InitializeConfiguration()
// Buyer Bot // Buyer Bot
BuyingBotBuyCandidatesPerBuyCycle = sConfigMgr->GetOption<uint32>("AuctionHouseBot.Buyer.BuyCandidatesPerBuyCycle", 1); BuyingBotBuyCandidatesPerBuyCycle = sConfigMgr->GetOption<uint32>("AuctionHouseBot.Buyer.BuyCandidatesPerBuyCycle", 1);
BuyingBotAcceptablePriceModifier = sConfigMgr->GetOption<float>("AuctionHouseBot.Buyer.AcceptablePriceModifier", 1); BuyingBotAcceptablePriceModifier = sConfigMgr->GetOption<float>("AuctionHouseBot.Buyer.AcceptablePriceModifier", 1);
BuyingBotAlwaysBidMaxCalculatedPrice = sConfigMgr->GetOption<bool>("AuctionHouseBot.Buyer.AlwaysBidMaxCalculatedPrice", false);
PreventOverpayingForVendorItems = sConfigMgr->GetOption<bool>("AuctionHouseBot.Buyer.PreventOverpayingForVendorItems", true); PreventOverpayingForVendorItems = sConfigMgr->GetOption<bool>("AuctionHouseBot.Buyer.PreventOverpayingForVendorItems", true);
if (PreventOverpayingForVendorItems) if (PreventOverpayingForVendorItems)
populateVendorItemsPrices(); populateVendorItemsPrices();

View File

@@ -132,6 +132,7 @@ private:
uint32 ListingExpireTimeInSecondsMin; uint32 ListingExpireTimeInSecondsMin;
uint32 ListingExpireTimeInSecondsMax; uint32 ListingExpireTimeInSecondsMax;
float BuyingBotAcceptablePriceModifier; float BuyingBotAcceptablePriceModifier;
bool BuyingBotAlwaysBidMaxCalculatedPrice;
bool BuyingBotWillBidAgainstPlayers; bool BuyingBotWillBidAgainstPlayers;
std::vector<uint32> vendorItemsPrices; std::vector<uint32> vendorItemsPrices;
std::string AHCharactersGUIDsForQuery; std::string AHCharactersGUIDsForQuery;