mirror of
https://github.com/NathanHandley/mod-ah-bot-plus.git
synced 2026-01-31 01:23:49 +00:00
calculate new CyclesBetweenBuyOrSell only if update cycle is hit
This commit is contained in:
@@ -42,6 +42,7 @@ AuctionHouseBot::AuctionHouseBot() :
|
|||||||
SellingBotEnabled(false),
|
SellingBotEnabled(false),
|
||||||
BuyingBotEnabled(false),
|
BuyingBotEnabled(false),
|
||||||
CyclesBetweenBuyOrSellMin(1),
|
CyclesBetweenBuyOrSellMin(1),
|
||||||
|
CyclesBetweenBuyOrSell(1),
|
||||||
CyclesBetweenBuyOrSellMax(1),
|
CyclesBetweenBuyOrSellMax(1),
|
||||||
MaxBuyoutPriceInCopper(1000000000),
|
MaxBuyoutPriceInCopper(1000000000),
|
||||||
BuyoutVariationReducePercent(0.15f),
|
BuyoutVariationReducePercent(0.15f),
|
||||||
@@ -1176,9 +1177,10 @@ void AuctionHouseBot::Update()
|
|||||||
|
|
||||||
// Only update if the update cycle has been hit
|
// Only update if the update cycle has been hit
|
||||||
LastCycleCount++;
|
LastCycleCount++;
|
||||||
if (LastCycleCount < urand(CyclesBetweenBuyOrSellMin, CyclesBetweenBuyOrSellMax))
|
if (LastCycleCount < CyclesBetweenBuyOrSell)
|
||||||
return;
|
return;
|
||||||
LastCycleCount = 0;
|
LastCycleCount = 0;
|
||||||
|
CyclesBetweenBuyOrSell = urand(CyclesBetweenBuyOrSellMin, CyclesBetweenBuyOrSellMax);
|
||||||
|
|
||||||
// Randomly select the bot to load, and load it
|
// Randomly select the bot to load, and load it
|
||||||
uint32 botIndex = urand(0, AHCharacters.size() - 1);
|
uint32 botIndex = urand(0, AHCharacters.size() - 1);
|
||||||
@@ -1470,6 +1472,7 @@ void AuctionHouseBot::SetCyclesBetweenBuyOrSell()
|
|||||||
{
|
{
|
||||||
std::string cyclesConfigString = sConfigMgr->GetOption<std::string>("AuctionHouseBot.AuctionHouseManagerCyclesBetweenBuyOrSell", "1");
|
std::string cyclesConfigString = sConfigMgr->GetOption<std::string>("AuctionHouseBot.AuctionHouseManagerCyclesBetweenBuyOrSell", "1");
|
||||||
GetConfigMinAndMax(cyclesConfigString, CyclesBetweenBuyOrSellMin, CyclesBetweenBuyOrSellMax);
|
GetConfigMinAndMax(cyclesConfigString, CyclesBetweenBuyOrSellMin, CyclesBetweenBuyOrSellMax);
|
||||||
|
CyclesBetweenBuyOrSell = urand(CyclesBetweenBuyOrSellMin, CyclesBetweenBuyOrSellMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AuctionHouseBot::SetBuyingBotBuyCandidatesPerBuyCycle()
|
void AuctionHouseBot::SetBuyingBotBuyCandidatesPerBuyCycle()
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ private:
|
|||||||
bool SellingBotEnabled;
|
bool SellingBotEnabled;
|
||||||
bool BuyingBotEnabled;
|
bool BuyingBotEnabled;
|
||||||
uint32 CyclesBetweenBuyOrSellMin;
|
uint32 CyclesBetweenBuyOrSellMin;
|
||||||
|
uint32 CyclesBetweenBuyOrSell;
|
||||||
uint32 CyclesBetweenBuyOrSellMax;
|
uint32 CyclesBetweenBuyOrSellMax;
|
||||||
uint32 MaxBuyoutPriceInCopper;
|
uint32 MaxBuyoutPriceInCopper;
|
||||||
float BuyoutVariationReducePercent;
|
float BuyoutVariationReducePercent;
|
||||||
|
|||||||
Reference in New Issue
Block a user