Skip to content

Commit

Permalink
Market price adaptation mechanism (#102)
Browse files Browse the repository at this point in the history
* Initialization fixed to be performed at script startup; included copyright in the new source files

* Handle of the configuration reloading in the correct way from the command line (cleanup and initialization of new elements)

* Improved the help text and descriptions

* Introduced a mechanism that allows the bot to adapt to the market prices (right now is a plain average which resets to allow quick convergence with the markets sentiments)

* Threshold for market per-item price reset now implemented as a configurable value

* Adjusted the license on the source files
  • Loading branch information
kewinrausch authored Sep 8, 2024
1 parent cb89a9d commit 86f62d2
Show file tree
Hide file tree
Showing 17 changed files with 532 additions and 192 deletions.
40 changes: 33 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,55 @@ ALTER TABLE `auctionhousebot` RENAME TO `mod_auctionhousebot`;
## Description

An auction house bot for the best core: AzerothCore.
This mod works by selling and bidding auctions in the factions auction house. It can be instructed to do both the operations independently.

## Installation

```
1. Simply place the module under the `modules` directory of your AzerothCore source.
1. Import the SQL manually to the right Database (auth, world or characters) or with the `db_assembler.sh` (if `include.sh` provided).
1. Simply place the module under the `modules` directory of your AzerothCore source.
1. Import the SQL manually to the right Database (auth, world or characters).
1. Re-run cmake and launch a clean build of AzerothCore.
```

## Edit module configuration (optional)

If you need to change the module configuration, go to your server configuration folder (where your `worldserver` or `worldserver.exe` is)
rename the file mod_ahbot.conf.dist to mod_ahbot.conf and edit it.

## Usage

Edit the module configuration and add a player account ID and a character ID.
This character will sell and buy items in the auction house so give him a good name.
If you only specify the account ID, all the characters created within that account will be involved in selling and bidding on the markets.

Specify what operation must be performed (`EnableSeller`, `EnableBuyer` or both).

Notes:
- The account used does not need any security level and can be a player account.
- The character used by the ahbot is not meant to be used ingame. If you use it to browse the auction house, you might have issues like "Searching for items..." displaying forever.

## Edit module configuration (optional)

If you need to change the module configuration, go to your server configuration folder (where your `worldserver` or `worldserver.exe` is)
rename the file mod_ahbot.conf.dist to mod_ahbot.conf and edit it. This will change the overall behavior of the bot.

If you need to change a more specific value (for example the quotas of item sold), you will need to update values int the `mod_auctionhousebot` table or use the command line.

The default quotas of all the auction houses for trade goods are:
- Gray = 0
- White = 27
- Green = 12
- Blue = 10
- Purple = 1
- Orange = 0
- Yellow = 0

The default quotas of all the auction houses for non trade goods items are:
- Gray = 0
- White = 10
- Green = 30
- Blue = 8
- Purple = 2
- Orange = 0
- Yellow = 0

The sum of the percentage for these categories must always be 100, or otherwise the defaults values will be used and the modifications will not be accepted.

## Credits

- Ayase: ported the bot to AzerothCore
Expand Down
16 changes: 15 additions & 1 deletion conf/mod_ahbot.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@
# Should the Buyer use BuyPrice or SellPrice to determine Bid Prices
# Default 0 (use SellPrice)
#
# AuctionHouseBot.UseMarketPriceForSeller
# Should the Seller use the market price for its auctions?
# Default 0 (disabled)
#
# AuctionHouseBot.MarketResetThreshold
# How many auctions of the same item are necessary before the plain priceis adopted.
# Before reaching this threshold, the price increase/decrease according to an heuristic.
# Set this variable to a lower value to have a fast reacting market price,
# to an high value to smooth the oscillations in prices.
# Default 25
#
# Auction House Bot character data
# AuctionHouseBot.Account is the account number
# (in realmd->account table) of the player you want to run
Expand All @@ -62,6 +73,8 @@
# AuctionHouseBot.ConsiderOnlyBotAuctions
# Ignore player auctions and consider only bot ones when keeping track of the numer of auctions in place.
# This allow to keep a background noise in the market even when lot of players are in.
# If this is not set, players acutions are counted in the valid auctions and you will need to greatly increase the maxitems SQL values to
# allow the bot to operate on the market. If this is set the players auctions will not be considered.
# Default 0 (False)
#
# AuctionHouseBot.DuplicatesCount
Expand All @@ -81,7 +94,6 @@
# 2 = shorts, auctions lasts within an hour
# Default 1
#
#
###############################################################################

AuctionHouseBot.DEBUG = 0
Expand All @@ -96,6 +108,8 @@ AuctionHouseBot.EnableSeller = 0
AuctionHouseBot.EnableBuyer = 0
AuctionHouseBot.UseBuyPriceForSeller = 0
AuctionHouseBot.UseBuyPriceForBuyer = 0
AuctionHouseBot.UseMarketPriceForSeller = 0
AuctionHouseBot.MarketResetThreshold = 25
AuctionHouseBot.Account = 0
AuctionHouseBot.GUID = 0
AuctionHouseBot.ItemsPerCycle = 200
Expand Down
28 changes: 21 additions & 7 deletions data/sql/db-world/mod_auctionhousebot.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
--
-- Main configuration for the auction houses
--

DROP TABLE IF EXISTS `mod_auctionhousebot`;
CREATE TABLE `mod_auctionhousebot` (
`auctionhouse` int(11) NOT NULL DEFAULT '0' COMMENT 'mapID of the auctionhouse.',
Expand Down Expand Up @@ -65,20 +69,30 @@ CREATE TABLE `mod_auctionhousebot` (
PRIMARY KEY (`auctionhouse`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `mod_auctionhousebot_disabled_items`;
CREATE TABLE `mod_auctionhousebot_disabled_items` (
`item` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`item`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- AHBot auction houses default configuration values
--

-- AHBot auctionhouse configuration
INSERT INTO `mod_auctionhousebot` (`auctionhouse`, `name`, `minitems`, `maxitems`, `percentgreytradegoods`, `percentwhitetradegoods`, `percentgreentradegoods`, `percentbluetradegoods`, `percentpurpletradegoods`, `percentorangetradegoods`, `percentyellowtradegoods`, `percentgreyitems`, `percentwhiteitems`, `percentgreenitems`, `percentblueitems`, `percentpurpleitems`, `percentorangeitems`, `percentyellowitems`, `minpricegrey`, `maxpricegrey`, `minpricewhite`, `maxpricewhite`, `minpricegreen`, `maxpricegreen`, `minpriceblue`, `maxpriceblue`, `minpricepurple`, `maxpricepurple`, `minpriceorange`, `maxpriceorange`, `minpriceyellow`, `maxpriceyellow`, `minbidpricegrey`, `maxbidpricegrey`, `minbidpricewhite`, `maxbidpricewhite`, `minbidpricegreen`, `maxbidpricegreen`, `minbidpriceblue`, `maxbidpriceblue`, `minbidpricepurple`, `maxbidpricepurple`, `minbidpriceorange`, `maxbidpriceorange`, `minbidpriceyellow`, `maxbidpriceyellow`, `maxstackgrey`, `maxstackwhite`, `maxstackgreen`, `maxstackblue`, `maxstackpurple`, `maxstackorange`, `maxstackyellow`, `buyerpricegrey`, `buyerpricewhite`, `buyerpricegreen`, `buyerpriceblue`, `buyerpricepurple`, `buyerpriceorange`, `buyerpriceyellow`, `buyerbiddinginterval`, `buyerbidsperinterval`)
VALUES
(2,'Alliance',250,250,0,27,12,10,1,0,0,0,10,30,8,2,0,0,100,150,150,250,800,1400,1250,1750,2250,4550,3250,5550,5250,6550,70,100,70,100,80,100,75,100,80,100,80,100,80,100,0,0,3,2,1,1,1,1,3,5,12,15,20,22,1,1),
(6,'Horde',250,250,0,27,12,10,1,0,0,0,10,30,8,2,0,0,100,150,150,250,800,1400,1250,1750,2250,4550,3250,5550,5250,6550,70,100,70,100,80,100,75,100,80,100,80,100,80,100,0,0,3,2,1,1,1,1,3,5,12,15,20,22,1,1),
(7,'Neutral',250,250,0,27,12,10,1,0,0,0,10,30,8,2,0,0,100,150,150,250,800,1400,1250,1750,2250,4550,3250,5550,5250,6550,70,100,70,100,80,100,75,100,80,100,80,100,80,100,0,0,3,2,1,1,1,1,3,5,12,15,20,22,1,1);

-- Items unavailable to players
--
-- Items blacklist
--

DROP TABLE IF EXISTS `mod_auctionhousebot_disabled_items`;
CREATE TABLE `mod_auctionhousebot_disabled_items` (
`item` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`item`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Blacklist default values
--

INSERT INTO `mod_auctionhousebot_disabled_items`
VALUES
(17), (3895), (1700), (862), (4196), (3934), (2275), (4213), (4988), (4989), (4990), (4110), (4111), (4116), (3463), (3068),
Expand Down
Loading

0 comments on commit 86f62d2

Please sign in to comment.