Merge pull request #6 from NathanHandley/BotSellRework

Filter Normal weapons and armor, and Code Cleanup
This commit is contained in:
Nathan Handley
2023-11-16 08:03:45 -06:00
committed by GitHub
4 changed files with 25 additions and 473 deletions

View File

@@ -19,14 +19,6 @@
# Enable/Disable the part of AHBot that buys items from players
# Default 0 (disabled)
#
# AuctionHouseBot.UseBuyPriceForSeller
# Should the Seller use BuyPrice or SellPrice to determine Bid Prices
# Default 0 (use SellPrice)
#
# AuctionHouseBot.UseBuyPriceForBuyer
# Should the Buyer use BuyPrice or SellPrice to determine Bid Prices
# Default 0 (use SellPrice)
#
# Auction House Bot character data
# AuctionHouseBot.Account is the account number
# (in realmd->account table) of the player you want to run
@@ -45,8 +37,6 @@ AuctionHouseBot.DEBUG = 0
AuctionHouseBot.DEBUG_FILTERS = 0
AuctionHouseBot.EnableSeller = 0
AuctionHouseBot.EnableBuyer = 0
AuctionHouseBot.UseBuyPriceForSeller = 0
AuctionHouseBot.UseBuyPriceForBuyer = 0
AuctionHouseBot.Account = 0
AuctionHouseBot.GUID = 0
AuctionHouseBot.ItemsPerCycle = 1000
AuctionHouseBot.ItemsPerCycle = 50

View File

@@ -87,11 +87,11 @@ void AuctionHouseBot::calculateItemValue(ItemTemplate const* itemProto, uint64&
// Start with a buyout price related to the sell price
outBuyoutPrice = itemProto->SellPrice;
// Set a minimum base buyoutPrice to 5 silver for non-projectiles
// Set a minimum base buyoutPrice to 5-15 silver for non-projectiles
if (outBuyoutPrice < 500 && itemProto->Class != ITEM_CLASS_PROJECTILE)
{
// TODO: Move to a config
outBuyoutPrice = 500;
outBuyoutPrice = urand(500, 1500);
}
// Multiply the price based on quality
@@ -107,33 +107,15 @@ void AuctionHouseBot::calculateItemValue(ItemTemplate const* itemProto, uint64&
if (itemProto->SellPrice > outBuyoutPrice)
outBuyoutPrice = itemProto->SellPrice;
// Add a variance to the buyout price, minimum of 1%
uint64 sellVarianceBuyoutPriceTopPercent = 125;
uint64 sellVarianceBuyoutPriceBottomPercent = 75;
// Constrain variance top so that it can't be lower than bottom, and minimum values are 1%
if (sellVarianceBuyoutPriceTopPercent == 0)
sellVarianceBuyoutPriceTopPercent = 1;
if (sellVarianceBuyoutPriceBottomPercent == 0)
sellVarianceBuyoutPriceBottomPercent = 1;
if (sellVarianceBuyoutPriceTopPercent < sellVarianceBuyoutPriceBottomPercent)
sellVarianceBuyoutPriceTopPercent = sellVarianceBuyoutPriceBottomPercent;
// Apply variance to buyout price
// Calculate buyout price with a variance
uint64 sellVarianceBuyoutPriceTopPercent = 130;
uint64 sellVarianceBuyoutPriceBottomPercent = 70;
outBuyoutPrice = urand(sellVarianceBuyoutPriceBottomPercent * outBuyoutPrice, sellVarianceBuyoutPriceTopPercent * outBuyoutPrice);
outBuyoutPrice /= 100;
// Calculate a bid price based on a variance against buyout price, minimum of 1%
// Calculate a bid price based on a variance against buyout price
uint64 sellVarianceBidPriceTopPercent = 100;
uint64 sellVarianceBidPriceBottomPercent = 75;
if (sellVarianceBidPriceTopPercent == 0)
sellVarianceBidPriceTopPercent = 1;
if (sellVarianceBidPriceBottomPercent == 0)
sellVarianceBidPriceBottomPercent = 1;
if (sellVarianceBidPriceTopPercent < sellVarianceBidPriceBottomPercent)
sellVarianceBidPriceTopPercent = sellVarianceBidPriceBottomPercent;
// Calculate the bid price
outBidPrice = urand(sellVarianceBidPriceBottomPercent * outBuyoutPrice, sellVarianceBidPriceTopPercent * outBuyoutPrice);
outBidPrice /= 100;
}
@@ -218,7 +200,7 @@ void AuctionHouseBot::populateItemCandidateList()
if (itr->second.Bonding == BIND_WHEN_PICKED_UP)
continue;
// Restrict quality to anything under 7 (artifact and below) or are 0 (poor)
// Restrict quality to anything under 7 (artifact and below) or above poor
if (itr->second.Quality == 0 || itr->second.Quality > 6)
continue;
@@ -315,6 +297,22 @@ void AuctionHouseBot::populateItemCandidateList()
continue;
}
// Disable common weapons
if (itr->second.Quality == ITEM_QUALITY_NORMAL && itr->second.Class == ITEM_CLASS_WEAPON)
{
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled common weapon", itr->second.ItemId);
continue;
}
// Disable common armor
if (itr->second.Quality == ITEM_QUALITY_NORMAL && itr->second.Class == ITEM_CLASS_ARMOR)
{
if (debug_Out_Filters)
LOG_ERROR("module", "AuctionHouseBot: Item {} disabled common non-misc armor", itr->second.ItemId);
continue;
}
// Store the item ID
itemCandidatesByItemClass[itr->second.Class].push_back(itr->second.ItemId);
}
@@ -471,10 +469,9 @@ void AuctionHouseBot::addNewAuctions(Player *AHBplayer, AHBConfig *config)
auctionHouse->AddAuction(auctionEntry);
auctionEntry->SaveToDB(trans);
CharacterDatabase.CommitTransaction(trans);
}
}
void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *config, WorldSession *session)
{
if (!AHBBuyer)
@@ -758,8 +755,6 @@ void AuctionHouseBot::InitializeConfiguration()
AHBSeller = sConfigMgr->GetOption<bool>("AuctionHouseBot.EnableSeller", false);
AHBBuyer = sConfigMgr->GetOption<bool>("AuctionHouseBot.EnableBuyer", false);
SellMethod = sConfigMgr->GetOption<bool>("AuctionHouseBot.UseBuyPriceForSeller", false);
BuyMethod = sConfigMgr->GetOption<bool>("AuctionHouseBot.UseBuyPriceForBuyer", false);
AHBplayerAccount = sConfigMgr->GetOption<uint32>("AuctionHouseBot.Account", 0);
AHBplayerGUID = sConfigMgr->GetOption<uint32>("AuctionHouseBot.GUID", 0);
@@ -781,33 +776,6 @@ void AuctionHouseBot::Commands(uint32 command, uint32 ahMapID, uint32 col, char*
config = &NeutralConfig;
break;
}
std::string color;
switch (col)
{
case AHB_GREY:
color = "grey";
break;
case AHB_WHITE:
color = "white";
break;
case AHB_GREEN:
color = "green";
break;
case AHB_BLUE:
color = "blue";
break;
case AHB_PURPLE:
color = "purple";
break;
case AHB_ORANGE:
color = "orange";
break;
case AHB_YELLOW:
color = "yellow";
break;
default:
break;
}
switch (command)
{
case 0: //ahexpire
@@ -846,59 +814,6 @@ void AuctionHouseBot::Commands(uint32 command, uint32 ahMapID, uint32 col, char*
config->SetMaxItems(maxItems);
}
break;
case 3: //min time Deprecated (Place holder for future commands)
break;
case 4: //max time Deprecated (Place holder for future commands)
break;
case 5: //percentages
{
char * param1 = strtok(args, " ");
char * param2 = strtok(NULL, " ");
char * param3 = strtok(NULL, " ");
char * param4 = strtok(NULL, " ");
char * param5 = strtok(NULL, " ");
char * param6 = strtok(NULL, " ");
char * param7 = strtok(NULL, " ");
char * param8 = strtok(NULL, " ");
char * param9 = strtok(NULL, " ");
char * param10 = strtok(NULL, " ");
char * param11 = strtok(NULL, " ");
char * param12 = strtok(NULL, " ");
char * param13 = strtok(NULL, " ");
char * param14 = strtok(NULL, " ");
uint32 greytg = (uint32) strtoul(param1, NULL, 0);
uint32 whitetg = (uint32) strtoul(param2, NULL, 0);
uint32 greentg = (uint32) strtoul(param3, NULL, 0);
uint32 bluetg = (uint32) strtoul(param4, NULL, 0);
uint32 purpletg = (uint32) strtoul(param5, NULL, 0);
uint32 orangetg = (uint32) strtoul(param6, NULL, 0);
uint32 yellowtg = (uint32) strtoul(param7, NULL, 0);
uint32 greyi = (uint32) strtoul(param8, NULL, 0);
uint32 whitei = (uint32) strtoul(param9, NULL, 0);
uint32 greeni = (uint32) strtoul(param10, NULL, 0);
uint32 bluei = (uint32) strtoul(param11, NULL, 0);
uint32 purplei = (uint32) strtoul(param12, NULL, 0);
uint32 orangei = (uint32) strtoul(param13, NULL, 0);
uint32 yellowi = (uint32) strtoul(param14, NULL, 0);
auto trans = WorldDatabase.BeginTransaction();
trans->Append("UPDATE mod_auctionhousebot SET percentgreytradegoods = '{}' WHERE auctionhouse = '{}'", greytg, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentwhitetradegoods = '{}' WHERE auctionhouse = '{}'", whitetg, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentgreentradegoods = '{}' WHERE auctionhouse = '{}'", greentg, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentbluetradegoods = '{}' WHERE auctionhouse = '{}'", bluetg, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentpurpletradegoods = '{}' WHERE auctionhouse = '{}'", purpletg, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentorangetradegoods = '{}' WHERE auctionhouse = '{}'", orangetg, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentyellowtradegoods = '{}' WHERE auctionhouse = '{}'", yellowtg, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentgreyitems = '{}' WHERE auctionhouse = '{}'", greyi, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentwhiteitems = '{}' WHERE auctionhouse = '{}'", whitei, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentgreenitems = '{}' WHERE auctionhouse = '{}'", greeni, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentblueitems = '{}' WHERE auctionhouse = '{}'", bluei, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentpurpleitems = '{}' WHERE auctionhouse = '{}'", purplei, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentorangeitems = '{}' WHERE auctionhouse = '{}'", orangei, ahMapID);
trans->Append("UPDATE mod_auctionhousebot SET percentyellowitems = '{}' WHERE auctionhouse = '{}'", yellowi, ahMapID);
WorldDatabase.CommitTransaction(trans);
}
break;
case 12: //buyer bidding interval
{
char * param1 = strtok(args, " ");

View File

@@ -32,29 +32,6 @@ class WorldSession;
#include "ItemTemplate.h"
#define AHB_GREY 0
#define AHB_WHITE 1
#define AHB_GREEN 2
#define AHB_BLUE 3
#define AHB_PURPLE 4
#define AHB_ORANGE 5
#define AHB_YELLOW 6
#define AHB_MAX_QUALITY 6
#define AHB_GREY_TG 0
#define AHB_WHITE_TG 1
#define AHB_GREEN_TG 2
#define AHB_BLUE_TG 3
#define AHB_PURPLE_TG 4
#define AHB_ORANGE_TG 5
#define AHB_YELLOW_TG 6
#define AHB_GREY_I 7
#define AHB_WHITE_I 8
#define AHB_GREEN_I 9
#define AHB_BLUE_I 10
#define AHB_PURPLE_I 11
#define AHB_ORANGE_I 12
#define AHB_YELLOW_I 13
class AHBConfig
{
private:
@@ -151,8 +128,6 @@ private:
bool AHBSeller;
bool AHBBuyer;
bool BuyMethod;
bool SellMethod;
uint32 AHBplayerAccount;
ObjectGuid::LowType AHBplayerGUID;
@@ -179,8 +154,6 @@ private:
void addNewAuctions(Player *AHBplayer, AHBConfig *config);
void addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *config, WorldSession *session);
// friend class ACE_Singleton<AuctionHouseBot, ACE_Null_Mutex>;
AuctionHouseBot();
public:

View File

@@ -83,15 +83,8 @@ public:
handler->PSendSysMessage("ahexpire");
handler->PSendSysMessage("minitems");
handler->PSendSysMessage("maxitems");
//handler->PSendSysMessage("");
//handler->PSendSysMessage("");
handler->PSendSysMessage("percentages");
handler->PSendSysMessage("minprice");
handler->PSendSysMessage("maxprice");
handler->PSendSysMessage("minbidprice");
handler->PSendSysMessage("maxbidprice");
handler->PSendSysMessage("maxstack");
handler->PSendSysMessage("buyerprice");
handler->PSendSysMessage("bidinterval");
handler->PSendSysMessage("bidsperinterval");
return true;
@@ -128,325 +121,6 @@ public:
auctionbot->Commands(2, ahMapID, 0, param1);
}
else if (strncmp(opt, "mintime", l) == 0)
{
handler->PSendSysMessage("ahbotoptions mintime has been deprecated");
return false;
/*
char* param1 = strtok(NULL, " ");
if (!ahMapIdStr || !param1)
{
PSendSysMessage("Syntax is: ahbotoptions mintime $ahMapID (2, 6 or 7) $mintime");
return false;
}
auctionbot.Commands(3, ahMapID, 0, param1);
*/
}
else if (strncmp(opt, "maxtime", l) == 0)
{
handler->PSendSysMessage("ahbotoptions maxtime has been deprecated");
return false;
/*
char* param1 = strtok(NULL, " ");
if (!ahMapIdStr || !param1)
{
PSendSysMessage("Syntax is: ahbotoptions maxtime $ahMapID (2, 6 or 7) $maxtime");
return false;
}
auctionbot.Commands(4, ahMapID, 0, param1);
*/
}
else if (strncmp(opt, "percentages", l) == 0)
{
char* param1 = strtok(NULL, " ");
char* param2 = strtok(NULL, " ");
char* param3 = strtok(NULL, " ");
char* param4 = strtok(NULL, " ");
char* param5 = strtok(NULL, " ");
char* param6 = strtok(NULL, " ");
char* param7 = strtok(NULL, " ");
char* param8 = strtok(NULL, " ");
char* param9 = strtok(NULL, " ");
char* param10 = strtok(NULL, " ");
char* param11 = strtok(NULL, " ");
char* param12 = strtok(NULL, " ");
char* param13 = strtok(NULL, " ");
char* param14 = strtok(NULL, " ");
if (!ahMapIdStr || !param14)
{
handler->PSendSysMessage("Syntax is: ahbotoptions percentages $ahMapID (2, 6 or 7) $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14");
handler->PSendSysMessage("1 GreyTradeGoods 2 WhiteTradeGoods 3 GreenTradeGoods 4 BlueTradeGoods 5 PurpleTradeGoods");
handler->PSendSysMessage("6 OrangeTradeGoods 7 YellowTradeGoods 8 GreyItems 9 WhiteItems 10 GreenItems 11 BlueItems");
handler->PSendSysMessage("12 PurpleItems 13 OrangeItems 14 YellowItems");
handler->PSendSysMessage("The total must add up to 100%%");
return false;
}
uint32 greytg = uint32(strtoul(param1, NULL, 0));
uint32 whitetg = uint32(strtoul(param2, NULL, 0));
uint32 greentg = uint32(strtoul(param3, NULL, 0));
uint32 bluetg = uint32(strtoul(param4, NULL, 0));
uint32 purpletg = uint32(strtoul(param5, NULL, 0));
uint32 orangetg = uint32(strtoul(param6, NULL, 0));
uint32 yellowtg = uint32(strtoul(param7, NULL, 0));
uint32 greyi = uint32(strtoul(param8, NULL, 0));
uint32 whitei = uint32(strtoul(param9, NULL, 0));
uint32 greeni = uint32(strtoul(param10, NULL, 0));
uint32 bluei = uint32(strtoul(param11, NULL, 0));
uint32 purplei = uint32(strtoul(param12, NULL, 0));
uint32 orangei = uint32(strtoul(param13, NULL, 0));
uint32 yellowi = uint32(strtoul(param14, NULL, 0));
uint32 totalPercent = greytg + whitetg + greentg + bluetg + purpletg + orangetg + yellowtg + greyi + whitei + greeni + bluei + purplei + orangei + yellowi;
if (totalPercent == 0 || totalPercent != 100)
{
handler->PSendSysMessage("Syntax is: ahbotoptions percentages $ahMapID (2, 6 or 7) $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14");
handler->PSendSysMessage("1 GreyTradeGoods 2 WhiteTradeGoods 3 GreenTradeGoods 4 BlueTradeGoods 5 PurpleTradeGoods");
handler->PSendSysMessage("6 OrangeTradeGoods 7 YellowTradeGoods 8 GreyItems 9 WhiteItems 10 GreenItems 11 BlueItems");
handler->PSendSysMessage("12 PurpleItems 13 OrangeItems 14 YellowItems");
handler->PSendSysMessage("The total must add up to 100%%");
return false;
}
char param[100];
param[0] = '\0';
strcat(param, param1);
strcat(param, " ");
strcat(param, param2);
strcat(param, " ");
strcat(param, param3);
strcat(param, " ");
strcat(param, param4);
strcat(param, " ");
strcat(param, param5);
strcat(param, " ");
strcat(param, param6);
strcat(param, " ");
strcat(param, param7);
strcat(param, " ");
strcat(param, param8);
strcat(param, " ");
strcat(param, param9);
strcat(param, " ");
strcat(param, param10);
strcat(param, " ");
strcat(param, param11);
strcat(param, " ");
strcat(param, param12);
strcat(param, " ");
strcat(param, param13);
strcat(param, " ");
strcat(param, param14);
auctionbot->Commands(5, ahMapID, 0, param);
}
else if (strncmp(opt, "minprice", l) == 0)
{
char* param1 = strtok(NULL, " ");
char* param2 = strtok(NULL, " ");
if (!ahMapIdStr || !param1 || !param2)
{
handler->PSendSysMessage("Syntax is: ahbotoptions minprice $ahMapID (2, 6 or 7) $color (grey, white, green, blue, purple, orange or yellow) $price");
return false;
}
if (strncmp(param1, "grey", l) == 0)
auctionbot->Commands(6, ahMapID, AHB_GREY, param2);
else if (strncmp(param1, "white", l) == 0)
auctionbot->Commands(6, ahMapID, AHB_WHITE, param2);
else if (strncmp(param1, "green", l) == 0)
auctionbot->Commands(6, ahMapID, AHB_GREEN, param2);
else if (strncmp(param1, "blue", l) == 0)
auctionbot->Commands(6, ahMapID, AHB_BLUE, param2);
else if (strncmp(param1, "purple", l) == 0)
auctionbot->Commands(6, ahMapID, AHB_PURPLE, param2);
else if (strncmp(param1, "orange", l) == 0)
auctionbot->Commands(6, ahMapID, AHB_ORANGE, param2);
else if (strncmp(param1, "yellow", l) == 0)
auctionbot->Commands(6, ahMapID, AHB_YELLOW, param2);
else
{
handler->PSendSysMessage("Syntax is: ahbotoptions minprice $ahMapID (2, 6 or 7) $color (grey, white, green, blue, purple, orange or yellow) $price");
return false;
}
}
else if (strncmp(opt, "maxprice", l) == 0)
{
char* param1 = strtok(NULL, " ");
char* param2 = strtok(NULL, " ");
if (!ahMapIdStr || !param1 || !param2)
{
handler->PSendSysMessage("Syntax is: ahbotoptions maxprice $ahMapID (2, 6 or 7) $color (grey, white, green, blue, purple, orange or yellow) $price");
return false;
}
if (strncmp(param1, "grey", l) == 0)
auctionbot->Commands(7, ahMapID, AHB_GREY, param2);
else if (strncmp(param1, "white", l) == 0)
auctionbot->Commands(7, ahMapID, AHB_WHITE, param2);
else if (strncmp(param1, "green", l) == 0)
auctionbot->Commands(7, ahMapID, AHB_GREEN, param2);
else if (strncmp(param1, "blue", l) == 0)
auctionbot->Commands(7, ahMapID, AHB_BLUE, param2);
else if (strncmp(param1, "purple", l) == 0)
auctionbot->Commands(7, ahMapID, AHB_PURPLE, param2);
else if (strncmp(param1, "orange",l) == 0)
auctionbot->Commands(7, ahMapID, AHB_ORANGE, param2);
else if (strncmp(param1, "yellow", l) == 0)
auctionbot->Commands(7, ahMapID, AHB_YELLOW, param2);
else
{
handler->PSendSysMessage("Syntax is: ahbotoptions maxprice $ahMapID (2, 6 or 7) $color (grey, white, green, blue, purple, orange or yellow) $price");
return false;
}
}
else if (strncmp(opt, "minbidprice", l) == 0)
{
char* param1 = strtok(NULL, " ");
char* param2 = strtok(NULL, " ");
if (!ahMapIdStr || !param2 || !param2)
{
handler->PSendSysMessage("Syntax is: ahbotoptions minbidprice $ahMapID (2, 6 or 7) $color (grey, white, green, blue, purple, orange or yellow) $price");
return false;
}
uint32 minBidPrice = uint32(strtoul(param2, NULL, 0));
if (minBidPrice < 1 || minBidPrice > 100)
{
handler->PSendSysMessage("The min bid price multiplier must be between 1 and 100");
return false;
}
if (strncmp(param1, "grey", l) == 0)
auctionbot->Commands(8, ahMapID, AHB_GREY, param2);
else if (strncmp(param1, "white", l) == 0)
auctionbot->Commands(8, ahMapID, AHB_WHITE, param2);
else if (strncmp(param1, "green", l) == 0)
auctionbot->Commands(8, ahMapID, AHB_GREEN, param2);
else if (strncmp(param1, "blue", l) == 0)
auctionbot->Commands(8, ahMapID, AHB_BLUE, param2);
else if (strncmp(param1, "purple", l) == 0)
auctionbot->Commands(8, ahMapID, AHB_PURPLE, param2);
else if (strncmp(param1, "orange", l) == 0)
auctionbot->Commands(8, ahMapID, AHB_ORANGE, param2);
else if (strncmp(param1, "yellow", l) == 0)
auctionbot->Commands(8, ahMapID, AHB_YELLOW, param2);
else
{
handler->PSendSysMessage("Syntax is: ahbotoptions minbidprice $ahMapID (2, 6 or 7) $color (grey, white, green, blue, purple, orange or yellow) $price");
return false;
}
}
else if (strncmp(opt, "maxbidprice", l) == 0)
{
char* param1 = strtok(NULL, " ");
char* param2 = strtok(NULL, " ");
if (!ahMapIdStr || !param1 || !param2)
{
handler->PSendSysMessage("Syntax is: ahbotoptions maxbidprice $ahMapID (2, 6 or 7) $color (grey, white, green, blue, purple, orange or yellow) $price");
return false;
}
uint32 maxBidPrice = uint32(strtoul(param2, NULL, 0));
if (maxBidPrice < 1 || maxBidPrice > 100)
{
handler->PSendSysMessage("The max bid price multiplier must be between 1 and 100");
return false;
}
if (strncmp(param1, "grey", l) == 0)
auctionbot->Commands(9, ahMapID, AHB_GREY, param2);
else if (strncmp(param1, "white", l) == 0)
auctionbot->Commands(9, ahMapID, AHB_WHITE, param2);
else if (strncmp(param1, "green", l) == 0)
auctionbot->Commands(9, ahMapID, AHB_GREEN, param2);
else if (strncmp(param1, "blue", l) == 0)
auctionbot->Commands(9, ahMapID, AHB_BLUE, param2);
else if (strncmp(param1, "purple", l) == 0)
auctionbot->Commands(9, ahMapID, AHB_PURPLE, param2);
else if (strncmp(param1, " orange", l) == 0)
auctionbot->Commands(9, ahMapID, AHB_ORANGE, param2);
else if (strncmp(param1, "yellow", l) == 0)
auctionbot->Commands(9, ahMapID, AHB_YELLOW, param2);
else
{
handler->PSendSysMessage("Syntax is: ahbotoptions max bidprice $ahMapID (2, 6 or 7) $color (grey, white, green, blue, purple, orange or yellow) $price");
return false;
}
}
else if (strncmp(opt, "maxstack",l) == 0)
{
char* param1 = strtok(NULL, " ");
char* param2 = strtok(NULL, " ");
if (!ahMapIdStr || !param1 || !param2)
{
handler->PSendSysMessage("Syntax is: ahbotoptions maxstack $ahMapID (2, 6 or 7) $color (grey, white, green, blue, purple, orange or yellow) $value");
return false;
}
// uint32 maxStack = uint32(strtoul(param2, NULL, 0));
// if (maxStack < 0)
// {
// handler->PSendSysMessage("maxstack can't be a negative number.");
// return false;
// }
if (strncmp(param1, "grey",l) == 0)
auctionbot->Commands(10, ahMapID, AHB_GREY, param2);
else if (strncmp(param1, "white", l) == 0)
auctionbot->Commands(10, ahMapID, AHB_WHITE, param2);
else if (strncmp(param1, "green", l) == 0)
auctionbot->Commands(10, ahMapID, AHB_GREEN, param2);
else if (strncmp(param1, "blue", l) == 0)
auctionbot->Commands(10, ahMapID, AHB_BLUE, param2);
else if (strncmp(param1, "purple", l) == 0)
auctionbot->Commands(10, ahMapID, AHB_PURPLE, param2);
else if (strncmp(param1, "orange", l) == 0)
auctionbot->Commands(10, ahMapID, AHB_ORANGE, param2);
else if (strncmp(param1, "yellow", l) == 0)
auctionbot->Commands(10, ahMapID, AHB_YELLOW, param2);
else
{
handler->PSendSysMessage("Syntax is: ahbotoptions maxstack $ahMapID (2, 6 or 7) $color (grey, white, green, blue, purple, orange or yellow) $value");
return false;
}
}
else if (strncmp(opt, "buyerprice", l) == 0)
{
char* param1 = strtok(NULL, " ");
char* param2 = strtok(NULL, " ");
if (!ahMapIdStr || !param1 || !param2)
{
handler->PSendSysMessage("Syntax is: ahbotoptions buyerprice $ahMapID (2, 6 or 7) $color (grey, white, green, blue or purple) $price");
return false;
}
if (strncmp(param1, "grey", l) == 0)
auctionbot->Commands(11, ahMapID, AHB_GREY, param2);
else if (strncmp(param1, "white", l) == 0)
auctionbot->Commands(11, ahMapID, AHB_WHITE, param2);
else if (strncmp(param1, "green", l) == 0)
auctionbot->Commands(11, ahMapID, AHB_GREEN, param2);
else if (strncmp(param1, "blue", l) == 0)
auctionbot->Commands(11, ahMapID, AHB_BLUE, param2);
else if (strncmp(param1, "purple", l) == 0)
auctionbot->Commands(11, ahMapID, AHB_PURPLE, param2);
else if (strncmp(param1, "orange", l) == 0)
auctionbot->Commands(11, ahMapID, AHB_ORANGE, param2);
else if (strncmp(param1, "yellow", l) == 0)
auctionbot->Commands(11, ahMapID, AHB_YELLOW, param2);
else
{
handler->PSendSysMessage("Syntax is: ahbotoptions buyerprice $ahMapID (2, 6 or 7) $color (grey, white, green, blue or purple) $price");
return false;
}
}
else if (strncmp(opt, "bidinterval", l) == 0)
{
char* param1 = strtok(NULL, " ");