Inactive [ECON] BetterShop 2.0 - A 'Better' Server-wide Shop - Spout compatible :) [1240]

Discussion in 'Inactive/Unsupported Plugins' started by jascotty2, Jul 6, 2011.

  1. Offline

    jascotty2

    BetterShop - The "better" global command-based shop
    Version: 2.0
    Download: (static jar) BetterShop.jar
    download page with older versions


    BetterShop is now primarily on BukkitDev

    (you can still come this forum for some help, though)


    this plugin (original concept) was first made by jjfs85 here
    however, he stopped development (that i know of) once i started

    Features:
    plugin support
    for economy, currently dependent on one of:
    Permissions support

    Help support

    configurable
    Fully configurable colors and message text in config.yml file
    shoplist can have text alignment (read config for more info): <item> <l(eft-aligned)> <buy and sell info>
    - uses minecraft font character spacing, so is very close to perfectly aligned in chat
    shoplist can optionally not show listing tail (or head, but recommended to leave <page> of <pages>)
    Items can be colored in the new itemsdb.yml file
    also in itemsdb.yml: kits!
    - define your own kits that the shop can sell
    - three examples provided, edit and add to your liking
    Configurable Options:
    -max pagesize when printing shoplist
    -whether to broadcast all transactions publicly
    -name of the pricelist file/table
    -customsort: a custom sorting order, so you can have items at the top of the shop list
    -allowbuyillegal: if someone without BetterShop.admin.illegal can buy illegal items
    -whether maxstack should be honored
    -if used tools can be bought back
    -default color for items
    - and more!

    shop flexibility
    shopcheck will run a name comparison check, and return all matching items
    Item sub-type support for dye colors, cloth colors, etc: magentacloth = 35:2 = cloth:magenta
    "all" is a valid amount when buying or selling: "/sell cobblestone all" or "/sell all cobblestone"
    damaged tools can be resold for an adjusted value of sellprice*(1-(damage/maxdamage))
    buystack can be given multiple items, or number of stacks: "/buystack wool 5" or "/buystack wool blackdye reddye"
    shopsellall can be given multiple items (/sell all cobble gravel flint dirt)
    plural-insensitive items: if not found, will check if plural & remove "s"
    not just items can be bought anymore: can now buy LivingEntities, like dogs (wolf)
    signs can be used for buying & selling
    - first line: [BetterShop] (not case-sensitive)
    - second line: action: buy [amt], buyall, buystack, sell [amt], sellall, sellstack
    - third line: item (name, id, etc)
    - fourth line: unused (was going to make price, but decided on pricecheck instead)
    - to activate, someone with BetterShop.admin.makesign must left-click the sign.. the first line will change color when active
    - left-click for price check (or activate), right-click to buy/sell
    - if a unauthorized player destroys a block a sign is on, is canceled
    item categories
    - can search for items by category (in shoplist)
    players using Spout (if installed & enabled) can use a GUI Menu for buying & selling
    - default button is 'b'
    - displays items in shop in top half
    - item detail below with # in stock, buy/sell price, & buttons to buy & sell
    - amount to buy/sell can be set in text box or with up/down buttons

    administration
    Every item and subtype can be priced differently
    Disable buying or selling of an item by giving it a price of -1 (0 makes it free)
    command aliases to stop carpal tunnel
    many commands have sub-aliases.. eg. shoplist kits will run shoplistkits
    MySQL pricelist support
    MySQL pricelist can be cached for a given timespan (decreases table selects) (flatfile is cached until manually updated)
    Transaction records (MySQL or flatfile as .csv)
    Downloads mysql-bin.jar dependency automatically
    buy/sell cap in program set to 999,999,999 (not that you'd be using that much, but the cap is to prevent other errors)
    if encounters errors while editing a player's account, will attempt to reload iConomy (i've had issuses with it before)(may remove in a future update.. seems to work better now)
    can backup the current pricelist: /shop backup
    can restore from backup: /shop restore <file>
    can import new prices in a batch from a csv (or old yml format) : /shop import <file>
    on start, can check the download page to see if there is an update available
    shop can be given a finite stock from which to buy & sell
    /shop ver[sion] to check the current version & see if there's an update
    /shop update to manually download & install the most recent version
    MinecraftIM support: forward errors or all messages
    checks for missing & unused configuration nodes
    strings have default values if missing
    auto error reporting added (can be disabled)
    custom message you can send with the error report
    help main page integration can be disabled
    global shop can be disabled & only allow signs to be used
    can use permissions to define discounts for certain users
    - uses nodes in "BetterShop.discount.xxxx"​
    - nodes defined in config under discountGroups​
    - ex: discountGroups:​
    VIP: 10 # gives 10% discount to players with BetterShop.discount.VIP​

    Version 2.0 - 9/24/11
    near-complete rewrite
    - more modular, should be easier to add new features
    added region-based shop support
    - just main shop for now
    - config modes:
    - - shop.commandShop: global
    - - - regions are areas where command-based shop access is disabled
    - - shop.commandShop: regions
    - - - globally disabled, except for within regions
    - - shop.commandShop: both
    - - - allows command-based shop access from anywhere
    - - shop.commandShop: none
    - - - cannot use commands (or spout) to use the shop
    - regions are defined by first selecting a region in worldguard
    - - after regions have been defined, can put the WorldEdit.jar in the lib folder
    now checks from 2 mirrors (still on git)
    - not really needed, but the code behind it looks cleaner
    finally adopted some license to support open development.
    - now the source is licenced under the GNU General Public License
    - http://www.gnu.org/licenses/gpl.txt
    added pages menu option (default) so spout scrolling goes by page, not column
    added a fix for a spout button error
    fixed a spout error where may show amount stock can sell, not buy
    added category switching (spout)
    - can use 'cycle' for a button to cycle through the categories (shows more per-page)
    - or use 'tabbed' for buttons at the top that can be selected
    chest shop interface added :D
    - to define a chest, point at the chest & type "/shop chest define"
    - automatically detects double-chests
    - multiple users can use the same chest shop
    - - each user gets a customized chest screen
    - - items in the display show either max stack, or max of that item the user can afford
    - setting for "chestSellBar", which allows selling to a chest which is full (without buying anything)
    tnt explosion cancelation settings for sign/chest shop added
    - should be more efficient than prior method
    commandlog format moved in config & added more formatting options
    updated Register methods (fixes iCo6 errors)
    added a rudimentary spell check routine
    - if an item name doesn't match at first, and there is 1 match for closeness, returns that item
    sign shop handling rewrote
    - should be more efficient
    - can now define custom prices for transactions
    - - 4th line contains cost, doen't have to just be a number
    - - - "1.23", "$1.23", "1.23 Dollars", "$1.23 total" are all acceptable
    - - for a given amount, define the total cost
    - - if using "sellall" or "buyall", define unit cost
    categories have been implemented in buy & sell
    - can sell all items in a category, or buy an amount of each item in a category
    - ex. "/sellall food"
    sign & chest shops are protected from endermenv (if shop.(sign & chest)DestroyProtection = true)
    sql routines updated for foreign locales

    Full changelog can be found in the readme on git

    Support development!
    if you really like this & don't want to see it go by the wayside, [​IMG]
    (i make no money maintaining plugins)
    if you can't donate, at least a "like" would help ;)
     
  2. Offline

    Southpaw018

  3. Offline

    e_zach

    YAY! new thread is new and nice! :p
    keep up the great work.
     
  4. Offline

    Haeleus

    Just one thing, where can I find a good pricelist for this mod?
     
  5. Offline

    jascotty2

    there are two examples included
    but i wouldn't mind if other server owners would contribute, too ;)
     
  6. Offline

    Haeleus

    Those 2 are incomplete and frankly a little ridiculous with prices for the more important materials.
     
  7. Offline

    jascotty2

    well. they're examples ;)
    edit to something of your liking, and upload here if you'd like to share
     
  8. Offline

    XterierK

    I would LOVE to see a trade command. Other than that this plugin is great and thanks for continued development!
     
  9. Offline

    Lolmewn

    Can I sell through signs?
     
  10. Offline

    jascotty2

    confused how you could trade with a shop.. can you elaborate what the trade portion would do?

    Code:
    __________________
    |  [BetterShop]  |
    |   sell #/all   |
    |item/inv/inhand |
    |________________|
           |  |
           |  |
    
     
  11. Offline

    Lolmewn

    And buy is instead of sell but then the same right?
     
  12. Offline

    e_zach

    i think they mean a player to player sort of trade. so say PlayerA could sell a stack of cobble straight to PlayerB at a price they set, which could be more or less than the global market price.

    on another note, is dynamic pricing on the books/ in development? that's the only thing this plugin is really missing atm (in my opinion anyway :))
     
  13. Offline

    SHiLLySiT

    I would also love to see dynamic pricing!
     
  14. Offline

    serenewaffles

    Did the maxstack feature of the itemsdb get dropped? If so is there any chance to bring it back? We really liked being able to buy a stack of bread from the shop.
     
  15. Offline

    jascotty2

    that had not been dropped (still works) but that item information now is stored in the plugin (so it no longer depends on that file)
    if you want to buy stacks of items, try using shop.usemaxstack: false
    (in the config)
     
  16. Offline

    serenewaffles

    I have that set to true. But where do I specify what the maximum stack is?
    this is what I have for bread:
    Code:
        item297:
            name: Bread
            aliases:
            maxstack: 4
    But /buystack bread still only buys 1 bread.

    This used to buy 4 bread in a stack with 1.6.5.6
     
  17. Offline

    jascotty2

    Version 1.6.6.5
    fixed unknown bukkit item naming in itemsdb (more update-proof)
    - fixed custom maxstack having been removed
    better handling of iConomy nullpointer errors
    fix buying ghasts (also not of "creature")
    misc. null fixes

    @serenewaffles
    1. mistakenly told you true; should be false (for ignoring stack & getting 64)
    2. looked over the code & realized i'd removed the maxstack option
    so: i put it back, so the settings you have now should work as you want them to​
     
  18. Offline

    Plague

    title is missing recommended CB version tested against

    (and also the formatting is a mess if you don't mind me saying)
     
  19. Offline

    skeletonofchaos

    I recommend adding spoilers to hide all of the long sections :)
     
  20. Offline

    ostepop2211

    Help:
    When I sell something the money does not get added to one of my account, buy buying works fine....
    Some other plugin was overwriting the Bettershop command... Nevermind :(
     
  21. thx i did think BetterShop is lost

    work for 1.7?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  22. Offline

    jascotty2

    953 is for 1.7 [brickblock]:rolleyes:[brickblock]
     
  23. Offline

    iFearz

    I'm not gonna use this plugin anymore since my server is going anarchy now. Though I always loved this plugin. =D

    <Edit by Moderator: Redacted mediafire url>
    It's a copy of I think yours, jascotty2, but with prices I thought made more sense + a mob spawner for $500,-
    So I basically edited yours... But others can use it if they want ;P

    Hope you keep developing your awesome plugin!
     
    Last edited by a moderator: Nov 27, 2016
  24. Offline

    blackbinary

    @ jascotty2 i cant conenect to my mysql DB, but i am sure i do nothing wrong in the configfile.. i use the same config for many other plugins:
    Code:
    12:53:24 [INFO] [BetterShop] Newer BetterShop version found on git (Sat Jul 09 00:18:45 CEST 2011)
    12:53:25 [SEVERE] [BetterShop] Error while creating table
    java.sql.SQLException: Error while creating table
        at com.jascotty2.MySQL.MySQLPriceList.createPricelistTable(MySQLPriceList.java:289)
        at com.jascotty2.MySQL.MySQLPriceList.<init>(MySQLPriceList.java:33)
        at com.jascotty2.Shop.PriceList.loadMySQL(PriceList.java:148)
        at com.nhksos.jjfs85.BetterShop.BSPriceList.load(BSPriceList.java:32)
        at com.nhksos.jjfs85.BetterShop.BetterShop.onEnable(BetterShop.java:278)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:878)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:272)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:162)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:146)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:284)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:271)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-env.BetterShop(ID    INTEGER  NOT NULL,SUB   TINYINT  NOT NULL,NAME  VARCHAR(25' at line 1
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
        at com.mysql.jdbc.Util.getInstance(Util.java:382)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
        at com.jascotty2.MySQL.MySQL.RunUpdate(MySQL.java:275)
        at com.jascotty2.MySQL.MySQLPriceList.createPricelistTable(MySQLPriceList.java:281)
        ... 14 more
    12:53:25 [SEVERE] [BetterShop] Failed to connect to MySQL database mc_test-env
    12:53:25 [SEVERE] [BetterShop] cannot load pricelist: null
    12:53:25 [SEVERE] [BetterShop] null
    java.lang.NullPointerException
        at com.jascotty2.Shop.PriceList.close(PriceList.java:239)
        at com.nhksos.jjfs85.BetterShop.BetterShop.onDisable(BetterShop.java:332)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:128)
        at com.nhksos.jjfs85.BetterShop.BetterShop.onEnable(BetterShop.java:281)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:878)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:272)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:162)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:146)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:284)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:271)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
     
  25. Offline

    jascotty2

    never thought of any good reason to put a hyphen into a database / table name... makes it more difficult to work with if you need to edit from the command line..

    so.. i found a fix for you, anyway

    Version 1.6.6.6
    weather "easter egg" removed (was free to "buy" weather events)
    updated MySQL parameters to allow some special characters in names
    temp. fix for inventory data error until bukkit merges my fix
    other misc. null fixes
     
  26. Offline

    GameOverRules

    Hey can I please get some help, How do you set it up so people can buy a "example" diamond pick axe and they can sell it right back or w.e for the set price or if they use it and its almost gone or somewhere in between it is a different amount. I saw it under config but I do not get it. can someone give me a example please. Use a pick axe being sold for 125, and regular by back (unused) is 100.
     
  27. Offline

    leMi

    Hi,

    I am happy to see this plugin up to date again. I updated my price list that I would like to share with everyone.
    Here is the .csv : http://dl.dropbox.com/u/5491181/BetterShop.csv

    I also made a corresponding .ods (Open Document Spreadsheet) that calculates a lot of the values by itself. If an item needed to be furnaced, the cost of the coal required is calculated. Though, the time required for the furnacing is not calculated. All the fields in green are calculated automatically. The fields in yellow shouldn't be changed. The fields in white can be modified. The default value for selling is 0.5*buyprice.
    Here is the .ods : http://dl.dropbox.com/u/5491181/BetterShop.ods

    To save the .ods document as a .csv, click File, then Save as. Next to Save as type, select Text CSV and click Save. A window should appear asking the Field delimiter and the Text delimiter. For the Field delimiter, select the comma (,). For the Text delimiter, make sure nothing is entered (click on the field, and you should be able to delete the default (")).

    Hope this helps a lot of server admins out there.
     
  28. Offline

    Techykid3

    Does this support Permissions Bukkit?
     
  29. Offline

    SHiLLySiT

    If it does, it isn't working. I have neither node listed in group permissions yet I can still use shop commands. =/
     
  30. Offline

    Schlumpf

    Hello,
    when I run the Plugin using Mysql with a lot of Items in it I get this error:
    Code:
    2011-07-23 13:56:44 [SEVERE] [BetterShop] failed to run COMMIT on database
    java.sql.SQLException: failed to run COMMIT on database
        at com.jascotty2.MySQL.MySQLPriceList.commit(MySQLPriceList.java:82)
        at com.jascotty2.Shop.PriceList.close(PriceList.java:239)
        at com.nhksos.jjfs85.BetterShop.BetterShop.onDisable(BetterShop.java:332)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:128)
        at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:899)
        at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:288)
        at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:281)
        at org.bukkit.plugin.SimplePluginManager.clearPlugins(SimplePluginManager.java:309)
        at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:351)
        at com.earth2me.essentials.commands.Commandreloadall.run(Commandreloadall.java:19)
        at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsCommand.java:60)
        at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsCommand.java:55)
        at com.earth2me.essentials.Essentials.onCommandEssentials(Essentials.java:454)
        at com.earth2me.essentials.Essentials.onCommand(Essentials.java:347)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:320)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:713)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 83,704,607 milliseconds ago.  The last packet sent successfully to the server was 83,704,619 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
        at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3348)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1967)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
        at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1662)
        at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1581)
        at com.jascotty2.MySQL.MySQL.commit(MySQL.java:238)
        at com.jascotty2.MySQL.MySQLPriceList.commit(MySQLPriceList.java:80)
        ... 26 more
    Caused by: java.net.SocketException: Broken pipe
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
        at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
        at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
        at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3329)
        ... 33 more
    2011-07-23 13:56:44 [INFO] BetterShop now unloaded
    Edit:
    Hmm, I rebooted my Linux Server and now it work:
    Code:
    2011-07-24 07:29:01 [INFO] Loading BetterShop version 1.6.6.5 ...
    2011-07-24 07:29:01 [INFO] [BetterShop] Notice: Unused Configuration Nodes:
    strings.commandlog, strings.listalias
    2011-07-24 07:29:03 [INFO] [BetterShop] Newer BetterShop version found on git (Tue Jul 19 22:35:07 GMT 2011)
    2011-07-24 07:29:03 [INFO] [BetterShop] MySQL database **ip**:Minecraft/BetterShop loaded.
    2011-07-24 07:29:03 [INFO] [BetterShop] Attached to iConomy.
    2011-07-24 07:29:03 [INFO] [BetterShop] Attached to Permissions.
    2011-07-24 07:29:03 [INFO] BetterShop version 1.6.6.5 is enabled!
     

Share This Page