AutoPrice
AutoPrice Bukkit plugin
A shop plugin with GUI and dynamic prices.
Features
- Highly configurable.
- Good default configuration for lazy server owners (like myself).
- Designed to require minimum input from server owner.
- Commands and GUI (Graphical User Interface).
- Prices will automatically be adjusted based on supply and demand of each material.
- The shop can be accessed by any player at any location.
- The plugin keeps track of each material's stock, players can't buy more than has been sold.
- Item damage/condition is considered in price paid and stock increased. For example selling two items in 50% condition will earn you total 100% of normal price and add total one item to the stock.
Known limitations
- It takes a while for the plugin to learn the true value of each material.
- The plugin automatically saves the changed information to configuration file, so it's best to stop the server if you plan to work on the configuration file. You can however try to edit it quickly and use /ap reload.
- Materials in shop can only be rearranged by editing the configuration file. Renaming an item will however move it to the end.
- Each purchase is added to player's inventory as a new stack.
- Does not support the wildcards in permission nodes of PermissionsBukkit
Shop GUI usage
The shop GUI looks like a chest, but there are couple differences. The top window shows the items you can buy and bottom shows items you can sell. When hovering over any item, information about that material is displayed (price for example).
The amount you sell/buy depends on the type of click
- Left click = 1 unit
- Right click = 4 units
- Shift + left click = 16 unit
- Shift + right click = 64 units
To change page on top/buying part click the empty slot
- Left click = next page
- Right click = previous page
Requirements
AutoPrice is just a shop plugin. For AP to work you will also need to install an economy plugin like Essentials economy. AP does not directly support any economy plugins so you need to install Vault that works as an adapter between AP and the economy plugin of your choice.
Infinite stock
Here's an example how to configure an item to have infinite stock. Here the purchase price is 0,55 and stock is infinite. The plugin normally adjusts prices based on purchases and sales, manually adjusting stocks can cause issues with dynamic prices.
APPLE: baseSalesPriceForPlayer: 0.5 mainMaterial: APPLE subMaterial: 0 stockPerPurchasePrice: 0,55: !!float 'Infinity'
Questions & answers
- How to get stock?
- Let players sell stuff (prices will slowly normalize) or set stock manually in the configuration file (but don't expect the plugin to learn the value of the item).
- How to increase the prices?
- Let players buy all the stock and wait for the prices to increase. If all prices raise too slow, decrease updateIntervalTicks in the configuration file. Low supply & high demand = high price.
- Why does the sales price of an item drop to 0.01 as soon as I sell the first one?
- Cause that item now has sales but no purchases. High supply & low demand = low price.
@Delebird
I added categories to AutoPrice version 4.043, which will be out in couple days. Not as good as tabs but close.
@MCCharlieCraft
Could you pastebin the whole configuration file and a log that shows the sales price increasing beyond purchase price?
@tubelius
That was with no manual adjustment.
As players sell things, other items values go up, and it allows for certain item costs to be manipulated.
Lets use wool as an example.
The other problem this causes is when players are buying the wool. The price will be normal for all 64 of the wool sold at 0.01, then there will be this one lone wool at 3.67 in the stock waiting for someone to buy it at a high price.
This is all with 0 manual ajustment past the initial set up.
I am not trying to be a pest, I really like the plugin. It just does some weird things sometimes. The addition of salesPriceMin, and salesPriceMax really helped. Testing it in a new configuration over the next few days.
Thanks.
@MCCharlieCraft
Did you increase the player's sales prices manually past the purchase price? That's the only thing that should cause this issue. Feels kind of pointless to add a feature to fix prices that have been manually set to cause losses. Anyway, I'll do it if I have time.
After a few days of testing, it seems the plugin needs to adjust the price of old stock if it would sell for less than the current value.
All players are doing is buying items and reselling them for more than they paid. I understand that it is still generating a profit based off the initial transaction, but players should not be able to buy an item then sell it for more immediately after purchase.
This is copied and pasted from the server logs, so the transaction order goes from bottom to top. Look at time stamps. It goes on like this for hours. I've watched some players gain 5000 money in 30 minutes of just buying and selling.
@tubelius
Exactly.
It would be cool if you made that a option in the config.
@MCCharlieCraft
You mean the shop should ignore/remove the lores (sockets and stuff) when they sell them? Socket stick should be sold as stick? It's not currently possible.
@tubelius
Awesome about the price limits.
I know you updated version 4.0 to be compatible with Mythic Drops. Is there a way to allow players to sell their MD items as if they were normal items? I want a way for my players to be able to get something out of all the excess stuff that drops that they don't need.
@MCCharlieCraft
AutoPrice version 4.035 supports more price limits. It will be out in couple days. You can use the new limits to setup static prices.
For next version I'll probably implement a way to use permissions to restrict what items players can sell and what items they can buy.
@MCCharlieCraft
It's currently not possible to limit how much players can sell, but the sales price will drop to minimum if they just keep selling. Maybe you could set minimum price to 0, so they wouldn't get paid anymore when there's high supply and low demand.
After the plugin collected some more data the left/right click for selling stacks of stuff has now started working.
Its probably as you said, the plugin was just adjusting prices.
@tubelius
Buying works fine if there. Its when trying to sell stacks of item to the shop that the left/right click features do not work.
Also, is it possible to have a max item limit? Like the shop will not buy more than 1000 dirt? Everyone is selling their dirt.
Thanks for the fast reply's btw.
@MCCharlieCraft
Maybe the plugin feels the need to lower the sales price after each one you sell? Or you are clicking on a stack that has only one item?
The sell with left, right, shift left, and shift right are all only selling 1 item.
Buying works correctly.
@MCCharlieCraft
If you don't want to take money away from players you can use settings below. With this players can buy items at the same prices they were sold at:
If you want purchase price to be 2.9% (but at least $0.35) higher than the original sales price used when selling them, you can use:
@tubelius
That would be great. The plugin will provide a great money sink for the server as it takes a profit from each transaction. However, with each item fluctuatng based on supply and demand, and with money being removed from the economy, there needs to be a way for players to receive a set amount of money for at least a single item, so money goes into the economy as well as filters out.
Another great feature that you could add if you wanted to or had the time, is a flat fee and a percent based fee instead of a minimum profit margin.
The minimum profit margin has the server taking a set amount with each transaction but does not change depending on how much or how little is actually spent.
An example of this is PayPal fee's. Every time you receive money from someone thru PayPal, you pay a flat fee of $0.35 + 2.9%. This way PayPal gets no less than $0.35 (minimum profit margin), and the 2.9% helps adjusts the fees for larger amounts received.
@MCCharlieCraft
Unfortunately not, but I think I'll implement those features for the next version (1-2 weeks).
Is there a way to make an item have a constant value when buying from players, and also not allow the sale of it back to players?
@MCCharlieCraft
You are welcome. Submit a ticket if you need help with something and can't find help on the documentation.
I am going to be testing this on my server tomorrow. I really hope it works as intended. I've been wanting something like this for some time now. Thanks for making it.