[ECON] Command iConomy - Make any plugin an iConomy plugin [1.4.7, 1.5beta]

Discussion in 'Inactive/Unsupported Plugins' started by Kostronor, Jun 1, 2011.

  1. Offline

    Kostronor

    Since @deltahat is in lack of time, i will continue his plugin for him:
    Command iConomy - Charge for each command
    Version v7

    Overview
    Command iConomy is a plugin that allows a server admin to assign a cost to server commands that is deducted from a player's iConomy account whenever a player uses that command. Commands are matched using java regular expressions. If text entered by a player matches a configured rule, Command iConomy will attempt to bill the player. Command iConomy requires Vault!

    Examples include charging for each summoned magic carpet, or adding a fee for different kits.

    Configuration
    To set the price of a command, add a line to prices.yml. Command iConomy matches regular expressions against user input. Regular expressions allow you to charge separately for individual sub-commands or even specific command arguments.

    A typical configuration line looks like this: ^/tp: 10
    A configuration line matching sub-commands might look like this: ^/time (day|night): 20

    Command expressions are matched in order from top to bottom. If a match is found, Command iConomy stops looking for a match and charges the player the configured amount. If the command is configured with a cost of zero, processing will stop but the player will not be charged. Together these features allow open ended commands to be individually charged. Ex:

    ^/warp help$: 0
    ^/warp \S+$: 10

    Really Quick Regular Expression Info
    ^ = Start of command
    $ = End of command
    \S+ = One or more non-whitespace characters

    For best results, please study and learn regular expressions!

    For more info on regular expressions, see: http://www.regular-expressions.info/reference.html

    Command Cooldowns
    You can now configure a number of seconds before charging a player again for a command. To do so, add a space and then the number of seconds to wait after the command's cost. Ex:

    ^/warp \S+$: 10 30

    Permissions
    • CommandIConomy.Free - Grants free access to all commands.
    Internationalization
    Three additional settings can be made in the config.yml file to localize Command iConomy's text. You will have to create config.yml. They are:
    • NoAccountMessage
    • InsuficientFundsMessage
    • AccountDeductedMessage
      • Substitute {cost} for cost
    Download
    http://dev.bukkit.org/server-mods/command-iconomy/

    Changelog (since Kostronor):

    [COLOR=#444444][SIZE=11px][COLOR=#444444][SIZE=11px][COLOR=#444444][SIZE=11px][COLOR=#444444][SIZE=11px][FONT=Bitstream Vera Sans Mono]Version 9[/FONT][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][/COLOR]
    • Reworked against cb1597/1602
    • should work with every never build, if not please instantly contact me and i will fix it!
    • Vault support!
    [COLOR=#444444][SIZE=11px][COLOR=#444444][SIZE=11px][COLOR=#444444][SIZE=11px][COLOR=#444444][SIZE=11px][FONT=Bitstream Vera Sans Mono]Version 8[/FONT][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][/COLOR]
    • Reworked against cb1337
    • should work with every never build, if not please instantly contact me and i will fix it!
    • Register support!
    [FONT=Bitstream Vera Sans Mono]Version 7[/FONT]
    • Reworked against cb818
    • should work with every never build, if not please instantly contact me and i will fix it!
    • Initial Release
    Version 2
    • Added free permission
    • Only match first expression
    • Match but don't display zero cost commands
    Version 3
    • Increased priority of CommandPreProcess hook to improve compatibility
    Version 3.1
    • Bukkit 602 compatibility
    Version 5
    • iConomy 4.6.5 suport
    [*]Added optional logging to the console
    [*]Added optional matching of chat events
    [*]Added command cost to insufficient funds message
    [*]Verified CB612 and MC1.4 support
    [/LIST]
    Version 6
    • Added command cooldowns
    • Added fee collection account
    Version 7
    • [iConomy 5 support
    //Sidenote spoiler's are messed up so i removed them.
    //if someone is against this, he can format my post himself :p
     
  2. Offline

    Kostronor

    well, register is a "plugin" but more a connector to help plugin-authors thinking about their code and not how to implement thousands of new economy-systems.
    having register in your plugin-folder should resolve that issue.
    http://forums.bukkit.org/threads/re...all-payment-methods-economy-api-stable.16849/
     
    RG_PankO likes this.
  3. Offline

    ollidk123

    it a great idea but my players on the server cant see how many money they have only ops can
    hope you can help me :)
     
  4. Offline

    timzy

    That has nothing to do with this plugin, you've missed out to give your members iConomy permissions.

    EDIT:
    Right, so finally figured the problem out. Rather silly error...
    But! The thing is that every time someone uses a priced command they literally get promted with "Charged {cost}" and not the actual cost itself.

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

    Kostronor

    change {cost} to (cost) ;)
     
  6. Offline

    timzy

    I'll give that a shot, thank you for the reply!
     
  7. Offline

    RG_PankO

  8. Offline

    mradr

    I can't seem to get this to work. We're using a higehr version than 1337, but it really shouldn't matter.
    The error we're getting is: "Could not pass event PLAYER_COMMAND_REPROCESS to Command iConomy"
    I see above that it can't find iConomy... we're using iConomy 6.0.8b. I try downloading register 1.5 to no avail also.
    Our command list also:
    ^/tp \S+$: 20 60
    ^/warp \S+$: 5 60
    ^/heal \S+$: 20 60
    ^/feed \S+$: 30 60
    ^/strike \S+$: 1000
    ^/shoot \S+$: 1000
    ^/explode \S+$: 1000
    ^/light \S+$: 1000
     
  9. Offline

    Kostronor

    wait, first please post the whole error, because "Could not pass event PLAYER_COMMAND_REPROCESS to Command iConomy" only tells me something in wrong while charging a command.
    If you do not have register, here is a working version:
    http://dl.dropbox.com/u/28093398/Register.jar

    Try putting this into your plugin-folder and it should work :)
     
  10. Offline

    mradr

    I'm so sorry... I'm still perty new to bukkit here. Ok here is the error I was getting:
    Code:
    08:14:58 [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to Command iCon
    omy
    java.lang.NullPointerException
            at java.util.regex.Pattern.<init>(Unknown Source)
            at java.util.regex.Pattern.compile(Unknown Source)
            at com.ryanmichela.cmdiconomy.CIListener.chargePlayerForCommand(CIListen
    er.java:70)
            at com.ryanmichela.cmdiconomy.CIListener.onPlayerCommandPreprocess(CILis
    tener.java:47)
            at org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.ja
    va:288)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:339)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.
    java:749)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:721)
    
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:714)
            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:92)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
            at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:516)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:414)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    I try with the reg you give me and then I get this error...
    Code:
    08:36:19 [SEVERE] Could not pass event PLUGIN_ENABLE to Command iConomy
    java.lang.NoClassDefFoundError: com/nijikokun/register/payment/Methods
            at com.ryanmichela.cmdiconomy.server.onPluginEnable(server.java:32)
            at org.bukkit.plugin.java.JavaPluginLoader$47.execute(JavaPluginLoader.j
    ava:585)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:339)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:964)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:280)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:182)
            at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:165
    )
            at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:337)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:324)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:161)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:388)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
     
  11. Offline

    Kostronor

    the first error is a bug in your regular expressions, if you tell me them, i can have a look at it.
    The second error is something with register, do you have it in your plugin-folder?
     
  12. Offline

    mradr

    You mean this?:
    start, command, arg, end, price, time delay?
    Code:
    ^/tp \S+$: 20 60
    ^/warp \S+$: 5 60
    ^/heal \S+$: 20 60
    ^/feed \S+$: 30 60
    ^/strike \S+$: 1000
    ^/shoot \S+$: 1000
    ^/explode \S+$: 1000
    ^/light \S+$: 1000
    /tp Mradr, /feed Mradr is how they work.
    Yes I do actully.. ^^ trust me I am following everything you are telling me to do:) I wanna get this to work.
     
  13. Since the plugin supports Register, does it also work with BOSEconomy?
    I know it says you need iConomy in the description, but as far as I know, register adds support for BOSE in most other plugins.
     
  14. Offline

    Kostronor

    yes, that is right.

    interesting, i really have no idea whats the problem, perhaps post your configuration-file?
     
  15. Offline

    PyPKjE

    [Command iConomy] Failed to process prices.config
    java.lang.NullPointerException
    at org.bukkit.plugin.java.JavaPlugin.getResource(JavaPlugin.java:156)
    at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:133)
    at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:125)
    at com.ryanmichela.cmdiconomy.CIListener.verbose(CIListener.java:153)
    at com.ryanmichela.cmdiconomy.CIListener.<init>(CIListener.java:37)
    at com.ryanmichela.cmdiconomy.CIPlugin.onEnable(CIPlugin.java:52)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:183)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:176)
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:159)
    at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:337)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:324)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:161)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:388)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
     
  16. Offline

    Kostronor

    failure on your site, prices.config in not formatted well, delete and let the plugin recreate and it should work ;)
     
  17. Offline

    mradr

    Ok I seem to have figured out a fix... I forgot what debug one you poast (should be the last one), but that one does seem to work right with the settings and config for v8. The one posted on top did not. I didn't change the config file at all. All I did was open it up and look at it and then closed it. Yes, I installed it many times cleaning it out each time, so I know it's the build it self and not my luck xD
     
  18. Offline

    Royalgamer06

    Really awesome plugin.
    Need this so neccesary!
    Please update to RB for MC v1.0.1!
    Thank you
     
  19. Offline

    shanko

    seems to be working fine for the RB for me
     
  20. Offline

    Royalgamer06

    plz update to the lates RB!
    Thank you
     
  21. Offline

    mcferson

    have we a way to put a price on a non-commande use ?
    i mean, i.e. when a player make something special dealed and authorized by a plugin, like lavafurnace : lavafurnace.player.building. This one, when a player build a lavafurnace (he write a command on a sign), then the furnace is activated.
     
  22. Offline

    kripts

    How do you register the Iconomy plugin?
    I get this error on the console:
    iConomy] Cannot charge for command, no Iconomy-System registered yet!
    Then this one in the log:
    2011-12-19 05:05:22 [SEVERE] Could not pass event PLUGIN_ENABLE to Command iConomy
    java.lang.NoClassDefFoundError: com/nijikokun/register/payment/Methods
    at com.ryanmichela.cmdiconomy.server.onPluginEnable(server.java:32)
    at org.bukkit.plugin.java.JavaPluginLoader$47.execute(JavaPluginLoader.java:590)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:975)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:186)
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:169)
    at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:348)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:335)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:165)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:399)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    Caused by: java.lang.ClassNotFoundException: com.nijikokun.register.payment.Methods
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
    ... 13 more
     
  23. Offline

    oxbudy

    it does not charge the command with the error
    [Command iConomy] Cannot charge for command, no Iconomy-System registered yet!
    Help please?
     
  24. Offline

    shanko

  25. Offline

    oxbudy

    @shanko
    How can I obtain this "register"? i used to have it, but i forgot how i got it :|
     
  26. Offline

    shanko

  27. Offline

    mcferson

    An idea ?
     
  28. Offline

    Kostronor

    well, this plugin is about people using commands ore chatting.
    If you need this, i could add support for creating signs with spezial patterns like for commands, is that what you wanted?

    Like said by shanko, it should work for the new build.

    Apart of that, i was waiting weeks for the build and now everyone is about please update:D

    If there is any error, than tell me and i fix it, the only thing else i have to update it this threads title
    Thanks for the statement and support :)

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

    kripts

    @Kostronor
    Does this plugin work with nodes aswell as commands? and is there a way you could allow it to use Vault aswell?
     
  30. Offline

    Kostronor

    what are notes and what is the Vault?
    Just me being curious :D
     
  31. Offline

    mcferson

    no it's not :)
    i take back the example of "lavafurnace" plugin. The special furnace is created and activated just when the player put e sign on it, with a special text ([lavafurnace], here). This use the capability to build the furnace provided by the permission "lavafurnace.build".
    It's only an example, because lots of plugins act this way. So, somewhere, a command must be dealed to the server, i don't know how, i never dev a plugin yet.
    some plugins are able to provide a cost for such action. in this way, lavafurnace should provide it, yes,
    But is iConomy can or could (in future) add support for non-text-command ?
     

Share This Page