Inactive [MISC] CommandHelper [3.2.0] - Repeat commands! Aliases! Advanced command scripting! [1000]

Discussion in 'Inactive/Unsupported Plugins' started by sk89q, Feb 16, 2011.

  1. Offline

    sk89q

    CommandHelper is a utility plugin for working with commands.

    • Build your own commands without knowing Java or having to make a plugin
    • Repeat your last command with /.
    • Per-player command aliases
    • Global command aliases
    [​IMG]

    [​IMG] CommandHelper 3.2.0

    [​IMG] Requirements: Java 1.6+ required. Mac OS X users may have to update their Java version. In addition, you need "WorldEdit," but the download linked above has a version with WorldEdit already bundled.

    [​IMG]

    [​IMG]
     
    Pinoyskii, DHLF, beleg and 6 others like this.
  2. Offline

    sjoerdtim

    can i do it so:
    /water = /f join water \
    /perm-add (player that uses the command) Water \
    /pr -reload all
    ???
    the player that uses the command, is their an symbol for???
    ^ or ~username don't works
    (excuses for bad english, im dutch)
     
  3. Offline

    DeanDip

    player() returns the player using the command
     
  4. Offline

    Swadon

    Please, update to the new recommended Build #860 ! :)

    Thank You.
     
  5. Offline

    DeanDip

    It still works on bukkit build 860. Unfortunately for you, something unique to your setup is causing it to not work.
     
  6. Offline

    Swadon

    Oh thank you for your reply, I'll watch.
     
  7. Offline

    sjoerdtim

    ty :D
     
  8. Offline

    Swadon

    Please, how can I put a color to text ?

    This does not work :
     
  9. Offline

    MG127

    still the same with cb860, commandhelper 3.1 and defaultCommands
     
  10. Offline

    DeanDip

    Use this weird symbol § instead of &
     
  11. Offline

    Swadon

    Thanks ! :)

    Look, this simply alias doesn't work >< :
    (This alias is in the wiki)


    And console logs :
    Thank you for help me because I don't understand :(

    Thank You.

    Edit : I just think that this plugin does not work under CraftBukkit b860, look this error with this alias :
    Afterwards I could be wrong ...

    (Sorry for my bad English, I'm French).
     
  12. Offline

    DeanDip

    Hmm, that it isn't working for me either, and idk why. Maybe functions can't be used in commands that aren't put entirely in run() or concat(), and that may be a bug since functions are used like that in the example script, but I can rewrite it in a way that does work though.
    Code:
    /kit gold = assign(@player, player()) \ /give @[URL='http://forums.bukkit.org/members/player.6564/']Player[/URL] 284 64 \ /give @[URL='http://forums.bukkit.org/members/player.6564/']Player[/URL] 285 64 \ /give @[URL='http://forums.bukkit.org/members/player.6564/']Player[/URL] 286 64
    Darn it, this forum is messing with the code. There shouldn't be a url thing in there.

    I'll see if it shows right outside the code box:
    /kit gold = assign(@player, player()) \ /give @Player 284 64 \ /give @Player 285 64 \ /give @Player 286 64

    Yeah, that works except Player should be player (not capitalized).
     
  13. Offline

    Swadon

    Thanks, but it give me this :
     
  14. Offline

    DeanDip

    I said except Player should be player. Change all the upper case Ps into lower case p's. I can't make it lower case in the above post because the forum automatically capitalizes it.
     
  15. Offline

    Swadon

    Yes, look how it is in my config.txt :
    [​IMG]
    And it still does not work.
     
  16. Offline

    DeanDip

    I'm sorry. It appears variables can't be used in commands outside concat() or run() either.

    This does work though, I've tested it:
    /kit gold = assign(@player, player()) \ concat('/give ', @player, ' 284 64 ') \ concat('/give ', @player, ' 285 64 ') \ concat('/give ', @player, ' 286 64 ')
     
  17. Offline

    Swadon

    Great, it work ! Thank You man :)
     
  18. Offline

    Asphodan

    Is there a way to give people access to aliases that enable them only very specific commands?

    I want

    /tpscratch = /mvtp 'w:scratch'

    But, to not give them Permissions to the whole mvtp. Just that specific tp.
     
  19. Offline

    DeanDip

    There's two options I can think of, and at least one of them should work.

    The first is if the plugin for the mvtp command allows all OPs to use all commands, then you can code the command like this:
    Code:
    /tpscratch = runas(~op, '/mvtp w:scratch')
    The second is if OPs don't have access to the command, then you could give them the permission to use /mvtp and then in commandhelper make it so they can't use it like this:
    Code:
    putyourcustomlabelhere:/mvtp [$=''] = sconcat('/mvtp', $)
    
    putyourothercustomlabelhere:/tpscratch = /mvtp 'w:scratch'
    and then switch in your label names and give permissions for each to whom you want to use it by giving the permission node commandhelper.alias.(label name here)
     
  20. Offline

    Asphodan

    First doesn't work; I assume because of have Permissions and because MultiVerse turns off defaulting to Op once it detects Permissions.


    The second.. What does

    Code:
    putyourcustomlabelhere:/mvtp [$=''] = sconcat('/mvtp', $)
    do?

    Edit: Did this, and it doesn't work. :( They don't have rights to the command.


    - commandhelper.alias.teleport


    ^-- Added that to the intended group.

    And ---v

    teleport:/mvtp [$=''] = sconcat('/mvtp', $)
    teleport:/tpscratch = /mvtp 'w:scratch'


    Is my whole CH config.
     
  21. Offline

    DeanDip

    That makes it so that when people use /mvtp it runs the commandhelper code (which includes the code to run /mvtp like normal) so that permission can be controlled for that command. The label is what allows/disallows the person to use the commandhelper code, but the person with the commandhelper permission still needs permission for /mvtp (the multiverse permission I assume) to be able to use it too.
    Give the (I guess multiverse) permission node to use /mvtp to the group you want to use /tpscratch, which is the whole point of making the /mvtp command in commandhelper so that it can still be disallowed for them. Make the label for the /mvtp [$=''] command be something different other than teleport so that you aren't giving the people who can run /tpscratch permission to use it.
     
  22. Offline

    mattekure

    There is some kind of problem in the way commandhelper and the voucher plugins work. the voucher plugin allows you to register commands so that players can buy access to them. I used commandhelper to make a /day and a /night command, but the voucher plugin wasnt able to register them correctly. Do the command helper scripts register differently than other plugin commands? Or are they registered as an alias? or something else? I have asked the voucher plugin author to get in touch with this plugin to see if they can work it out. Having the ability to make my own commands that the players can pay to get access too is just too awesome to give up on.

    thanks much
     
  23. Offline

    wraithguard01

    I will look into the crashing issue, obviously that shouldn't happen, but I'm not sure I'll put in a way for users to disable the /. command entirely. When users can use plugins like improved chat, which can essentially do the same thing, why would you want to disable the capability?

    CommandHelper dynamically registers commands, other than the built in commands, such as /alias and others. The plugin itself doesn't define any other commands, so it would be up to the voucher plugin to work with CH. Having said that, if the voucher plugin author gets in touch with me, I will gladly see if we can work together to get both plugins cooperating.

    As soon as I get back home, I'll take a look at this. I can definitively say, without looking, this is a bug.
     
  24. Offline

    Asphodan

    Any way you could help me with my scripting issue? I'm stumped. :(
     
  25. As then I can ban them for doing it on purpose, this was an accident due to a typo, and an ability I don't need or want them to have, nor do they even know they do.
     
  26. Offline

    Scandragon

    If I have just one alias in the config.txt, reloading aliases gives "An internal error occured while attempting to perform this command"
    If I have more than one, I get "Unexpected newline"

    This started instantly after updating to CB818 and remains an issue in CB860

    The mcMMO command /stats can still not be run via ch aliases
     
  27. Offline

    wraithguard01

    If DeanDip's solution doesn't work, then you may have to wait until I get runas to do something along the lines of: runas('~notOpButSomeOtherPermissionGroup', '/some command'). I want to get that added soon, but I'm waiting on a couple of other things to happen before I can do that, including the Permissions plugin itself, actually adding the ability for full Java plugins to change a players group, realtime. Bug @rcjrrjcr to get the experimental branch of Permissions merged with his master branch.

    Oh, also, @DeanDip, your example: runas(~op, '/cmd') is bad practice. You should wrap ~op in a string, because ~ is a special symbol, and I make no guarantees that I won't make symbols have special meaning in the future, which would break your script. Only letters and numbers outside of strings that aren't explicitly quoted are guaranteed to always behave like strings. It just so happens that ~ doesn't have a special meaning yet.

    Eh, fair enough. It'll be in the next version.

    Can you post a stacktrace, if there is one, what your config file looks like?

    It looks like mcMMO is handling commands in a non-standard way. This is probably the same issue that @mattekure is having with the Voucher plugin. I don't know what causes this, tbh. I will continue to look into it.
     
  28. Offline

    Scandragon

    This is my config.txt.. It used to have comments between the aliases, I removed those trying to find the reason for this
    Code:
    /jump = /jumpto
    /j = /jumpto
    /forum = msg('You can find our forums at http://refugee.zzl.org')
    /level = >>>
    /stats
    /money
    <<<
    setgroup:/setgroup $player [$group='Players'] = concat('/pr ', $player, 'parents add ', $group)
    addnode:/addnode $node $group = >>>
    concat('/pr g:', $group, ' perms add ', $node)
    msg('Added permission node ', $node, ' to ', $group)
    <<<
    remnode:/remnode $node $group = >>>
    concat('/pr g:', $group, ' perms remove ', $node)
    msg('Removed permission node ', $node, ' from ', $group)
    <<<
    pie:/pie $player = concat('/me trows a pie at ', $player, 's face then hands him a fork to eat it with')
    /pi = /me likes 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253
    /slap [$player='himself'] = /me slaps $player around a bit with a large trout
    Whatever I do, adding more than 1 line to this file gives an "unexpected newline"
    (I should think a new line would be expected there, unless the plugin wants me to have everything in one single line ;))
    Perhaps the problem with mcMMO is that the commands you type are in fact aliases themselves? You can change them in config..
    If we knew the actual command to execute, maybe that'd work?

    Oh.. And it seems recently that you can't always count on aliases from CH to override other commands. About 10% of the time, /j and /jump are executed from essentials (giving odd errors such as being put on the wrong blocks or warnings about hurting your computers brain)
     
  29. Offline

    wraithguard01

    Your config file compiles fine for me. I'm not sure exactly why it's not working for you. What version of CH are you running?

    In theory, it should work regardless, because the ultimate execution of the real commands uses the builtin bukkit method to execute commands, which (should be) roughly equivalent to the user typing in the command into their chat bar. Having said that, there has been a bug before with that bukkit command, perhaps it wasn't entirely fixed? I'll have to ask @EvilSeph or somebody about that.

    Hmm. I've heard tell that Essentials doesn't always play nicely with other plugins. TBH, without looking through their code some more (which is huge) I don't know what to say, however, I suspect that both CH and Essentials have registered some event as the same priority, and when that happens, which plugin gets the event is undefined. If that is the case, I'm not sure how to fix it. As far as commands go, CH should get the highest priority, because any commands it runs are defined by the server admin, NOT me.
     
  30. Offline

    Scandragon

    Well it does compile for me during server start or /reload
    But not with /reloadaliases
    And the error is also given when any user tries to create an alias in-game

    I remember reading somewhere about some changes in CB preventing plugins from cancelling/overriding commands from other plugins (probably in the Jail release thread) but I don't know if that's true. Probably not
     
  31. Offline

    wraithguard01

    Yeah, it works for me, both at startup, and in-game. (Also from the console). The compiler should give you a slightly more informative error message, which should include the line number it's failing on. Can you check that?

    I'm pretty sure that user aliases are completely broken. That is actually not a recommended feature to allow at this time, because there are too many security flaws in the current model. Right now, a user could trivially write a script to crash the server. So, until I can implement a better security model, I'm kinda not supporting that feature. It is fairly high on my to-do list though.
     

Share This Page