# Statistics

![Showcase](https://4233628743-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MNnv7S-sLVu0cX0Z4As%2Fuploads%2Fgit-blob-d5485d910d81c14566f92ad9ee1e785821128629%2Fshowcase.gif?alt=media)

**zAuctionStats** is a premium addon that significantly enhances your auction house experience by adding powerful features such as placeholders, commands, and customizable inventories. With zAuctionStats, you can take your server's auction house functionality to the next level, offering players a more dynamic and engaging experience.

This addon is available for purchase from the following trusted platforms:

* [**BuildByBits**](https://builtbybit.com/resources/zauctionhouse-stats.41622/): Purchase and download instantly to get started with advanced auction statistics and more.
* [**GroupeZ**](https://groupez.dev/resources/zauctionhouse-stats.319): Start enhancing your auction house today with seamless access to zAuctionStats.

Get zAuctionStats now and bring a new level of depth to your auction system, impressing your players with detailed statistics and better control over their auction activities.

## Installation:

Installing **zAuctionStats** is simple and straightforward. Follow these steps to get started:

1. **Download and Place in Plugins Folder**: Download the zAuctionStats addon from your preferred platform and place the `.jar` file into your server's `plugins` folder.
2. **Launch Your Server**: Start your server to allow the plugin to initialize and create the necessary configuration files.
3. **Configure the Database**: After the first launch, stop your server and locate the generated `.yml` file in the `plugins/zAuctionStats` folder. You will need to configure the database settings to store all the information the plugin needs. Supported database types include **MySQL** and **SQLite**. Fill in your database details in the `config.yml` file.
4. **Restart the Server**: Once the configuration is complete, restart your server. The plugin will now be fully operational, and you can begin using all its features.

Below is an example of the `config.yml` file for database configuration:

#### Config.yml

```yaml
# Displays more information in the console, if you have a problem please enable this option and send errors to support.
enableDebug: false

# Enables time debugs, is used to measure plugin performance
enableDebugTime: false

sql:
  # Available type: MYSQL and SQLITE
  type: MYSQL
  debug: false
  host: 192.168.10.10
  port: 3306
  user: homestead
  password: 'secret'
  database: zauctionhouse

noName: "✘"
noAmount: "0"
loading: "Loading..."

cacheDurationMaterial: 3600000
```

Ensure that your database credentials are correct to avoid any connection issues.

### Features:

* **Over 40 Custom Placeholders**: Enrich your server's experience with over 40 unique placeholders, providing detailed auction statistics that players can interact with.
* **Centralized Data Storage**: Store all auction data in a centralized database for better organization and analysis. Supports **MySQL** and **SQLite** for maximum compatibility.
* **New Command for Price Checking**: Use the new `/ah price [<economy name>]` command to quickly display item prices and help players make informed purchasing decisions.
* **Example Inventories Included**: Get started quickly with two example inventories that showcase the powerful customization options available.
* **Open Source Availability**: The code is fully open source, allowing you to review, contribute, or customize it further to suit your needs. Check it out here: [GitHub - zAuctionHouse-Stats](https://github.com/Maxlego08/zAuctionHouse-Stats).
* **Easy Integration and Customization**: zAuctionStats is designed to be easy to integrate with your current server setup, and it comes with plenty of configuration options to tailor it exactly as you need.
* **Real-time Auction Data**: Provides real-time tracking of auction activity, empowering both players and server admins with actionable insights.
* **Optimized Performance**: Built with performance in mind, ensuring minimal impact on server resources while delivering powerful statistics and features.

Would you like to have more placeholders? Come ask me on [Discord](https://discord.groupez.dev/).

## Global Placeholders:

| Placeholders                                     | Description                                               |
| ------------------------------------------------ | --------------------------------------------------------- |
| `%zahstats_item_sold_amount%`                    | The number of items listed for sale.                      |
| `%zahstats_item_purchase_amount%`                | The number of items purchased.                            |
| `%zahstats_number_of_items_not_sold%`            | The number of unsold items that will expire.              |
| `%zahstats_number_of_items_expired%`             | The number of items that have expired.                    |
| `%zahstats_number_of_items_remove_from_expire%`  | The number of items removed from the EXPIRE storage type. |
| `%zahstats_number_of_items_remove_from_storage%` | The number of items removed from the ITEMS storage type.  |
| `%zahstats_number_of_items_remove_from_bought%`  | The number of items removed from the BUY storage type.    |
| `%zahstats_number_of_items_destroy%`             | The number of items that have been destroyed.             |
| `%zahstats_auction_opened%`                      | The number of times the auction house was opened.         |

## Global Economy Placeholders:

| Placeholders                                                     | Description                                                          |
| ---------------------------------------------------------------- | -------------------------------------------------------------------- |
| `%zahstats_money_spend_<economy name>%`                          | Total money spent in the auction house.                              |
| `%zahstats_total_price_of_all_items_sold_<economy name>%`        | Cumulative price of all items that were listed for sale.             |
| `%zahstats_money_spend_format_<economy name>%`                   | Total money spent in the auction house. (Formatted)                  |
| `%zahstats_total_price_of_all_items_sold_format_<economy name>%` | Cumulative price of all items that were listed for sale. (Formatted) |

## Player Placeholders:

| Placeholders                                           | Description                      |
| ------------------------------------------------------ | -------------------------------- |
| `%zahstats_player_total_sales%`                        | Total items on sale.             |
| `%zahstats_player_total_purchases%`                    | Total items purchased.           |
| `%zahstats_player_total_sales_format%`                 | Total items on sale formatted.   |
| `%zahstats_player_total_purchases_format%`             | Total items purchased formatted. |
| `%zahstats_player_total_earned_<economy name>%`        | Total money earned.              |
| `%zahstats_player_total_spent_<economy name>%`         | Total money spent.               |
| `%zahstats_player_total_format_earned_<economy name>%` | Total money earned formatted.    |
| `%zahstats_player_total_format_spent_<economy name>%`  | Total money spent formatted.     |

## Ranking Placeholders:

| Placeholders                                                    | Description                               |
| --------------------------------------------------------------- | ----------------------------------------- |
| `%zahstats_who_spent_most_money_name_<economy name>%`           | Who spent the most - Name.                |
| `%zahstats_who_spent_most_money_amount_<economy name>%`         | Who spent the most - Amount.              |
| `%zahstats_format_who_spent_most_money_amount_<economy name>%`  | Who spent the most - Amount. (Formatted)  |
| `%zahstats_who_earned_most_money_name_<economy name>%`          | Who earned the most - Name.               |
| `%zahstats_who_earned_most_money_amount_<economy name>%`        | Who earned the most - Amount.             |
| `%zahstats_format_who_earned_most_money_amount_<economy name>%` | Who earned the most - Amount. (Formatted) |
| `%zahstats_who_purchased_most_items_name_<economy name>%`       | Who purchased the most - Name.            |
| `%zahstats_who_purchased_most_items_amount_<economy name>%`     | Who purchased the most - Amount.          |
| `%zahstats_who_sales_most_items_name_<economy name>%`           | Who sales the most - Name.                |
| `%zahstats_who_sales_most_items_amount_<economy name>%`         | Who sales the most - Amount.              |
| `%zahstats_who_purchased_most_items_name%`                      | Who purchased the most - Name.            |
| `%zahstats_who_purchased_most_items_amount%`                    | Who purchased the most - Amount.          |
| `%zahstats_who_sales_most_items_name%`                          | Who sales the most - Name.                |
| `%zahstats_who_sales_most_items_amount%`                        | Who sales the most - Amount.              |

## Material Placeholders:

| Placeholders                                                   | Description                           |
| -------------------------------------------------------------- | ------------------------------------- |
| `%zahstats_material_average_<economy name>_<material>%`        | Average price of an item.             |
| `%zahstats_material_median_<economy name>_<material>%`         | Median price of an item.              |
| `%zahstats_material_amount_<economy name>_<material>%`         | Amount of items.                      |
| `%zahstats_material_format_average_<economy name>_<material>%` | Average price of an item. (Formatted) |
| `%zahstats_material_format_median_<economy name>_<material>%`  | Median price of an item. (Formatted)  |
| `%zahstats_material_format_amount_<economy name>_<material>%`  | Amount of items. (Formatted)          |

## Commands

| Command                | Permission                       | Description              |
| ---------------------- | -------------------------------- | ------------------------ |
| `/zahstats`            | `zauctionhouse.stats.use`        | Display commands         |
| `/zahstats reload`     | `zauctionhouse.stats.reload`     | Reload configurations    |
| `/zahstats clearcache` | `zauctionhouse.stats.clearcache` | Clear plugin cache       |
| `/ah price`            | `zauctionhouse.price`            | Display item information |
