[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

    yes, i think i did understand you :)
    so what i was thinking of is charging the user for placing a sign with [lavafurnace] on it, that would be possible
     
  3. Offline

    mcferson

    yes, like that. but there are other plugins with other signs.
    However, is this option already exists (and how to configure) or do you think to do it ?
    oh well, i thought about such option:
    Code:
    sign_charge:
        myssignname:
            text: "blahblahblah"
            cost: xxx
    something like that :)
     
  4. Offline

    Royalgamer06

    I had errors, but now I'am using essentials(econ). So it isn't necessary anymore. Thanks anyway :D
     
  5. Can i make tolls with this?
     
  6. Offline

    Kostronor

    i have not included anything with signs at the moment, if you really need it, than i will work at it.
    Sure, if passing the toll means, using a command/chat
     
  7. Offline

    shanko

    Only thing this plugin is missing is a /CI reload to reload the config, prices, etc
     
  8. Offline

    Kostronor

    since the config is changing important things, please use /reload to reload all of your plugins.
    Adding a /CI reload is something i didn't want because of no command use of the plugin itself
     
  9. Offline

    kripts

    Nodes are what you use for permissions to allow them to use the command, but some plugins don't use commands but only the nodes so it could be -essentials.kick or whatever, and Vault is basicly a plugin like register by the sounds of it, but it would be silly if i had 2 plugins that did the exact same thing.
    Check Vault out here:
    http://dev.bukkit.org/server-mods/vault/
     
  10. Offline

    Kostronor

    oh, that is good, i will consider supporting that :D
     
  11. Offline

    Pianoasis

    This:

    [Command iConomy] Loaded.
    2011-12-23 17:20:12 [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(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    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(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 13 more

    Seriously tell me exactly what to do.
     
  12. Offline

    Kostronor

    please read page 9 of this thread, there are many people having your error because they forgot to use register.
    If you read those posts, you will automatically read the solution to your problem posted by a fellow member of this community.
    Thanks and Merry Christmas to all reading this post:)

    I'll be on vacation some time, expect anything in januar :D
     
  13. Offline

    tbone502

    [SEVERE] [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)

    Can someone tell me whats wrong? By the way I have register 1.5, command iconomy v7, iconomy 6.0.7, and PermissionsEx 1.17.
     
  14. Offline

    Kostronor

    seems like there is an error in your prices.config
    show it to me or delete in and let it be recreated
     
  15. Offline

    tbone502

    I deleted it and it recreated itself but it still gets the same error
     
  16. Offline

    Kostronor

    please show the file to me, so i can test that, thanks
     
  17. Offline

    finamenon

    Is there any way to remove the automatic free commands to operators with this plugin?
     
  18. Offline

    Kostronor

    well, if you are not using permissions, then ops are something like admins, so they should not be charged.
    If you like to configure this, enable permissions and the op-system will be ignored
     
  19. Offline

    finamenon

    I am using permissions, have been for a long time. However your plugin has no options in the config file to enable or disable them. Also the only permission node you have listed in your first post is one to give free commands. I want to restrict free commands, not give them.
     
  20. Offline

    LlmDl

    @Kostronor

    Hello, I've just updated things to 1597 and my players aren't getting charged for using the /time command.
    Startup of server
    Prices.yml

    Any insight? I've redownloaded the jar from the firstpost.
     
  21. Offline

    Kostronor

    what i wanted to say is, if the plugin uses permissons, everything from op is ignored regardless of you giving any nodes. If this does not work, please tell me and i look into the code :)
    Hey @LlmDl
    I'm sorry to say that but i am on vacation until the 5th and then i will look at it, promise!
     
    LlmDl likes this.
  22. Offline

    Kostronor

    Well, Command Iconomy is loaded successfully and has found iconomy, so there should be no error.
    your regex seems to work on first guess...
    can you post your config? this could do the trick, perhaps :D
     
  23. Offline

    LlmDl

    I should have checked in earlier. After a day my log started showing this​
    2011-12-31 23:12:47 [INFO] [Command iConomy] Cannot charge for command, no Iconomy-System registered yet!​
    Where before there was nothing. It's strange.​
    Here's the text of my config​
    Code:
    Verbose: false
    ChargeForChat: false
    #PayTo: accountName
    
    NoAccountMessage: No bank account.
    InsuficientFundsMessage: Insuficent funds. {cost} needed.
    AccountDeductedMessage: Charged {cost}
    
     
  24. Offline

    Kostronor

    hmmm...,​
    perhaps this could be a conflict with vault?​
    can you try to remove vault to test if it works then?​
    I wanted to change to vault because it is a better system so this would be a temporarely bug, but i think this could be the case...​
    [/CODE][/LEFT][/quote][/CODE][/LEFT]
    [/quote][/CODE][/LEFT][/quote][/LEFT]
     
  25. Offline

    LlmDl

    I doubt its a vault conflict, I run vault alongside register for a couple plugins and there's never been a conflict reported. I did just resolve an issue with post-christmas builds of SK89q's plugins, so I might try again.
     
  26. Offline

    finamenon

    Well, I could just not be saying it clear enough, sorry D:

    I don't want ops to be ignored. I want ops to pay money like everyone else. How do I do this?

    Thanks for your time
     
  27. Offline

    Kostronor

    if CommandIconomy uses permission, then the op-system will be ignored, in other words, ops and non-ops pay the same price without the permission, so that is what you want ;)
    I have not implemented an option to do this without using permissions, but if you use permissions, then ops will pay!
    If they do not have to pay anything, check for * permissions and report to me :)

    will try with built 1602 the next days if a can reproduce this conflict with vault

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

    secondstomarz

    Sorry to bring this error up again, but I can't seem to fix it.

    Code:
    [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 org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:436) 	at org.bukkit.Bukkit.reload(Bukkit.java:187) 	at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:22) 	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:165) 	at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:378) 	at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:374) 	at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:564) 	at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:541) 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425) 	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:202) 	at java.security.AccessController.doPrivileged(Native Method) 	at java.net.URLClassLoader.findClass(URLClassLoader.java:190) 	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:306) 	at java.lang.ClassLoader.loadClass(ClassLoader.java:247) 	... 18 more 
    I have Iconomy and Resgister. I deleted the CommandIconomy folder and let it generate a new one, but I'm still getting these errors.

    Here is my config and prices:

    config (open)
    Verbose: false
    ChargeForChat: false
    #PayTo: accountName
    UseamountMultiplier: false
    NoAccountMessage: No bank account.
    InsuficientFundsMessage: Insuficent funds. (cost) needed.
    AccountDeductedMessage: Charged {cost}


    prices (open)

    # To charge for a command, list a matching regular expression below on its own
    # line with the price, separated by a colon. For more info on regular expressions
    # see http://www.regular-expressions.info/reference.html
    #
    # ^/tp: 10
    # To add a multiplier to a command like /i or /give so it charges for every item not for the whole command:
    # ^/give stone 10(amount)(?:/give \w+ )\d+: 10 will cost 10*10=100
    # (?:<regex>) is a noncapturing group, so it will be included in the match but will not alter the returned amount
     
  29. Offline

    Kostronor

    Well, the error tells me, that my plugin cannot find your Register, so you have to put the register.jar into your plugin folder for it to work.
    I will change dependency to Vault sometimes near, so this will hopefully be past
     
  30. Offline

    secondstomarz

    Re-downloaded Register and it works now, thanks. :)
     
  31. Offline

    Kostronor

    Now, this requires Vault, this should elimintae many of the problems some of you encounter!
    http://dev.bukkit.org/server-mods/vault/
    Warning!
    Since i got some complaints about the Folder-Name, i have changed it from
    Command iConomy
    to
    CommandIConomy
    you can just move your old files to the new place
     

Share This Page