[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


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

    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.

    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

    • CommandIConomy.Free - Grants free access to all commands.
    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

    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
    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


    @BioRage, I'm not sure if that will work, but if it doesn't, just disable the ability to not have to use a slash in the Factions config file.
  3. Offline


    Tried to find it, sadly I'm either blind, have no luck. heh.
  4. Offline


    In conf.json, the 34th line says:
      "allowNoSlashCommand": true,
    Change the "true" to "false" (make sure the comma is still there)
    BioRage likes this.
  5. Offline


    Thanks for the takeover :)
  6. Offline


    Can anyone confirm if we are OK for CB935?
  7. Offline


    request feature without money/economy plugins, just pay for commands with ITEMS! ;)
  8. Offline


    cool idea, will add to todo:D
  9. Offline


    Doesn't appear to be working in 928 for me.. Help? :(
  10. Offline


    Love this plugin, can anyone running 953 confirm if it works?
  11. Offline


    k i need major help i dont under stand that Reference manual at all so for spawning what would say TNT be?
    like this? ^/give /s+ 46 1$: 10
    like that or something else cause i want to add it so it costs for spawning
  12. Does this work with iConomy 5?
  13. Offline


  14. Offline


    Confirmed working on RB953, with iConomy 5

    One problem tho, if they happen to mistype the command, or lets say try to make a warpname that is already taken.... it still charges them. Examples:

    to warp costs $10

    the warpname is /warp here
    he types /warp heer, and still gets charged even though there is no /warp heer

    to make a warp is $100

    player does /warp set here
    that warp is already taken

    player is still charged $100

    Is there any way to make it so that it first checks if they have enough money, THEN executes the command, THEN checks if the command was successful, FINALLY it charges them.. ?

    Dunno if thats a tough one to do, but it really is necessary as I am planning on making some commands really expensive, so a mistype that charges $10,000 can't happen.

    Awesome plugin btw, gives my players something to do with their money =)
  15. Offline


    Not working for me with 953, don't know if it's another plugin "blocking" it.
  16. Offline


    The big question is, if the warp is already taken, does it return false?

    At the moment, it charges, befor the command is executed and "kills" the command if there is not enought money, i could add a check if it worked and re-add the money...
    but the question is, can i rely on the return of true/false for EVERY plugin?
    the rest would be minor i think

    try starting the server only with iconomy permissions and commandiconomy and try to charge for time day or something like it, if it works try activating one plugin after another and try it until the error appears

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


    @Kostronor could you update your thread title with a newer RB that this supports? This plugin is really great and commandpay still isn't on par with what you've created.
  18. Offline


    i will do, this is proven to work with 953 and should also work fine with 1000+, i'll update the title as soon as someone tests it. (you would give me a big hand if you would try it!)
  19. Offline


    @Kostronor Can you add multi-world support :) ?
  20. Offline


    does it fail because of multiple worlds?
    i think it should work on whatever world you are :)
  21. Offline


    no i want differente price depending the world
  22. Offline


    thats a good idea! will be added to the todo-list :)
  23. Offline


    i have looked at other plugins that do this, the example you listed for /tp will it charge for all /tp related operations?
    meaning if i type
    /tp mrvertigo27 bobthebuilder
    /tp bobthebuilder
    it will charge me for either by simply adding
    ^/tp: 10

    to the config
    or would i need to set both up separately with regex
  24. Offline


    Yea, I relized it actually did work, but forgot that it's free for me, since I'm admin ^^ So it's working´- But I got one question, if I want /warp (something after), what do I have to type?
  25. Offline


    Could this possibly have multi-world support? So I can charge users in one world, but no others.
  26. Offline


    MultiWOrld YAY :D
  27. Offline


    What do Verbose and ChargeForChat do in the config.yml? I couldn't find documentation for it anywhere.

    I would like to be able to charge people for each message sent in Global chat though. I use HeroChat
  28. Offline


    Please update for multi-world :-(


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


    ^ /tp: 10 will only charge you for /tp and /tp something will not be charged.
    this will only be charged, if you add something behind it. dot is every letter i think and there are some others, look at the topic, there are links explaining regex in general.

    multiworld on todo, next thing i will update is it ;)

    chargeforchat is if i should only charge commands or i it should charge commands and chat.
    for herochat i think, catch the command /ch or whatever you use for global chat and it should work.
    I do not know what Verbose is used for and after looking throught the code twice and searching everything for this keyword, therefore it should NOT appear, so just ignore it ;)
  30. Code:
    17:11:44 [INFO] Plugin Loaded: [Command iConomy]
    17:11:44 [SEVERE] Error occurred while enabling Command iConomy v7 (Is it up to date?): null
            at com.ryanmichela.cmdiconomy.CIPlugin.onEnable(CIPlugin.java:59)
            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:278)
            at com.bekvon.bukkit.plugman.PlugMan.loadPlugin(PlugMan.java:367)
            at com.bekvon.bukkit.plugman.PlugMan.doCommand(PlugMan.java:122)
            at com.bekvon.bukkit.plugman.PlugMan.onCommand(PlugMan.java:65)
            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:330)
            at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:491)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:470)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Happened with and without removing config folder first.
  31. Offline


    log.log(Level.SEVERE, "[Command iConomy] Failed to process prices.config", e);

    Thats, what causes this error...

    well, i think, i have to give you a debugging-version to help catching this bug:
    try this version please and paste the whole chatlog of the loading with error and everything

Share This Page