Inactive [ECON] StockCraft 0.3 - When minecraft players care about economy crisis [818]

Discussion in 'Inactive/Unsupported Plugins' started by henning77, Apr 18, 2011.

  1. Offline

    henning77

    StockCraft - Trade real stocks in Minecraft
    Version: v0.3

    Features:
    • Buy and sell real stocks in Minecraft (courses from finance.yahoo.com)
    • Compare profit with other players
    Downloads:
    Requirements:
    • MYSQL Database
    • iConomy
    • Permissions
    How to install:
    • Install MYSQL Database if not available
    • Install the missing plugins (iConomy,Permissions)
    • Download the rar archieve
    • Extract it to plugins
    • Modify StockCraft.cfg -> /plugins/StockCraft/StockCraft.cfg for connection to the Database
    • Add Stocks with /addid or load example list with /addidlist examplelist
    Config File:
    Edit your config file to access your database and to activate some functions!
    • url=//localhost:3306/minecraft -> change "minecraft" to the name of your database
    • user=root -> change "root" to your database user
    • password= -> Add password of your database
    • detailedpermissions=false -> change to true if you want to activate more permissions, if false you don't need to change permissions if admin rights are "*"
    • shorten=false -> change to true if you want to activate shorting (Check Wiki!)
    • iConomy5=true -> change to false if you want to use an old iConomy Version
    • fee=0 -> If you want a trading fee, you can set one here. (percentage of money paid for stocks!)
    • minimumfee=0 -> Here you can set a minimum fee! (You can leave fee=0 and set a static fee!)
    Commands:
    • /stockhelp -> Help
    • /ids [page]-> Shows the stocks that are available
      • /ids symbol [page]-> Shows the symbols of the stocks that are available
      • /ids s [page]-> Shows the symbols of the stocks that are available
    • /course [id] -> Shows the course of the stock
    • /stocks -> Shows your stocks if you have some
    • /stockbuy [id] [amount] -> to buy stocks
    • /stocksell [id] [amount] -> to sell stocks
    • /stocktop -> Top 10 with the highest profit
    • /addid [id] [symbol] -> adds a new stock to the id list (you can find the symbol on finance.yahoo.com!)
    • /addidlist [name] -> adds new stocks from a file (examplelist: /addidlist examplelist) in /plugins/StockCraft/
    • /removeid [id] -> removes stock from the id list
    Permissions:
    • stockcraft.addid -> add this to permissions plugin to allow admins or mods to add stocks
    • stockcraft.removeid -> to allow admins or mods to remove stocks
    • stockcraft.commands.* (only needed if you set detailedpermissions = true in stockcraft.cfg)
      • stockcraft.commands.course
      • stockcraft.commands.stockbuy
      • stockcraft.commands.stocksell
      • stockcraft.commands.stocktop
      • stockcraft.commands.stocks
      • stockcraft.commands.ids
      • stockcraft.commands.stockhelp
    Examples for stocks (with symbols):
    BMW BMW.DE
    DeutscheBank DBK.DE
    Lufthansa LHA.DE
    Commerzbank CBK.DE
    Telekom DTE.DE
    Infineon IFX.DE
    SAP SAP.DE
    Siemens SIE.DE
    SONY SON1.F
    ACER ACX.MC
    Oil CLK11.NYM
    Gold GCJ11.CMX
    Gas NGK11.NYM

    Example:
    /addid BMW BMW.DE

    Get new stocks:
    If you want to add new stocks go to finance.yahoo.com and check the id

    [​IMG]

    after that add the id in Minecraft:
    /addid BMW BMW.DE


    Changelog:

    Version 0.3
    • Added support for iConomy5 (you can still use old versions if you set iConomy5=false!)
    • Added pages to /ids -> /ids [page]
    • Added symbol optiion to /ids -> /ids symbol [page] or /ids s [page]
    • Added option to set trading fee
    • Fixed some bugs
    Version 0.2
    • Added the option shorten (you can sell stocks which you don't have and buy them later! -> (Check Wiki!) To activate set shorten=true in StockCraft.cfg
    • Added new permissions -> To activate set detailedpermissions=true in StockCraft.cfg
    • Added some error messages
    • You can load stocklists now! Look at /plugins/StockCraft/examplelist.txt! Load the list with /addidlist examplelist or load your own list!
    • Getting courses (/ids and /stocks) is now speeded up!
    Version 0.1
    • First Release
    Donate:
    If you want to support me
    Donate
     
  2. Offline

    iPhysX

    Hopefully an update soon :p I'll get it when SQL is proper!
     
  3. Offline

    henning77

    I hope I fixed it! (Uploaded a new 0.3) Can you tell me if its ok now?
    Thanks for your help...! (Tell me if you find more bugs ;-) )
     
  4. Thanks for the update.

    Small issue with paging now, it tells me I have 4 pages, yet page 4 is empty, it all fits on the first 3 pages.

    ===
    edit:

    Also, try and catch errors like this: http://pastie.org/1925675

    ===
    edit2:

    Also, I'd like some consistency in rounding numbers, see the issue: http://i.imgur.com/w6vdU.png :p

    And this one deserves a new post:

    Major issue with this plugin. Stocks are updated about 10 minutes after they are updated on the online trackers. So any clever broker can check real stock value, then trade in-game with insider information.

    Sadly makes it unusable in our economy, not sure how this can be fixed either, you'd need much faster update speed.

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

    henning77

    Hmmm... ok this is really bad... from my side its always a live request, can't do anything here. But I have to check that... maybe it was just on that day!
     
  6. No idea for a solution yet? :S
     
  7. Offline

    henning77

    For me it works fine... I have the live courses...which stocks do you have? And do you have the problem with all stocks?
     
  8. I am just relaying what my players told me.

    How does it work then, on every stock command, it retrieves the stock values from Yahoo first? There's no caching, no delay ever?
     
  9. Offline

    henning77

    No caching, no delay from my side... on every command it gets live courses... I think that there is no difference to the courses of yahoo!
     
  10. Ok I talked to one of our high ranked Traders who actually used it. The issue is not in your plugin, but in the API you use. Yahoo itself is 13 mins behind on real stock prices apparantly! So they could just look at real-time stock info, then use that to get rich easily ;)

    I am being told that the problem could be fixed by using Google Finance instead, they probably have an API?
     
  11. Offline

    henning77

    ah ok... then I have to search for a quicker one... but if you add a fee it isn't that easy to make money ;-)
     
  12. Try google finances :p

    A fee would help, but it makes making legit profit more difficult, and I already need a profit margin for stock brokers to work for others ;)
     
  13. Offline

    henning77

    The problem is, its only live for us stocks... check: http://www.google.com/help/stock_disclaimer.html#realtime
     
  14. Most famous brands are USA, it would be good enough for me anyways, it's better than the alternative = no Stocks at all :p
     
  15. Any ideas yet, henning? Love the feature, but need it live :<
     
  16. Offline

    henning77

    yes some "ideas" but no time to realize them ;-) If I find any free time I will try to find a way! Maybe I add an option where you can decide where to get the courses...
     
  17. Offline

    gmaguitar01

    It doesn't work. I made my database, added it to the config file, but the /stockhelp and every other command except /addid doesn't work. when i type for ex: /addid BMW BMW.DE and hit enter I get nothing, no notification nor error. please help, im dying to have stocks
     
  18. Offline

    henning77

    Do you get an error message? Can you post it here?
     
  19. Offline

    zorro300

    when i try to use it -> it says that minecraft.idtable doesnt exist
    do i have to manually add the table because i dont know how to do that
    with other plugins the tables were auto-created
    what to do
     
  20. Offline

    henning77

    Should create automaticly... maybe your database has a different name? Can you post your complete error log?
     
  21. Offline

    zorro300

    well when i start up my server i get no error , but when i try to add the examplelist or something else
    i get this error


    16:23:40 [INFO] addidlist examplelist
    16:23:40 [SEVERE] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Tab
    le 'minecraft.idtable' doesn't exist
    16:23:40 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance
    0(Native Method)
    16:23:40 [SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance
    (Unknown Source)
    16:23:40 [SEVERE] at sun.reflect.DelegatingConstructorAccessorImpl.newInst
    ance(Unknown Source)
    16:23:40 [SEVERE] at java.lang.reflect.Constructor.newInstance(Unknown Sou
    rce)
    16:23:40 [SEVERE] at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
    16:23:40 [SEVERE] at com.mysql.jdbc.Util.getInstance(Util.java:382)
    16:23:40 [SEVERE] at com.mysql.jdbc.SQLError.createSQLException(SQLError.j
    ava:1052)
    16:23:40 [SEVERE] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:
    3593)
    16:23:40 [SEVERE] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:
    3525)
    16:23:40 [SEVERE] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)

    16:23:40 [SEVERE] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:21
    40)
    16:23:40 [SEVERE] at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.
    java:2620)
    16:23:40 [SEVERE] at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.
    java:2570)
    16:23:40 [SEVERE] at com.mysql.jdbc.StatementImpl.executeQuery(StatementIm
    pl.java:1474)
    16:23:40 [SEVERE] at StockCraft.StockCraftDatabase.idadd(StockCraftDatabas
    e.java:133)
    16:23:40 [SEVERE] at StockCraft.StockCraftCommands.infosystem(StockCraftCo
    mmands.java:302)
    16:23:40 [SEVERE] at StockCraft.StockCraftPlayerListener.onPlayerCommandPr
    eprocess(StockCraftPlayerListener.java:28)
    16:23:40 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader$5.execute(Jav
    aPluginLoader.java:271)
    16:23:40 [SEVERE] at org.bukkit.plugin.RegisteredListener.callEvent(Regist
    eredListener.java:58)
    16:23:40 [SEVERE] at org.bukkit.plugin.SimplePluginManager.callEvent(Simpl
    ePluginManager.java:302)
    16:23:40 [SEVERE] at net.minecraft.server.NetServerHandler.handleCommand(N
    etServerHandler.java:693)
    16:23:40 [SEVERE] at net.minecraft.server.NetServerHandler.chat(NetServerH
    andler.java:666)
    16:23:40 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHand
    ler.java:660)
    16:23:40 [SEVERE] at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:3
    2)
    16:23:40 [SEVERE] at net.minecraft.server.NetworkManager.a(NetworkManager.
    java:196)
    16:23:40 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHand
    ler.java:75)
    16:23:40 [SEVERE] at net.minecraft.server.NetworkListenThread.a(SourceFile
    :100)
    16:23:40 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServe
    r.java:377)
    16:23:40 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftSer
    ver.java:292)
    16:23:40 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(Sour
    ceFile:394)
    16:23:40 [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to StockCraft
    java.lang.NullPointerException
    at StockCraft.StockCraftDatabase.idadd(StockCraftDatabase.java:144)
    at StockCraft.StockCraftCommands.infosystem(StockCraftCommands.java:302)

    at StockCraft.StockCraftPlayerListener.onPlayerCommandPreprocess(StockCr
    aftPlayerListener.java:28)
    at org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.ja
    va:271)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:302)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.
    java:693)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:666)

    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:660)
    at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:377)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:292)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
     
  22. Offline

    henning77

    Sorry, I don't know... I think its a configuration problem, but I can't say for sure!
     
  23. Offline

    SulimirCular

    Could you Update it to latest Craft Bukkit (818) ??
    Sounds AWESOME!!
     
  24. Offline

    henning77

    Should work with 818, on our server it works... I change it in the title!
     
  25. Offline

    TBone

    Every time i try to add an Id this happens:
    Code:
    2011-06-10 09:05:55 [INFO] Creating user Laserzwei
    2011-06-10 09:05:55 [SEVERE] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'minecraft.idtable' doesn't exist
    2011-06-10 09:05:55 [SEVERE]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    2011-06-10 09:05:55 [SEVERE]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    2011-06-10 09:05:55 [SEVERE]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    2011-06-10 09:05:55 [SEVERE]     at java.lang.reflect.Constructor.newInstance(Unknown Source)
    2011-06-10 09:05:55 [SEVERE]     at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
    2011-06-10 09:05:55 [SEVERE]     at com.mysql.jdbc.Util.getInstance(Util.java:382)
    2011-06-10 09:05:55 [SEVERE]     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
    2011-06-10 09:05:55 [SEVERE]     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
    2011-06-10 09:05:55 [SEVERE]     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
    2011-06-10 09:05:55 [SEVERE]     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
    2011-06-10 09:05:55 [SEVERE]     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
    2011-06-10 09:05:55 [SEVERE]     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
    2011-06-10 09:05:55 [SEVERE]     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2570)
    2011-06-10 09:05:55 [SEVERE]     at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1474)
    2011-06-10 09:05:55 [SEVERE]     at StockCraft.StockCraftDatabase.idadd(StockCraftDatabase.java:133)
    2011-06-10 09:05:55 [SEVERE]     at StockCraft.StockCraftCommands.infosystem(StockCraftCommands.java:282)
    2011-06-10 09:05:55 [SEVERE]     at StockCraft.StockCraftPlayerListener.onPlayerCommandPreprocess(StockCraftPlayerListener.java:28)
    2011-06-10 09:05:55 [SEVERE]     at org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.java:271)
    2011-06-10 09:05:55 [SEVERE]     at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    2011-06-10 09:05:55 [SEVERE]     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
    2011-06-10 09:05:55 [SEVERE]     at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:712)
    2011-06-10 09:05:55 [SEVERE]     at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:684)
    2011-06-10 09:05:55 [SEVERE]     at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:677)
    2011-06-10 09:05:55 [SEVERE]     at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    2011-06-10 09:05:55 [SEVERE]     at net.minecraft.server.NetworkManager.b(NetworkManager.java:217)
    2011-06-10 09:05:55 [SEVERE]     at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    2011-06-10 09:05:55 [SEVERE]     at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    2011-06-10 09:05:55 [SEVERE]     at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:401)
    2011-06-10 09:05:55 [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:311)
    2011-06-10 09:05:55 [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    2011-06-10 09:05:55 [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to StockCraft
    java.lang.NullPointerException
        at StockCraft.StockCraftDatabase.idadd(StockCraftDatabase.java:144)
        at StockCraft.StockCraftCommands.infosystem(StockCraftCommands.java:282)
        at StockCraft.StockCraftPlayerListener.onPlayerCommandPreprocess(StockCraftPlayerListener.java:28)
        at org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.java:271)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:712)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:684)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:677)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:217)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:401)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:311)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    it seems that there are no tables in my database, but i don't know how to prevent this problem.Iam Admin with full rights andi have just permissions,icon 5 and stockcraft plugins
    please help!
     
  26. Still hoping for an update :(
     
  27. Offline

    baem

    doesnt work here, or can i only add BMW.DE when its trading time?
     
  28. Offline

    henning77

    Should work... any error message in log? Or you don't have permission?

    sorry... I am to busy right now...
     
  29. Offline

    ibigpapa

    for the changing signs you might check with the author of Time announce i'm sure his function will work pretty well with your text instead of the time.
     
  30. Offline

    Corkid

    Code:
    16:08:52 [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to StockCraft
    java.lang.NullPointerException
            at StockCraft.StockCraftDatabase.idadd(StockCraftDatabase.java:125)
            at StockCraft.StockCraftCommands.infosystem(StockCraftCommands.java:282)
            at StockCraft.StockCraftPlayerListener.onPlayerCommandPreprocess(StockCraftPlayerListener.java:28)
            at org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.java:271)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:706)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:678)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:671)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Whenever I try to do anything with the plugin this happens
     
  31. Offline

    hittingray

    Have you got your MySQL database set up? If so, log into your server via terminal and add a table, or use a GUI like Workbench or phpMyAdmin.
     

Share This Page