[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. Looks really good! Great idea, man.
     
  3. Offline

    GayJuice

    very nice, any plans to add support for BOSconomy?
     
  4. Offline

    Plague

    changelog has to show two last versions without a spoiler
     
  5. Offline

    LlmDl

    This is working great on my server right now, running 819.
     
  6. Offline

    mickael002

    Kostronor how to do this:

    /f create myfactionname (cost 25 $)
     
  7. Offline

    OrtwinS

    I believe '\S+' (without the quotes) stands for one or more non whitespace characters, so:
    ^/f create \S+$: 25

    @Kostronor THANK YOU for continuing this plugin!
     
  8. Offline

    Kostronor

    better now?
     
  9. Offline

    OrtwinS

    @Kostronor Do you plan to implement group specific pricing?
     
  10. Offline

    Kostronor

    that would be an idea, but i don't know how to do it...
    i could add something like a grouplist but that would be an ugly solution. will see, i'll keep that in mind
     
  11. Offline

    OrtwinS

    hmmm, something like this?

    Code:
    exceptionGroups:
      - donor
      - punished
    #all other groups use default pricing
    
    Prices:
    ^/sethome$: 50:10:100 10                <--- 50 for default, 10 for donor, 100 for punished, 10 is cooldown in seconds
    ^/home$: 100:20:500 60
    
    The tricky part is that such groups would be Subgroups on my server, that means they inherit permissions but I'm not sure if my players actually count as a member of those groups.


    That could be solved with dynamic permission nodes, like kits.
    All kit plugins I have used create a new permission node for every kit, like commandbook.kit.kits.[kitname]
    The same could be done with price-groups, like commandico.group.donor.

    An even more basic approach would be to make fixed levels, I wouldn't mind having 3 (or 5) fixed price levels.

    no special permisison = default pricing
    commandico.group1 = price level one
    commandico.group2 = price level two
    etc.

    the config would again be like:
    ^[command]$: [50:10:100] 10


    edit: Please note that my JavaKnowledge = 0, but I am familiar with some programming and judging from other plugins this seems plausible
     
  12. Offline

    mickael002

    Ortwin thank you but that does not work.
     
  13. Offline

    Ratchet

    can we have an option to show a message when the player is charged?
     
    Rytharr likes this.
  14. Offline

    mickael002

    help please
     
  15. Offline

    s1ck3st

    is it possible to transfer the taken coins to someone's bank account?
     
  16. Offline

    heifinator

    If I have insufficient funds it still executes the command. Is this a known bug? Or a limitation of the plugin.

    edit: This is an issue with commands that run with rtriggers. Rtriggers will run the command even if you have insufficent funds.
     
  17. Offline

    Valkyr

    This plugin doesn't receive enough love for what it deserves. It's amazing, my server is heavily dependent on it and I'd just like to thank Kostronor for spending time on it. Thank you.
     
  18. Offline

    Kostronor

    This is caused by plugins from authors not using events well, normally this cancels the command so the plugin should not use it but if they've done wrong they just ignore it and proceed with the command.

    Why would you want this?
    but i could add it, not much effort thought ;)

    tell me

    normally there should be a message, will check this

    Like i said, that would be an ugly solution, but i think, i will add a group tag, so the plugin checks if a player is in a group and will change the price with a percentage like 50% off.
    I'm working on it :)

    and last but not least:
    Thanks, your cheering me up :D

    you can use some of the free regex-tools available on the internet, i use Expresso for simple tasks
    Use:
    ^/f create .+$ : <cost>
    . = one character
    + = one or more of this character
    so /f create <one or more regular characters>

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

    mickael002

    Kostronor :

    prices.yml

     
  20. Offline

    Kostronor

    try this:
    ^/f create \S.$: <cost>
     
  21. Offline

    mickael002

    Us it does not work.

    However it works: ^ / f create. +: 35
     
  22. Offline

    DreadKyller

    @mickael002 that's basically what he was telling you to do he was using the <> to shiow where you put your values, not that the <> were actually supposed to be in the config.
     
  23. Offline

    1021588029

    I am a Chinese.. I to your server feel great.. Come on.. I like most currencies....... The plugin.
     
  24. One of my players had the cool idea to make any charges go towards the lottery. Any chance that could happen?
     
  25. Offline

    BioRage

    Tried this plugin, works VERY well with /cprivate (LWC)

    Keep up the good work man, this is really good.
     
  26. Offline

    ethood1999

    So in that example above, when I type "/warp <anything>", it will charge me 10 of whatever my currency is and then wait 30 seconds to teleport me? Or does it make it so that I can't use the command again for another 30 seconds?

    If it makes it so that I can't use the command again for another 30 seconds (which the name "Cooldown" implies but your description confused me), pretty please PLEASE incorporate warmups. That's what I need so much.
     
  27. Offline

    Kostronor

    Its none of both, its no "skill-cooldown", more a "charge-cooldown" if you warp yourself and then you perhaps have to warp yourself again then in 30 seconds this command is free of charge for only this player to retype how often he likes
    thanks :)
    thank you to for your cheering!
    I don't think it would be useful to just support one lottery-plugin (perhaps for exclusively your server or stuff) but i am not enough familiar with iconomy to understand all this bank-stuff but i could add an option to send the money to a bank-account...
     
    AS1LV3RN1NJA likes this.
  28. Offline

    FireFreak111

    Does this work with #928?
     
  29. Offline

    Kostronor

    I dont know, havent found time to test it, just test it yourself and tell me :D
     
  30. Offline

    BioRage

    @Kostronor
    How would you do it like this, Factions plugin uses two commands:
    1: ^/f create \S+$: 5000 (This one is set with /f)

    However, you can do things with factions that uses "f" instead of "/f" how can I use this appropriately?
    ^f home$: 500 ?

    My config now..

     

Share This Page