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

    vampirepiggy9

    when i try to do any alias it says "an internal error occured while attempting to perform this command"
    why is this happening and how do i fix it??
    thanks!
     
  3. Offline

    musicin3d

    I was just about to start writing something like this. Thanks! :D
     
  4. Offline

    Scandragon

    It does this on purpose..
    I fire up the real console over ssh so I can see what happens (this takes time with my setup as I only have one slow computer)
    I restart and try /reloadaliases...
    And everything WORKS!

    How dare it start working while I'm trying to troubleshoot!
     
  5. Offline

    opoq

    sk89q:
    I'm using CH3.1.0, PEX1.11, and RB860.
    When I try to use:
    Code:
    /test = if(array_contains(pgroup(),admin), run(/save-all))
    This error occurs:
    Code:
    23:12:01 [INFO] An unexpected exception occured during the execution of a script.
    23:12:01 [SEVERE] java.lang.ArrayIndexOutOfBoundsException: 0
    23:12:01 [SEVERE]     at com.laytonsmith.aliasengine.functions.PlayerManangement$pgroup.exec(PlayerManangement.java:331)
    23:12:01 [SEVERE]     at com.laytonsmith.aliasengine.Script.eval(Script.java:225)
    23:12:01 [SEVERE]     at com.laytonsmith.aliasengine.Script.eval(Script.java:171)
    23:12:01 [SEVERE]     at com.laytonsmith.aliasengine.Script.eval(Script.java:171)
    23:12:01 [SEVERE]     at com.laytonsmith.aliasengine.Script.run(Script.java:96)
    23:12:01 [SEVERE]     at com.laytonsmith.aliasengine.AliasCore.alias(AliasCore.java:83)
    23:12:01 [SEVERE]     at com.sk89q.commandhelper.CommandHelperListener.runAlias(CommandHelperListener.java:88)
    23:12:01 [SEVERE]     at com.sk89q.commandhelper.CommandHelperListener.onPlayerCommandPreprocess(CommandHelperListener.java:132)
    23:12:01 [SEVERE]     at org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.java:271)
    23:12:01 [SEVERE]     at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    23:12:01 [SEVERE]     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
    23:12:01 [SEVERE]     at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:706)
    23:12:01 [SEVERE]     at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:678)
    23:12:01 [SEVERE]     at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:671)
    23:12:01 [SEVERE]     at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    23:12:01 [SEVERE]     at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    23:12:01 [SEVERE]     at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    23:12:01 [SEVERE]     at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    23:12:01 [SEVERE]     at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399)
    23:12:01 [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
    23:12:01 [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    Thank you

    EDIT: rTriggers has the nifty equivalent of runas(console,command) - will this ever be possible with CH?
     
  6. Offline

    Connor Griffin

    Try this:
    /test = if(array_contains(pgroup(player()), admin), run(/save-all))
     
    opoq likes this.
  7. Offline

    sk89q

  8. Offline

    Joy

  9. Offline

    kyle921

    I'm sure I must be doing something stupid here, but I've got a permissions issue. First of all, here's my config:

    Code:
    quiz:/quiz = >>>
        #if(array_contains(pgroup(player()),'Builder'),g(
        #    msg(concat(color(RED),'You do not have permission to run that command.'))
        #    die())
        #)
        #if(array_contains(pgroup(player()),'Default'),g(
        #    msg(concat(color(RED),'You do not have permission to run that command.'))
        #    die())
        #)
        assign(@r,rand(0,5))
        if(equals(@r,0),g(
            broadcast(concat(color(DARK_GREEN),'What should you do when entering a community build site?'))
            msg(color(YELLOW),'Ask for permission first.'))
        )
        if(equals(@r,1),g(
            broadcast(concat(color(DARK_GREEN),'How can you ask for a promotion?')),
            msg(color(YELLOW),'Trick question; you shouldn\'t.'))
        )
        if(equals(@r,2),g(
            broadcast(concat(color(DARK_GREEN),'What do the rules say about holes and towers?')),
            msg(color(YELLOW),'Don\'t build them.'))
        )
        if(equals(@r,3),g(
            broadcast(concat(color(DARK_GREEN),'What is rule number two?')),
            msg(color(YELLOW),'No griefing!'))
        )
        if(equals(@r,4),g(
            broadcast(concat(color(DARK_GREEN),'Whose actions are you responsible for?')),
            msg(color(YELLOW),'Those of anyone on your account.'))
        )
    <<<
    
    promote:/promote $name = runas(~op, concat('/manuadd ', $name ' Builder'))
    Anyway, I want to give ch.alias.promote and ch.alias.quiz to VIPs and up on my server, but if I do that, Builders and Defaults get "You do not have permission to use the color function." for /quiz and "You do not have permission to use the runas function." for /promote. I'd really like to either get a basic "You don't have permission for that command." or "You don't have permission to use <command>." Is there any way to do this without coding it myself, as in the commented section above?
     
  10. Offline

    Kevin Robbens

    Great, been looking for this!

    One thing,
    I had
    Code:
    /h [$p] = /home $p
    It did work until i restarted the server.
    Only could use /h <player>, not /h.
    Restarted several times, didn't work anymore.

    Had to change it to
    Code:
    /h = /home
    /h $p = /home $p
    Also,
    Code:
    /h $ = /home $
    Didn't work anymore.

    It should work with /h aswell, right? I'm pretty sure it did work before.
     
  11. Offline

    wraithguard01

    Haha, well, the important thing is, it's working now :)
    :confused: Do you know what was done to trigger it?

    You can give the the other groups negative permission to run the command. I think that should work. Try doing something like this in your Permissions yml file:

    Code:
    - -commandhelper.alias.quiz
    
    Yep. It did. I broke it :(

    It's fixed in the newest version, which you can download now: http://build.sk89q.com/job/CommandH...ifact/target/commandhelper-3.1.2-SNAPSHOT.jar or wait until we can get around to making an official build.
     
  12. Offline

    Scandragon

    I'm almost worry to say this, wraith.. But it seems the 3.1.2 snapshot is broken
    With 3.1.1 this command worked perfectly
    Code:
    /slap [$player='himself'] = /me slaps $player around a bit with a large trout
    However, with 3.1.2, /slap gives unknown command, while /slap scandragon works..
    (and no comments on me being old, please..)
     
  13. Offline

    MG127

    does someone know how to make a comfortable promote with permissions3 ?
    i tried but on this i get no response
    Code:
    /promote $player $group [$wld='world'] = /pr $player concat('w:',$wld) promote Guest concat('w:',$wld) $group
    or doesn't the default-group (if the player has no group) count as a group so that promoting along a track doesn't work?
    if i type it manual in the chat the response is that the user has been promoted, but he is still in the same group :/

    and this doesn't work also:
    Code:
    /perm-add $player $group [$wld='world'] = /pr $player concat('w:',$wld) parents add &group $wld
    if i type it manual in the chat, it works fine

    CB935, CH3.1.0, Permissions3.1.5
     
  14. Offline

    Kevin Robbens

  15. Offline

    wraithguard01

    Hmm, I may or may not have fixed it just now, while working on another issue, but try updating to the newest dev build, and it'll work. One thing to note though, when running /me, you WILL get an unknown console command warning, but the command runs anyways. This is a bukkit bug, not CH.

    Try updating to the newest dev build as well, http://build.sk89q.com/job/CommandH...ifact/target/commandhelper-3.1.2-SNAPSHOT.jar, I think your problem is with optional arguments being matched incorrectly. Once you update, if it still doesn't work, let me know.
     
  16. Offline

    Scandragon

    Well, this one worked fine on 3.1.1, the problem only started on the latest dev build ;)
    And no.. I do not get an unknown command when supplying the optional argument, and the command isn't performed when I don't supply it

    Not a major problem (here) I should say.. It takes more than a few bugs to make me shout at devs :p
    What some people forget is, that they're using plugins that are still under development, on a third party server wrapper, for a game that's in beta.. Are they expecting a maglev train for the cost of a spare bicycle tire?
     
  17. Offline

    kyle921

    That just gives the same "You don't have permission to use the <function> function." message, so I'm having to do group checks within my scripts for now. :( Any hope on fixing this soon?
     
  18. Offline

    enelar

    how to create:
    /me fall assleep => ivan fall assleep
    for any words count.
     
  19. Offline

    Taranis01

    is there a way to use a "@playername text" instead of "/tell playername text"?
    i already tried "@$player $ = /tell $player $", but i get errors, it looks like commandhelper is only providing aliasis using "/" ? :(
    yes, i know there is a plugin for messaging player with @, but i dont want to use another plugin. Also i would use other commands with "@" or "." or "+"
     
  20. Offline

    Kotoa

    Ok I give up, been reading the wiki for a couple of hours now I just can't figure out how to do this... at the moment I have:
    /promote $ = /pr $ w:world promote t:track
    The command works fine if I type /pr [name] w:world promote t:track, but if I type /promote [name] it says I performed a syntax error. tried multiple different methods, am I missing something obvious?

    ... Think I figured it out, I don't think the plugin is sending the colons, is there any way to force them?
    Figured it out, have to put 's around the parts with colons. Can't believe how much time I wasted because of that.. xD
     
  21. Offline

    Taranis01

    @Kotoa
    there is a value for playernames, use "$player" instead of just "$"
    (dont know if thats the reason, but maybe...)
     
  22. Offline

    Kotoa

    It works fine with just $, it was because the "w:world" and "t:track" weren't within quotes, so it wasn't sending the colons, thanks anyway. :)
     
  23. Offline

    ray0911

    I updated to 3.1.2 and /rules does work now but it does not give me my Rules.txt. Also none of the commands in global-aliases.txt are working

    global-aliases.txt
    Code:
    :/rules
    @read Rules.txt
    
    :/help
    @read Help.txt
    
    :/donate
    @read Donate.txt
    
    :/playersonline
    /who
    
    :/website
    @read Website.txt
    
    :/craftbook
    @read Craftbook.txt
    
    :/teamspeak
    @read Teamspeak.txt
    
    :/lockette
    @read Lockette.txt
    
    :/Craftbook
    @read Craftbook.txt
    
    :/resinfo
    @read Resinfo.txt
    
    Rules.txt
    Code:
    Thing Hunter's Rules
    1. No Griefing
    2. No building on others buildings
    3. IF YOU NEED HELP. SPEAK TO A MOD FIRST BEFORE YOU SPEAK TO AN ADMIN.
    4. Admins have final say
    5. Move away from spawn to build > 100 blocks
    6. No Hacks. Period. Do not place REDSTONE with out MOD/ADMIN approval!
    7. You must report any exploits or you will be considered an accomplice.
    8. If you get heavily griefed, an admin may roll back the area (Admin Discretion)
    9. No provocative structures. Admins will deside what is or is not provocative.
    10. We will not even consider moving anything unless you are atleast Citizen.
    11. Banned? You must appeal ONLY on the forum at [URL='http://www.thinghunter.com']www.thinghunter.com[/URL]
    
    
    
    
    Using 935
     
  24. Offline

    xlilcasper

    Getting some errors with 3.1.1 on build 953. Updated to the posted 3.1.2 build to see if that would fix it. Same errors. I can post more logs and info if requested.

    Show Spoiler

    Code:
    2011-07-03 16:42:39 [SEVERE] null
    java.io.InvalidClassException: com.laytonsmith.aliasengine.Constructs.Construct; local class incompatible: stream classdesc serialVersionUID = 4613233606537007885, local class serialVersionUID = 7845685218218885669
        at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
        at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
        at java.io.ObjectInputStream.readClassDesc(Unknown Source)
        at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
        at java.io.ObjectInputStream.readClassDesc(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at java.util.HashMap.readObject(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at com.laytonsmith.PureUtilities.Persistance.load(Persistance.java:65)
        at com.laytonsmith.PureUtilities.Persistance.getNamespaceValues(Persistance.java:258)
        at com.laytonsmith.aliasengine.User.getAliasesAsArray(User.java:76)
        at com.sk89q.commandhelper.CommandHelperListener.runAlias(CommandHelperListener.java:83)
        at com.sk89q.commandhelper.CommandHelperListener.onPlayerCommandPreprocess(CommandHelperListener.java:132)
        at org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.java:272)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:704)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:676)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:669)
        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:84)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
     
  25. Offline

    Sandbird

    I would like to report something....
    CommandHelper plugin, if its working together with NoCheat plugin (link) and with the latest 953 version, then a weird bug happens...You can make pistons ONLY ONCE. If you log in, make a piston then stop and start again the server and you try again to make pistons you'll see that you cant ! And not only that....it messes up your map files also...so you have to restore.
    I contacted the NoCheat author thinking its his plugin that does it and he told me this (read here).

    And also this (link) and (link).

    So can you please do this suggestion in the config.yml so i dont have to do it manually from now on?

    Everyone who was these 2 plugins together will have this problem.
    Thanks
     
  26. Offline

    ray0911

    Same issue.. Please help...
     
  27. Offline

    beowulf

    Hey, I'm kinda new at this, so if there's someplace else I should ask please let me know. I'm trying to use CommandHelper to determine the textual contents of a sign (if the block the player is looking at is a sign). Is this possible?
     
  28. Offline

    Connor Griffin

    @beowulf Currently this is not possible, although the developer of this plugin is looking to add more hooks into environments for future versions.
    This looks like stuff that only works for 2.x, or at least I think.
     
  29. Offline

    beowulf

    Connor, thanks for taking the time to reply - I appreciate it!
     
  30. Offline

    wraithguard01

    The next version will have much more simplified permission handling :D

    Hmm, I'm not sure I understand your question, but I think you want to try the Final Variable: /me $ = msg(player() 'fell asleep')

    There isn't currently a way to do this. In order to do this, I would have to hook into the chat events, as running @command wouldn't actually generate a command event. If more people request this functionality, I could add it though.

    Upgrading from 2.* to 3.* is essentially like using a completely different plugin. All the same functionality is there, but it is completely different. Unfortunately, sk89q isn't supporting 2.* anymore. Check the wiki for information on how to use 3.*.

    Done!
    Hmm, no, not yet, but it's on the todo list. Currently, the most you could do is know that it is a sign, but not what it's text is. Keep checking back though!
     
  31. Offline

    Simon Welker

    I got a bug on a 953 server, apparently :(
    I am new to this, and I defined a command /tw to set weather, thunder, and time (it's all CommandBook cmds, I think) with four different options: worst, bad, english and good. I did it like this:

    Code:
    /tw [$opt='good'] [$world='SmurphCraft'] [$dur=-1] = /time $world if(equals($opt, 'worst'), 22, if(equals($opt, 'bad'), 22, 8)) \
    /weather if(equals($opt, 'good'), 'sunny', 'stormy') $dur $world \
    /thunder if(equals($opt, 'worst'), 'on', 'off') $dur $world
    I dunno if this code is optimized as-is, but I don't care at the moment because it works-- but only when I give all arguments. I can use
    Code:
    /tw good SmurphCraft -1
    and it will do everything I defined, but if I leave out any argument
    Code:
    /tw good SmurphCraft
    /tw good
    /tw
    , it just gives me the stupid 'Unknown console command. Type "help" for help.'

    Same thing with the "Better tp" Command on the sk89q Wiki example config. :/
    Any idea what the issue could be?

    Great work though, I like the logical and easy notation! Keep it up!
    Cheers, Simon
     

Share This Page