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

    Denney

    Can someone tell me what I'm doing wrong here. I must be doing something stupid.

    In my config.txt, I have the line:

    /test $ = /me $

    When the server loads, it loads the alias and when I run it in game, the console says:

    CH: Running original command ----> /test bangs head on wall

    But nothing comes up in chat.
     
  3. Offline

    pudd1nG

    I am looking for something similar to the code below. What I've pasted is an admin chat, which works great.

    Any chance somebody can modify this to send to the Admins group as well as another group, say...Member.

    Basically I want a private chat between 2 groups.

    Code:
    ### Group Specific Broadcast
    /h $message [$] = >>>
    # Stop duplicate broadcasts when you are the one sending the command to your own group.
    if(equals(Admins, 'Admins'), '',
    if(equals(Admins, 'All'),'',
    msg(concat('&2[Group Broadcast] &e' sconcat($message $)))))
    #Send the command to the group specified.
    foreach(
    all_players(), @player, g(
    assign(@pGroup, array_get(pgroup(@player), 0))
    if(equals(Admins, 'All'),
    tmsg(@player, concat(color('white'),player() sconcat(color('red'),$message $))),
    if(equals(@pGroup, Admins),
    tmsg(@player, concat(color('white'),player() sconcat(color('red'),$message $))),
    ))))
    <<<
     
  4. Offline

    MG127

    everything seems to be ok, but non of the aliases work, allways unknown command

    Code:
    [INFO] CommandHelper 3.0.2 enabled
    [INFO] CommandHelper: Permissions plugin detected! Using Permissions plugin for permissions.
    [INFO] CommandHelper: Loaded function "array_contains"
    [INFO] CommandHelper: Loaded function "array_get"
    ...
    [INFO] CommandHelper: Loaded function "lightning"
    [INFO] CommandHelper: Loaded function "storm"
    [SEVERE] Notice: Defined variable $stadt is unused near line 30
    [SEVERE] Notice: Defined variable $gruppe is unused near line 33
    [SEVERE] Notice: Defined variable $gruppe is unused near line 47
    [INFO] Config file compiled sucessfully, with 14 alias(es) defined.
    Code:
    /pay $spieler $betrag = /money pay $spieler $betrag
    ###
    /dhide = /dynmap hide
    ###
    /dshow = /dynmap show
    ###
    /lighter = /item 259 1
    ###
    /a = /a1
    ###
    /a1 = /god \
    /fly \
    // \
    /lc spy \
    /dynmap hide
    ###
    /a2 = /ungod \
    /fly \
    // \
    /lc spy \
    /dynmap show
    ###
    /protect $spieler $region = /region define $region $spieler \
    /region flag $region mob-damage deny \
    /region flag $region creeper-explosion deny \
    /region flag $region tnt deny \
    /region flag $region deny-spawn Sheep Pig Cow Chicken Zombie Creeper Skeleton Ghast Slime deny \
    /region flag $region lavaflow deny
    ###
    /protectb $spieler $region $stadt = /protect $spieler $region \
    /region setparent $region $stadt
    ###
    /promote $spieler $gruppe = /perm-del $spieler \
    /perm-add $spieler $gruppe \
    /setwarp temp_promote \
    /warp $gruppe \
    /sethome $spieler \
    /warp temp_promote
    ###
    /chunrestore = //pos1 \
    //pos2 \
    //chunk \
    //copy \
    /chunkregenerate \
    //paste
    ###
    /modify $spieler $gruppe = /perm-del $spieler \
    /perm-add $spieler $gruppe
    ###
    /thor $p = /mn lightning $p
    ###
    /bay = //pos1 \
    //pos2 \
    //sphere '0' '15'\
    //cyl '12' '13'
    at the last alias it didnt work with the numbers only, there was allways "unexpected newline" 2 lines after end of file
     
  5. Offline

    Connor Griffin

    I know you said that admin chat works great, but wouldn't something like this work a bit better for that purpose? There's a lot of messy, unused code in the posted command.
    Code:
    ### Admin Chat System
    /a $message [$] = >>>
        foreach(all_players(), @player,
            g(
                assign(@pGroup, array_get(pgroup(@player), 0))
                if(equals(@pGroup, Admins),
                    tmsg(@player, concat(
                        color(dark_red), player(), ' ',
                        color(white), sconcat($message $))
                    )
                )
            )
        )
    <<<

    The following code would be a type of chat channel, where only group 'Admins' and group 'Member' will see the chat messages.
    Code:
    ### Group PM System
    /h $message [$] = >>>
        foreach(all_players(), @player,
            g(
                assign(@pGroup, array_get(pgroup(@player), 0))
                if(equals(@pGroup, Admins),
                    tmsg(@player, concat(
                        color(white), player(), ' ',
                        color(red), sconcat($message $))
                    )
                )
                if(equals(@pGroup, Member),
                    tmsg(@player, concat(
                        color(white), player(), ' ',
                        color(red), sconcat($message $))
                    )
                )
            )
        )
    <<<
     
    pudd1nG likes this.
  6. Offline

    wraithguard01

    Oops, I'll fix that in the next update.

    Check your console output to see if you have compiler errors elsewhere in your script. If so, the entire script will stop working. (Btw, compiler errors will be isolated to make just that one command fail in the next version)

    Otherwise, I'm not exactly sure what to tell you, unless /me whatever doesn't work either.

    I can't get this to duplicate on my machine :/
     
  7. Offline

    dslip

    Anyone able to help me finish a script?

    This outputs in a msg exactly what I want it to do (eg /give item amount player or /money grant player amnt) however i cannot actually get it to 'execute' the command? eg it doesnt give money or an item. What am I doing wrong ?
    Code:
    /prize $player = >>>
        #Initialize the reward array
        assign(@moneyoritem,rand(1))
        assign(@reward,array(18,302,303,304,305,322,327,333,352,354,357,0))
        assign(@reward_id,rand(array_size(@reward)))
        assign(@item,array_get(@reward,@reward_id))
        assign(@multi,add(rand(5),1))
        if(equals(@item,0),
            g(
              assign(@cmd,concat('/money grant ',$player,' 1000'))
              msg(@cmd)
              run(@cmd)
            ),
            g(
              assign(@cmd,concat('/i ',@item,' ',@multi,' ',$player))
              msg(@cmd)
              run(@cmd)
            )
            )
    <<<
    
     
  8. Offline

    MG127

    even on my testserver on windows i get the same, no error and no alias works.

    plugins on my testserver: BackupPlugin, CommandHelper, DefaultCommands, dynmap, iChat, iConomy, ItemCraft, LocalShops, MCDocs, Permissions, WorldEdit, WorldGuard

    my live server on a linux machine has 70 plugins [creeper]
     
  9. Offline

    Connor Griffin

    I can never seem to get run() to work for me. If needed, I would just do runas(player(), @cmd)
     
  10. Offline

    dslip

  11. Offline

    Connor Griffin

    I can't seem to get or() to work inside an if(equals()), and I don't know why, maybe I'm doing it wrong. Here's how I would be using it.
    Code:
    assign(@pGroup, array_get(pgroup(@player), 0))
    if(equals(@pGroup, or('Admin', 'Moderator', 'VIP'))
        ...
    )
    I would usually throw this into a foreach(all_players, @player, ...) to do something like create an array of all players on my server in any of those three groups, then pull whatever user is at index 0 in the array. This is helpful in a runas() where ~op doesn't have sufficient permission to run something, but players in certain groups do. I would assume the or() would work in the way it does, where @pGroup has to be equal to one of those three things, and I seem to recall it working that way at one point or another.

    One other thing, I is there any way to use parenthesis inside a string? Whenever I try to do this, only the commands before I use it get recognized, leaving me with a 4-command config file instead of 28.
     
  12. Offline

    MG127

    needs update for cb803 ?
    i made a clean, new server for testing commandhelper to get the alias working, but now comes this ...
    Show Spoiler

    only with commandhelper
    Code:
    2011-05-31 15:27:03 [INFO] Starting minecraft server version Beta 1.5_02
    2011-05-31 15:27:03 [INFO] Loading properties
    2011-05-31 15:27:03 [INFO] Starting Minecraft server on *:25565
    2011-05-31 15:27:03 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-753-g34e310c-b803jnks (MC: 1.5_02)
    2011-05-31 15:27:03 [INFO] Preparing level "world"
    2011-05-31 15:27:03 [INFO] Preparing start region
    2011-05-31 15:27:03 [INFO] CommandHelper 3.0.2 enabled
    2011-05-31 15:27:03 [SEVERE] Error occurred while enabling CommandHelper v3.0.2 (Is it up to date?): com/sk89q/bukkit/migration/PermissionsResolverManager
    java.lang.NoClassDefFoundError: com/sk89q/bukkit/migration/PermissionsResolverManager
        at com.sk89q.commandhelper.CommandHelperPlugin.onEnable(CommandHelperPlugin.java:72)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:750)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:132)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:110)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:265)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.ClassNotFoundException: com.sk89q.bukkit.migration.PermissionsResolverManager
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 11 more
    2011-05-31 15:27:03 [INFO] Done (0,077s)! For help, type "help" or "?"
    
    with permissions 2.7.4
    Code:
    2011-05-31 15:27:47 [INFO] Starting minecraft server version Beta 1.5_02
    2011-05-31 15:27:47 [INFO] Loading properties
    2011-05-31 15:27:47 [INFO] Starting Minecraft server on *:25565
    2011-05-31 15:27:47 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-753-g34e310c-b803jnks (MC: 1.5_02)
    2011-05-31 15:27:47 [INFO] Preparing level "world"
    2011-05-31 15:27:47 [INFO] Preparing start region
    2011-05-31 15:27:48 [INFO] [Permissions] (Phoenix) was Initialized.
    2011-05-31 15:27:48 [INFO] CommandHelper 3.0.2 enabled
    2011-05-31 15:27:48 [SEVERE] Error occurred while enabling CommandHelper v3.0.2 (Is it up to date?): com/sk89q/bukkit/migration/PermissionsResolverManager
    java.lang.NoClassDefFoundError: com/sk89q/bukkit/migration/PermissionsResolverManager
        at com.sk89q.commandhelper.CommandHelperPlugin.onEnable(CommandHelperPlugin.java:72)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:750)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:132)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:110)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:265)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.ClassNotFoundException: com.sk89q.bukkit.migration.PermissionsResolverManager
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 11 more
    2011-05-31 15:27:48 [INFO] [Permissions] version [2.7.4] (Phoenix)  loaded
    2011-05-31 15:27:48 [INFO] Done (0,105s)! For help, type "help" or "?"
    
    with permissions 3.0.6
    Code:
    2011-05-31 15:29:00 [INFO] Starting minecraft server version Beta 1.5_02
    2011-05-31 15:29:00 [INFO] Loading properties
    2011-05-31 15:29:00 [INFO] Starting Minecraft server on *:25565
    2011-05-31 15:29:00 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-753-g34e310c-b803jnks (MC: 1.5_02)
    2011-05-31 15:29:00 [INFO] Preparing level "world"
    2011-05-31 15:29:00 [INFO] Preparing start region
    2011-05-31 15:29:01 [SEVERE] [Permissions] storageconfig.yml is not a file.
    2011-05-31 15:29:01 [SEVERE] [Permissions] storageconfig.yml cannot be read.
    2011-05-31 15:29:01 [INFO] [Permissions] Creating storageconfig.yml.
    2011-05-31 15:29:01 [INFO] [Permissions] (Yeti) was initialized.
    2011-05-31 15:29:01 [INFO] CommandHelper 3.0.2 enabled
    2011-05-31 15:29:01 [SEVERE] Error occurred while enabling CommandHelper v3.0.2 (Is it up to date?): com/sk89q/bukkit/migration/PermissionsResolverManager
    java.lang.NoClassDefFoundError: com/sk89q/bukkit/migration/PermissionsResolverManager
        at com.sk89q.commandhelper.CommandHelperPlugin.onEnable(CommandHelperPlugin.java:72)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:750)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:132)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:110)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:265)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.ClassNotFoundException: com.sk89q.bukkit.migration.PermissionsResolverManager
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 11 more
    2011-05-31 15:29:01 [INFO] [Permissions] version [3.0.6] (Yeti)  loaded
    2011-05-31 15:29:01 [INFO] Done (0,079s)! For help, type "help" or "?"
    
     
  13. Offline

    PsychoNecrosis

    It's permissions.

    Works on 803.
     
  14. Offline

    Jeyge

    It sure isn't in the OP but this plugin does have a dependency on WorldEdit. Give it a try with WorldEdit and see if the errors are gone.
     
  15. Offline

    MG127

    thx, works fine, now i have to test all my 66 plugins wich one interferrs with the aliases ("unknown command" on all aliasses)
    Show Spoiler

    • AfkBooter
    • ArrowWall
    • AssignPermissions
    • BackupPlugin
    • bCoolDown
    • BedRespawn
    • BigBrother
    • ChairCraft
    • ChunkRegnerate
    • CommandHelper
    • CommandSigns
    • CraftBook
    • CreativStick
    • DefaultCommands
    • DyeWool
    • dynmap
    • ExtendDay
    • Gastronomic
    • groupPvP
    • HeroBounty
    • HeroicDeath
    • iChat
    • iConomy
    • InvinciWolf
    • Jail
    • Landmarks
    • LocalChat
    • LocalShops
    • Lockette
    • LoginQueue
    • Lottery
    • MagicCarpet
    • mcbans
    • MCDocs
    • MCRestartToolKit
    • ModTRS
    • MotherNature
    • MultiVerse
    • NoCheat
    • NoDrop
    • NoFarm
    • (npcx)**
    • nSpleef
    • PantingSwitch
    • Permissions
    • PlugMan
    • PvPReward
    • PwnCraft
    • SheepFeed
    • SignColours
    • Snowballz
    • SpawnMob
    • StarterKit
    • StealthLogin
    • TentThis
    • teslacoil
    • Tomb
    • VanishNoPickup
    • Vegetation
    • WhoAreYou
    • WolfNames
    • WorldBorder
    • WorldEdit
    • WorldGuard
    • WormholeXTreme


    edit: got a hit on the first target: DefaultCommands
    either you or vildaberper have to make their plugin compatibel to each other
    i realy like to have the aliases from commandhelper but cant live without defaultcommands
     
  16. Offline

    HawnSolo

    Let's see how this works on 818
     
  17. Offline

    sk89q

    Version 3.1.0

    Thank waithguard01 for his work on this release.

    Download: http://www.sk89q.com/projects/commandhelper/
     
  18. Offline

    hittingray

    Hi! Really nooby at this kind of scripting so any help I can get would be greatly appreciated!

    I need two aliases. I know there has to be something to define what each variable is, but I don't know how to get this to work.

    Code:
    /groupadd $user $group = /pr $user w:world parents add $group
    /groupremove $user $group = /pr $user w:world parents remove $group
    
     
  19. Offline

    dragonhib

    yeah so good !!! many new functions that I was waiting for !! Thanks :D
     
  20. Offline

    basman93

    optional variable not working


    try this ;-)
    Code:
    /groupadd $user $group = concat('/pr ', $user, ' w:world parents add ', $group)
    
    /groupremove $user $group = concat('/pr ', $user, ' w:world parents remove ', $group)
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 9, 2016
  21. Offline

    Connor Griffin

    @hittingray

    Code:
    /groupadd $user $group = concat('/pr ', $user, ' w:world parents add ', $group)
    /groupremove $user $group = concat('/pr ', $user, ' w:world parents remove ', $group)

    The reason for this is because you can label a command for use with permissions using a colon, so you have to turn it into a string so that CH doesn't think it is a label specifier.

     
  22. Offline

    xlilcasper

    Are the added time functions useable for delays or does it block execution of other commands and such while it is in a for loop? Could I loop until now - then > 60 or is this going to hang my server for 60 seconds?
     
  23. Offline

    anon

    halp!

    Code:
    09:49:19 [SEVERE] An error occured in the CommandHelper plugin:
     null[com.laytonsmith.aliasengine.Script.match(Script.java:282),
     com.laytonsmith.aliasengine.AliasCore.alias(AliasCore.java:118),
     com.sk89q.commandhelper.CommandHelperListener.runAlias(CommandHelperListener.java:88),
     com.sk89q.commandhelper.CommandHelperListener.onPlayerCommandPreprocess(CommandHelperListener.java:132),
     org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.java:271),
     org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58),
     org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310),
     net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:712),
     net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:684),
     net.minecraft.server.NetServerHandler.a(NetServerHandler.java:677),
     net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32),
     net.minecraft.server.NetworkManager.b(NetworkManager.java:217),
     net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75),
     net.minecraft.server.NetworkListenThread.a(SourceFile:105),
     net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399),
     net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309),
     net.minecraft.server.ThreadServerApplication.run(SourceFile:422)]
    
     
  24. Offline

    Oscarius

    I need some help with a quite simple command:

    If I write: "/promote Player Group world1"
    I want to do the command: "/pr Player w:world1 promote Group oneTrack"

    But if I write: "/promote Player Group world2"
    I want to do the command: "/pr Player w:world2 promote Group twoTrack"


    I tried understanding the if parameter, but I didn't get it to work.
    Thanks!
     
  25. Offline

    DeanDip

    Code:
    /promote $player $group $world = >>>
         if(equals($world, 'world1'), assign(@track, 'oneTrack'), assign(@track, 'twoTrack'))
         run(concat('pr ', $player, ' w:', $world, ' promote ', $group, ' ', @track))
    <<<
    Hopefully that does what you want.
     
    Oscarius likes this.
  26. Offline

    Oscarius

    Thank you very much.


    Any idea why this one won't work? Is it because of the : maybe?
    Code:
    /builder $player = >>>
    /pr $player w:world parents add Builder
    /pr $player w:rpg parents add Nomad
    <<<
     
  27. Offline

    DeanDip

    It is because of the : If you want a colon to be used for something other than giving a label, it needs to be inside a string (inside single quotes like 'w:world')
    edit: Oh I missed that you don't have a \ after the end of the first command too. If multiple commands are used, a \ is needed after the end of each one except the last one.
     
    Oscarius likes this.
  28. Offline

    Oscarius

    Thank you very much!
     
  29. Offline

    Swadon

    Hello,
    I have this error on my console :(
    CB Build : #818
    And this doestn't work :
    Thank You.
     
  30. Offline

    Denney

    Just an update on my /test $ = /me $ issue... updating to 3.1.0 fixed the problem and it works fine now. I have NO IDEA why it wouldn't work before. So yeah, awesome plugin!
     
  31. Offline

    Joy

    We had a crash this morning caused by CH. A user used /.r and this got him in an infinite loop activating an mcMMO ability.

    First of all, how do I even disable that feature? None of my players has CH permission nodes...

    Ideally, a fix for this.
     

Share This Page