[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

    datwerd

    will u be adding iConomy6 compatibility at all? sorry to be pushy but charging for commands is kinda a must on my server and reverting back to iCo5 means rewriting my accounts database by hand =/
     
  3. Offline

    Kostronor

    Here is a Build of IConomy hopefully fixing this:
    http://dl.dropbox.com/u/28093398/debug/Command-iConomy.jar
    it's done by mkalus and i will see if it works ;)
     
  4. Offline

    KaoValin

    I get this on bukkit 1337 or 1240 using plugins iconomy 6.0.7b, permissionsex 1.15, command iconomy 7 (file linked above). I didnt notice any change in your plugin except for debug info about prices on boot.

    2011-10-20 21:49:52 [INFO] /time night
    2011-10-20 21:49:52 [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to Command iConomy
    java.lang.NoClassDefFoundError: com/iConomy/iConomy
    at com.ryanmichela.cmdiconomy.CIListener.chargePlayerForCommand(CIListener.java:79)
    at com.ryanmichela.cmdiconomy.CIListener.onPlayerCommandPreprocess(CIListener.java:46)
    at org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.java:288)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:750)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:722)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:715)
    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.h(MinecraftServer.java:471)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
     
  5. Offline

    datwerd

    ive been running that build for around 4-5 days now i can verify it works with 1317 and iCo6 i believe it will also work with other economy plugins as well :)
     
  6. Offline

    Kostronor

    so it works for one of you and for the other one not?
    i'm very confused :D
     
  7. Offline

    KaoValin

    I'll try stripping it down to just those three plugins and see what happens. I'll get back to you.
     
  8. Offline

    datwerd

    id say the other guy doesnt have the perms2x bridge perhaps
    just an educated guess if u wanna see it in action visit ip:minecraftau.com and type /spawn - it will say u don't have enough money as its a $250 command and starting balance is $150
     
  9. Offline

    notrub

    I am getting the exact same readout as KaoValin, including the [debug] readout when loading.
    I have the latest RB, and using PermissinsBukkit 1.2, iConomy 6.0.7, and the build you posted a few posts up.
    Thanx for all your hard work on this plugin.
     
  10. Offline

    Kostronor

    Ok, i think i found the error :D
    it was me renaming the debug-version different than the normal version.
    Now, please delete every CommandIConomy and Command-Iconomy and what else from your plugin folder and try this version:
    http://dl.dropbox.com/u/28093398/debug/CommandIConomy.jar
    (debug output deleted) ;)
     
  11. Offline

    notrub

    Same errors thrown. Only change is no [debug] message when loading.
    I deleted the folder and .jar from previous version, and added that one from this morning.
     
  12. Offline

    shanko

    I havent tried this plugin but would this work

    ^/cast teach [a-zA-Z0-9] fireball$:200

    would [a-zA-Z0-9] replace the users name? Is that how it works... if not some help with regular expression would be nice x.x

    or would it be ^/cast teach \S+ fireball$:200


    edit: just tried it got an error

    [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to Command iConomy

    I used this ^/cast teach \S+ fireball$:200

    I'm guessing the problem is within that?

    doesn't seem to be the way the command is written seeing as how i just tried a simpler command and got the same error

    im using iconomy 6 btw is that not compatible? Also I have permissions bukkit but I didn't use it for anything(nor do i see how you could use it?)


    edit: and if iconomy 6 doesnt work which iconomy do you suggest? (and is it easy/at least possible to downgrade?)

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

    Kostronor

    Ok, so it seems, the build is not Ico6-compatible...
    I'll try to find a solution!

    made a quikc register-support, perhaps it works :D i dont know
    register has to be in your plugin-folder i think https://github.com/iConomy/Register
    http://dl.dropbox.com/u/28093398/debug/CommandIConomy.jar

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

    LlmDl

  15. Offline

    shanko

    YESS

    IT WORKS NOW :D
    thank you!!!

    Okay there is a huge bug, it will let everyone cast commands for free when the server starts up, after i reload command iconomy it then starts charging people correctly, how can i reload it easier?
    this plugn works beautifully and is fantastic!! i love you but please fix this ASAP

    i cant reload plugins on my paid for server x.x and this plugin is perfect


    edit: it seems like a simple fix!!! <3

    on server start up it says

    07:39 PM [INFO] [Command iConomy] No payment method selected

    but the commands dont get charged, i go into the plugins(not available on my real server)
    and click reload, it reloads and

    07:41 PM [INFO] [Command iConomy] Loaded.

    works perfect!!! but I cant do this on my real server x.x

    EDITEDIT:
    maybe its because it comes on before register loads... x.x

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

    notrub

    Seems to be getting closer to working, but not quite there.
    No errors thrown, so that's nice. However, when loading (or reloading as shanko said), it always returns "No payment method selected".
     
  17. Offline

    Kostronor

  18. Offline

    shanko

    downloading now to test it... i will love you forever if it works


    edit:
    goes back to this error

    [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to Command iConomy
     
  19. Offline

    Kostronor

    whole error log please
    edit:
    redownload please, perhaps this fixes it
     
  20. Offline

    shanko

    Code:
    08:22:13 [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to Command iCon
    
    omy
    
    java.lang.NullPointerException
    
    at com.ryanmichela.cmdiconomy.CIListener.chargePlayerForCommand(CIListen
    
    er.java:78)
    
    at com.ryanmichela.cmdiconomy.CIListener.onPlayerCommandPreprocess(CILis
    
    tener.java:44)
    
    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:750)
    
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:722)
    
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:715)
    
    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 org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java
    
    :500)
    
    at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
    
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    
    08:22:20 [WARNING] Can't keep up! Did the system time change, or is the server o
    
    verloaded?
    
    08:22:25 [INFO] Shanko lost connection: disconnect.quitting
    
    08:22:25 [INFO] Connection reset
    
    >

    edit: okay redownloading

    Okay the new download says this

    08:28 AM [INFO] [Command iConomy] Cannot charge for command, no Iconomy-System registered yet!

    edit: ill get a full error

    double edit: thats all it says :p I have registered 1.5 installed with it too

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

    Kostronor

    ok, than what i thought was right.
    if you cast a command before your iconomy-system is loaded up than this message will appear and the command will NOT be charged!
    I can't do anything about it, thats with your plugins ;)
     
  22. Offline

    shanko

    I'm not sure what you mean? the iconomy system and register system both loadup before i cast a command

    edit: also it was working in the previous build you had but just didnt load on startup but it worked when i reloaded it

    editedit: maybe you didnt include the register function to work like how it was before?? ;_;
     
  23. Offline

    Kostronor

    wowowow ok, fail on my side, got a mistake in my mind :D fix it now :D
    redownload pls
     
  24. Offline

    shanko

    WORKS PERFECT NOW!!!
    I love you!!!!!

    Thank you so much for working with me like this lol... best plugin developer ever!!
     
  25. Offline

    KaoValin

    Working great on this end too. No conflicts so far. I did notice a few commands don't like '$' at the end like AdminCmd's /kit. Once removed it matched the expression just fine. Great work +2 internets for you.

    Since this is now working great I was wondering if I could make a suggested addition. With commands like /i or /give etc one can specify amounts. I was wondering if it'd be possible to create a expression that would multiply the cost of the command based on the amount input by the user. Example below.

    ^/i stone \#$: 1
    /i stone = charges 1
    /i stone 12 = charges 12

    ^/i ironingot \#$: 50
    /i ironingot 5 = charges 250

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

    arrowman92

    Can someone put in iconomy that is compatible with this plugin or tell where to get? Thx
     
  27. Offline

    notrub

    Its working!
    You are awesome!
    Thanx for all your hard work on this plugin.
     
  28. Offline

    Kostronor

    it works with register, so every economy supported by register works fine :)
    just make sure you have register in your plugin-folder
    https://github.com/iConomy/Register

    Why not?
    but this will be a bit more complicated, so you have to write two regex to first match the command and than match the multiplier-number, will think of it :D
    edit: implementing it atm ;)
    edit2: done implementing the new feature :D will now update the defauls generated config with some explanation of it, please let it be recreated to ensure the new options are in it. save your regexes somewhere before doing this!
    http://dl.dropbox.com/u/28093398/debug/CommandIConomy.jar
     
  29. Offline

    KaoValin

    Trying it out now. The old regex work just fine still but I am having trouble getting it to match the new type. Your help would be greatly appreciated as I've been trying different combinations for a while now. Here is what I am currently trying as a regex to get /i stone # to match.

    (?:/i stone )\d+: 2

    Additionally you spelled included and amount wrong in the template.

    Edit: Did more testing and found your "useamoughtmultiplier" in the config. I enabled that and the server started throwing errors (posted below). I removed the new type of regex with the multipliers thinking I was doing those wrong but the old type alone (working perfectly fine prior to enabling) weren't working at all. I'm not sure if this is intentional so that one has to choose to do regex with multipliers or not at all. The expressions I used for doing the price multipliers didnt work either having tried many different ways again.

    2011-10-27 16:56:07 [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to Command iConomy
    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(CIListener.java:72)
    at com.ryanmichela.cmdiconomy.CIListener.onPlayerCommandPreprocess(CIListener.java:47)
    at org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.java:288)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:750)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:722)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:715)
    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.h(MinecraftServer.java:471)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
     
  30. Offline

    WhiteDragon

    FYI: Register is broken

    Register's DEV site link here:
    http://dev.bukkit.org/server-mods/register/

    Like I said though it is broken and the Developer hasn't made a post in a long time so people are starting to wonder if it is going to become a dead plugin.
    Nijikokun was last seen: Sep 30, 2011

    Nijikokun is the Developer for Register and iConomy. Sooooo, Yeah I think some of us are wondering if he is coming back.
     
  31. Offline

    Kostronor

    Nijikokun had left Bukkit somewhat before and the returned, as long as the old Register-build is working, everything is fine, but i cannot help with supporting something that is broken :D
    ok, first:
    sorry for the typos, I'm no native English-speaker, so this is sometimes hard for me :D
    if you leave useamouhtmultiplier to false, EVERYTHING will remain AS BEFORE ;)
    only if you turn it on, you CAN do the amount-thing.
    but i'll work an an easier tutorial for it :)

    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 amought

    (?:/i stone )\d+: 2 this works fine but you forgot the first regex:
    /i stone \d+(amount)(?:/i stone )\d+: 2
    this should work :)

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

Share This Page