Advanced Shop
AdvancedShop - A dynamically priced server shop which is fairly intuitive and versatile; supporting both experience and money
~ Plugin requested by woebegone1 on http://forums.bukkit.org/
[Overview]
- A simple to use server shop where prices change when you buy/sell
- Buy/Sell signs
- Support for ListBuilder/WhatIsIt for modded item names (Forge)
- Supports experience or money
- Can have different formulas for buy and sell
- You can have the prices based on a configurable time period
- Allows multiple names per shop item
- Add or remove items from the shop
- Shops can have "Stock" and only sell if they are in stock.
- Can log transactions
[Commands|Permissions]
Command | Description | Permission |
---|---|---|
/advsell <item/hand> *<amount> | Sells a given amount of an item | advshop.sell |
/sellall | Sell everything in your inventory | advshop.sellall |
/advbuy <item> <amount> | Buys a given amount of an item | advshop.buy |
/value <item/hand> | Gives info on price/stock of item | advshop.value |
/hand | Tells you what item you are holding | advshop.hand |
/advshop help | Lists all the commands for the plugin | None |
/advshop reload | Reloads the plugin | advshop.reload |
See here for setting up command aliases (e.g. using /sell)
[Installation]
- Download AdvShop.jar as well as the dependencies below into your plugins directory
- Restart your server or load the plugins using a plugin manager
- Add the permissions that you see fit (listed above) to players
- See the configuration tutorial below for further information
For forge modded servers:
Use ListBuilder to generate a list of items for AdvShop.
- Simply copy the generated names.yml into the AdvShop folder and it will convert it on startup
- Remember to change the "idlist" setting the the config.yml
[Dependencies]
Click here for Vault which provides economy integration.
An economy plugin of some sort is also required
[Configuration Tutorial]
Most configuration can be done through the config.yml
[Buy/Sell Formula]
This dynamic shop plugin allows you to specify your own formula for buying and selling. The default formula does the following;
- Items are cheaper if a lot of that item has been sold, but not much has been bought
- Items are more expensive if not much of it has been sold compared to other items.
- The sell price is always half of the buy price
If you have "require-stock" set to true in the config.yml, here is an example formula:
constant/(sold-bought)
where constant is some number of your choice e.g. 1000
Placeholders:
- bought
- sold
- volume
- totalsold
- totalbought
- totalvolume
basic javascript will also work in the formula
The default-sold and default-bought values are the stock of an item after it has been sold/bought for the first time.
It is a good idea to have the buy formula return a larger value than the sell.
[Using EXP]
Simply change use-exp-instead to true in the config.yml
[Adding/Removing items]
If you want to have a custom item list, you will need to copy idlist.yml and modify it
Once you have done that, remember to change the idlist in the config to specify the new file.
[Logging transactions]
Transactions are automatically logged to history.yml.
TO DISABLE - set keep-history-days to 0
TO KEEP FOREVER - set keep-history-days to -1
[Disable auto item matching]
Set item-similarity-match to 0 (in config.yml)
[GUI shop]
There are many plugins out there which allow you to create your own GUI's:
- Chest Commands GUI
- Or do a search
With ChestCommandsGUI you can execute commands (e.g. /advsell) when a block is clicked.
[Signs]
The latest version of AdvShop allows for the creation of Buy and Sell signs, here is an example:
- The first line of the sign ([ADVBUY] or [ADVSELL]) is completely configurable through the language setting
- The last line shows the current stock levels for the item
- Shift+R-Click to trade a stack at a time
Portuguese Video by AbsintoJ
[Other Projects]
- SignRanks
- CompassModes
- WorldeditRegions
- VoxelSniperRegions
- InSigns+
- IndividualMessages
- IndividualHolograms
[TODO for v0.2.0]
Please tell me if you would like any additional features added
- Threaded buy and sell commands
- buy/sell sign protection
- Add option to set static prices for certain items
- Item min/max buy/sell values
- Search command
- Command to repair items based on shop value
- Command to smelt item based on shop values
- Enchantment books
- Fix exception with buying something with no stock
- Finish adding min/max prices for items
- List cheapest/most expensive items
- Cooldowns for buying certain items
- MySQL
- actions?
- player-player trading (rather than just player-server trading)
- buy entities
Ok so this isn't working for tekkit. I added in the new items as instructed, they are in fact there, but since they neither have a buy/sold/price value and theres WAYY too many items to type them all into prices or something. I used the following:
sell: (50/(sold-bought)) buy: 2*(50/(sold-bought))
Yet no matter what, when I punch the sign it sells the item but for 0$ regardless of what price I put on the sign and tells me in console invalid sell formula or buy whichever way.
Hey, whenever I edit the english.yml file as in changing its colors, and then reload the plugin, it won't save the changes I made. Can you fix this?
@Empire92
Is there any way you can seperate the /advsell command and a sell via sign as seperate nodes so that people dont exploit advsell on items you don't want them to sell.
QUESTION - PLEASE HELP:
There is one thing that I just need to know. Also, before you read this, take in mind that I am not stupid. How do you change the worth of items? I don't want an apple to sell for $0.05 or whatever! May you please help me? Thanks for reading!
excuse me, the owner can set a blaclist of items? Thanks
You should add /AdvSellTo [user] [amount] [price] if you have 100 blocks in inv then you put 100 for amont and select price. Popup on their screen user is selling you blank amount of blank for blank. ./acceptsale 10 (sale id) or declinesale 10. Also do /AdvOrder [item] [amount] [price] . It announces user orded blank amount of blank for blank. order id is 10, do /order deliver to fill order. Person who filled order auto gets paid then other one gets items if offliine when logs on says you ahve these unclaimed oreders. Do /advorder claim [id]. people can to /advorder list to display unfilled orders. they can /advorder cancel. Finally a great addition would be if you have 100 stonebrick and you do /advsell 101 stonebrick, instead of saying you can only sell 100 it should jsut sell 100 as thats the most you have. same with /buying 100 stonebrick. If you have 64 slot then it should only buy 64. Those are just some suggestions.
@DivinityCraft Sorry man. I must have uploaded the wrong file, since it shouldn't have those debug messages. The crashing of the client can be attributed to that (I think). I'll get my old potato out to see if it's better.
So yeah... I kinda screwed up, but I'll make sure all those issues are fixed in the next version.
@Empire92
Unfortunately, while the sellall log issue is indeed fixed, the lag/crash problem persists and the player selling it now gets spammed with messages, see the screenshots here: http://imgur.com/a/bvWUh
Also, when attempting to sell damaged durability items using any sell command, the player crashes and no sale is made. I do not think it should be possible to sell damaged stuff but the crash issue must be sold and perhaps have a message added that says you can't sell damaged gear.
Thanks for the info.
Should be working well enough in the next version.
- I'll do some more work on it in the future so that it's ultra-fast.
Signs should be documented now.
I have a bug to report. Sellall can cause major lag and disconnect the player and possibly even crash the server.
I've checked the history file and I believe the issue with sellall at least is that it seems to create huge amounts of duplicate transactions. For example, selling twenty stacks of something creates 20 transaction messages, one for each stack, which are then duplicated 64 times each creating a total of 1280 lines in the history file. Due to the immense lag caused I presume this weirdness is due to the way the sale is handled in the code, not due to a problem in the way the history file works. The issue does not appear with other sell commands from what I can tell.
Hyperconomy does not have any lag issue when selling large quantities so it must be possible to solve this. I suggest as a quick fix until you find a better solution you put in some small delay in the transaction code to slow it down enough to avoid lag. The players will be fine with transactions taking a bit longer to finish if that means they can avoid the crashes and lag and get /sellall (I had to disable it due to the constant player and server crashes).
I'll be happy to send you our history file if it would be of any help.
How do the new signs work by the way? I can't seem to find any info on it.
@Empire92
It would be easier to you, because in ChestShop there is almost all done with code and one thing that you need is to create plugin which changes prices automatically when buying/selling.
P.S ChestShop plugin creator said that anyone can create that plugin with his API (http://dev.bukkit.org/bukkit-plugins/chestshop/pages/chest-shops-api/)
Thanks for the update!, but I don't think your pricing formula works at all now :\ this is a new install to test if it works and after a few buys/sells the formula sets the item price as 0. Also instead of the stock levels may I suggest sign format as follows
As the stock levels don't matter as much as the amount of items (GL Clicking the sign a billion times for a few stacks of stone or cobble), also the signs only activate when you place a block on the sign (Maybe your using block place event instead of Interact event?).
I have my own sign addon for this plugin that works nicely, however knowing that both formulas don't work has stopped me from using this plugin for the time being.
Thanks for your consideration!
@Sprunkas Oh, I haven't documented that yet. The perms are: - advshop.create.buy - advshop.create.sell
Create a sign by putting [advbuy] or [advsell] on the first line followed by the item you want to sell. I haven't fully implemented in the autoupdating, so it only updates when you buy something from it, or left click the sign.
As for a ChestShop addon, how would that work?
I suggest you adding this plugin as ChestShop addon P.S How to create signs?
Hello there!
This truly looks like the plugin I'vve always searched for, but the feature I need is in that long todo list :P (Signs)
I'm not great at programming, but I know my way around java, If you would like some help in making that todo list shorter you can send me a msg!
or if you could go open source that would also be awesome :)
I'll be monitoring this plugin
I've made good progress. Sorry for this wall of text, but this is the most promising market plugin I've ever seen in my years as admin and I'm gonna do whatever I can to help it succeed. By using this formula as a starting point you can have an economy that works in a simple yet sensible and effective way with balanced prices and stocks:
pickanumber/(sold-bought)
This formula makes the price of an item be based on its stock, the lower the stock the higher the price, thus making it more attractive to sell items low in stock which ensures they do not run out. The pick a number is what price your items should have when there is only 1 in stock, this affects what price your items will have at all stock levels.
I highly recommend you also change the default stock to something like this:
default: sold: 100 bought: 0
This gives all items a starting stock and ensure players will not make extreme amounts of money when the plugin is new.
Empire92, for the sake of the success of the plugin, I suggest drawing inspiration from these settings to stop the issues of the default config with its hyperinflation and emptying stocks.
I would also like to report a minor problem, when an item has 0 stock and you sell the first item to it you get an error message and while the item is added to the shop and removed from your inventory, you get no money for the sale. The error message is is "An internal error occurred while attempting to perform this command"
I also have a small feature request. When you type a buy or sell item command but left out the item amount it would be practical if the sale/purchase went through anyway with 1 as default, Hyperconomy uses this system and it's very handy. For example, a crafting table is something you almost always want just 1 of, so you should be able to type /buy craftingtable and you get 1.
Finally, for those like me who prefer to not have adv in front of the commands I've made these aliases for commands.yml and they seem to work well. buy: - advbuy $1 $2 sell: - advsell $1 $2
@McyD1
The default pricing formula does not work, my medium-sized server (30 online during peak hours) has been using it since may 1 and while everything seemed fine during the first few weeks with stocks filling up and prices balancing out, things took a turn for the worse later on. The default pricing formula seems to create steadily-worsening hyperinflation once a certain total number of items have been sold.
The huge amounts of money being generated has made money itself pretty much worthless and gives people incentive to buy useful items for all their money while selling crap to get money for this. Therefore we now have a situation where the stocks of all useful items are always empty while useless crap like dirt is well-stocked and people have millions upon millions of money.
I'm trying to figure out a different formula but I'm no mathematics expert, just a business/economics guy, so it's not easy. I have figured out several ways it could be solved but I simply haven't figured out the math to make them reality yet.
How do you use the name for a two or more word item? If I do /advbuy or even /value Steel ingot (which I added) I get did you mean steel?, If I try /value steel I get, did you mean steak?, If I try Steel_Ingot, I get did you mean steel? I take it multi-word items are not supported.
Second Question, at what point to prices start to drop? I sold all my cobble and made 410k... without noticing any diminishing returns. I would assume as the market is now flooded with cobble, it would have dropped as I continued to sell it. I understand time is a factor as well, but I would think significant stock should also decease the buy/sell price.
Any luck with enchantments? If you can't find a solution then perhaps you should use the Hyperconomy method of trading the enchantment itself rather than the enchanted book.
@DivinityCraft
You can add /buy and /sell as an alias for /advbuy and /advsell in the commands.yml file (previously it was in Bukkit.yml)
For more information take a look at this page: http://wiki.bukkit.org/Commands.yml#Alias_Examples