Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When bidding, bot uses the wrong pricing method. #28

Open
steenburgh opened this issue Sep 29, 2020 · 3 comments
Open

When bidding, bot uses the wrong pricing method. #28

steenburgh opened this issue Sep 29, 2020 · 3 comments

Comments

@steenburgh
Copy link

steenburgh commented Sep 29, 2020

Perhaps I'm mistaken, but it looks like this line of code was meant to have a !. I'd make a PR but I'm not familiar enough with the code to be sure I'm correct.

The config says:

#    AuctionHouseBot.UseBuyPriceForBuyer
#        Should the Buyer use BuyPrice or SellPrice to determine Bid Prices
#    Default 0 (use SellPrice)

But the code seems to do the opposite:

if (BuyMethod)
{
if (prototype->Quality <= AHB_MAX_QUALITY)
{
if (currentprice < prototype->SellPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality))
bidMax = prototype->SellPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality);
}
else
{
// quality is something it shouldn't be, let's get out of here
if (debug_Out) sLog->outError( "AHBuyer: Quality %u not Supported", prototype->Quality);
continue;
}
}
else
{
if (prototype->Quality <= AHB_MAX_QUALITY)
{
if (currentprice < prototype->BuyPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality))
bidMax = prototype->BuyPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality);
}
else
{
// quality is something it shouldn't be, let's get out of here
if (debug_Out) sLog->outError( "AHBuyer: Quality %u not Supported", prototype->Quality);
continue;
}
}

@mserajnik
Copy link

This seems to still be an issue:

// check that bid has acceptable value and take bid based on vendorprice, stacksize and quality
if (BuyMethod)
{
if (prototype->Quality <= AHB_MAX_QUALITY)
{
if (currentprice < prototype->SellPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality))
bidMax = prototype->SellPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality);
}
else
{
// quality is something it shouldn't be, let's get out of here
if (debug_Out)
LOG_ERROR("module", "AHBuyer: Quality {} not Supported", prototype->Quality);
continue;
}
}
else
{
if (prototype->Quality <= AHB_MAX_QUALITY)
{
if (currentprice < prototype->BuyPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality))
bidMax = prototype->BuyPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality);
}
else
{
// quality is something it shouldn't be, let's get out of here
if (debug_Out)
LOG_ERROR("module", "AHBuyer: Quality {} not Supported", prototype->Quality);
continue;
}
}

It is checked if BuyMethod is true, which is the case when the configuration AuctionHouseBot.UseBuyPriceForBuyer is set to true.

But then it proceeds to use prototype->SellPrice there and prototype->BuyPrice when BuyMethod is false, so this seems to be reversed by mistake.

Can one of the maintainers confirm if this is correct or not? @Winfidonarleyan perhaps?

@Winfidonarleyan
Copy link
Member

Remind me to watch on Saturday, Discord or here via ping me

@WuStangDan
Copy link

Yes this bug is still here. I tested it in game to confirm (after being suspicious that a few high sells were going through) and yes even when setting in the config AuctionHouseBot.UseBuyPriceForBuyer = 0 it uses the buy price, not the sell price for the buyer.

This means that there are plenty of situations where you could create a money pump with this bot. Buying items from the bot and selling back at a much higher price.

Love the mod overall though, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants