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

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

  1. Offline


    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] 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.


    Pinoyskii, DHLF, beleg and 6 others like this.
  2. Offline


    SK requested I re-post my suggestion in here, so:
    How about something to slow down processing of commands?

    In the sense of:

    -wait 2

    For a two second pause before executing command 2?
  3. Offline


    I would like to see a delay function added in. Something along the line of Delay(X) where X is either milliseconds or server ticks. It would wait until the delay was done before moving to the next command.
  4. Offline

    Connor Griffin

    Edit: Nevermind...
  5. Offline


    I'm using /alias, not modifying the .txt file. I don't care about global aliases.
    I'm just trying to use the alias command like this: /alias /fw /fixwater 40 - which works fine in CommandHelper 2.x
  6. Offline


    took the die off and it still does not work, he is the line as it is now
    Code (Text):
    2. /automap $on = /resident set mode if(equals($on, 'on'), 'map'), if(equals($on, 'off'), 'none')
    In the menu mod I am running I had to change the plugin code a bit to send the /resident command as chat instead of as a command. I can get the exact changes if needed. Do you think this could be an issue? Towny not using the proper way to listen for commands?

    /clearinventory seems to work now, thanks!
  7. CbutD just updated CH for me and this now happens on startup:
    Code (Text):
    1. 08:26:10 [INFO] CommandHelper 5-wiz enabled
    2. 08:26:10 [SEVERE] com/sk89q/bukkit/migration/PermissionsResolverManager loading CommandHelper v5-wiz (Is it up to date?)
    3. java.lang.NoClassDefFoundError: com/sk89q/bukkit/migration/PermissionsResolverManager
    4.         at com.sk89q.commandhelper.CommandHelperPlugin.onEnable(
    5.         at
    6.         at
    7.         at org.bukkit.plugin.SimplePluginManager.enablePlugin(
    8.         at org.bukkit.craftbukkit.CraftServer.loadPlugin(
    9.         at org.bukkit.craftbukkit.CraftServer.loadPlugins(
    10.         at net.minecraft.server.MinecraftServer.e(
    11.         at net.minecraft.server.MinecraftServer.a(
    12.         at net.minecraft.server.MinecraftServer.init(
    13.         at
    14.         at
    15. Caused by: java.lang.ClassNotFoundException: com.sk89q.bukkit.migration.PermissionsResolverManager
    16.         at$
    17.         at Method)
    18.         at
    19.         at
    20.         at
    21.         at java.lang.ClassLoader.loadClass(
    22.         at java.lang.ClassLoader.loadClass(
    23.         ... 11 more
    I don't have permissions installed, but this looks like like a build error to me.
  8. i keep trying to do simple aliases but keep getting "unexpected newline"
  9. Offline


    do u have anything in ur config?
  10. yes, a few that i put in manually, but when i try /alias it doesn't work
  11. Offline


    r u putting something like is in /alias /aliasname = /realcommand ??
  12. Offline


  13. Offline


    Cant get 3.0.1 to work:

    2011-05-05 13:26:44 [INFO] CommandHelper 3.0.1 enabled
    2011-05-05 13:26:44 [INFO] CommandHelper: Permissions plugin detected! Using Permissions plugin for permissions.
    2011-05-05 13:26:44 [SEVERE] java.lang.NullPointerException
    2011-05-05 13:26:44 [SEVERE] at com.laytonsmith.aliasengine.AliasCore.getStringResource(
    2011-05-05 13:26:44 [SEVERE] at com.laytonsmith.aliasengine.AliasCore.reload(
    2011-05-05 13:26:44 [SEVERE] at com.laytonsmith.aliasengine.AliasCore.<init>(
    2011-05-05 13:26:44 [SEVERE] at com.sk89q.commandhelper.CommandHelperPlugin.onEnable(
    2011-05-05 13:26:44 [SEVERE] at
    2011-05-05 13:26:44 [SEVERE] at
    2011-05-05 13:26:44 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(
    2011-05-05 13:26:44 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(
    2011-05-05 13:26:44 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugins(
    2011-05-05 13:26:44 [SEVERE] at net.minecraft.server.MinecraftServer.e(
    2011-05-05 13:26:44 [SEVERE] at net.minecraft.server.MinecraftServer.a(
    2011-05-05 13:26:44 [SEVERE] at net.minecraft.server.MinecraftServer.init(
    2011-05-05 13:26:44 [SEVERE] at
    2011-05-05 13:26:44 [SEVERE] at
    2011-05-05 13:26:44 [SEVERE] CommandHelper: Unable to load working config file, aborting plugin operation

    It just seems to generate a config.txt on 0 bytes

    And a preferences.txt with:

    #Whether or not to display warnings in the console, while compiling
    #Whether or not to display the original command in the console
    #Whether or not to display debug information in the console
  14. ahh ok thanks.

    next problem, i tried making some global aliases by typing them in manually, but it seems that anything past the 4th script isn't being read.
    i know it's not a problem with the script because if i put it at the top of the list it works fine but the (now #5) script does not.

    and /viewalias comes up with unknown console command.
  15. Offline


    u maybe did somthing wrong in the config file

    for /viewalais. have u update the plugin?
  16. Offline

    Connor Griffin

    Can you give a few examples on how to use ivariables, and how to work with arrays?
  17. Offline


    how do i use tmsg() to send the message to all users?
  18. Offline


    It's easier to use
    Code (Text):
    1. broadcast(<Message>)
    which is basically equivalent to
    Code (Text):
    1. foreach(all_players(), @p, tmsg(@p, <Message>))
    where <Message> is the sent message.

    Assign a string ivar where we replace a word with the player name and then display it:
    Code (Text):
    2. /hello = >>>
    3.  assign( @hello, 'Hello World' )
    4.  assign( @hello, replace(@hello, 'World', player()) )
    5.  msg(@hello)
    6.  <<<
    Make an empty array, populate it with the arguments in reverse order and then make a space separated string out of it which is sent back:
    Code (Text):
    2. /backwords [$] = >>>
    3. if(equals($, ''),
    4.     msg('§cUsage: /backwords <word> [[word2]...]'),
    5.     g(
    6.         assign(@resultarray, array()),
    7.         for(assign(@i, array_size(parse_args($))), gt(@i, 0), dec(@i),
    8.             array_push(@resultarray, array_get(parse_args($), subtract(@i, 1)))
    9.         ),
    10.         foreach(
    11.             @resultarray, @resultindex, assign(@result, sconcat(@result, @resultindex))
    12.         ),
    13.         msg(trim(@result))
    14.     )
    15. )
    16. <<<
    Is Notch on the server?

    Code (Text):
    1. /notch = if(array_contains(all_players(), 'Notch'), msg('§aNotch is on this server! :D'), msg('§cNotch is not on this server. :('))
  19. i have the same, but i have permissions installed.
    Code (Text):
    2. 2011-05-06 21:35:38 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-706-gf53e007-b740jnks (MC: 1.5_02)
    3. 2011-05-06 21:35:38 [INFO] Preparing level "world"
    4. 2011-05-06 21:35:38 [INFO] Preparing start region
    5. 2011-05-06 21:35:39 [INFO] [Permissions] (Phoenix) was Initialized.
    6. 2011-05-06 21:35:39 [INFO] CommandHelper 3.0.1 enabled
    7. 2011-05-06 21:35:39 [SEVERE] com/sk89q/bukkit/migration/PermissionsResolverManager loading CommandHelper v3.0.1 (Is it up to date?)
    8. java.lang.NoClassDefFoundError: com/sk89q/bukkit/migration/PermissionsResolverManager
    9.     at com.sk89q.commandhelper.CommandHelperPlugin.onEnable(
    10.     at
    11.     at
    12.     at org.bukkit.plugin.SimplePluginManager.enablePlugin(
    13.     at org.bukkit.craftbukkit.CraftServer.loadPlugin(
    14.     at org.bukkit.craftbukkit.CraftServer.loadPlugins(
    15.     at net.minecraft.server.MinecraftServer.e(
    16.     at net.minecraft.server.MinecraftServer.a(
    17.     at net.minecraft.server.MinecraftServer.init(
    18.     at
    19.     at
    20. Caused by: java.lang.ClassNotFoundException: com.sk89q.bukkit.migration.PermissionsResolverManager
    21.     at$ Source)
    22.     at Method)
    23.     at Source)
    24.     at
    25.     at
    26.     at java.lang.ClassLoader.loadClass(Unknown Source)
    27.     at java.lang.ClassLoader.loadClass(Unknown Source)
    28.     ... 11 more
    29. 2011-05-06 21:35:41 [INFO] DefaultCommands 3.2.2 is enabled.
    30. 2011-05-06 21:35:41 [INFO] [Permissions] version [2.7.2] (Phoenix)  loaded
  20. Offline


    Same problem in here. I've used 2.0 in past. #740
  21. i forgot to mention ... this is on my minimal testserver for plugins. on my main-server i have an other error
    Code (Text):
    2. 2011-05-06 21:56:07 [SEVERE] CommandHelper: Configuration Compile Exception: Unexpected newline near line 140 of configuration file. Please check your config file and try again.
    3. 2011-05-06 21:56:07 [SEVERE] CommandHelper: Unable to load working config file, aborting plugin operation
    but my config.txt is only 138 lines long
  22. Could anybody tell me how to add up strings (A)

    /foo = chat( color('red') + "SomethingThatNeedsToBeRed" )

    does not compile. ( in normal programming this does as long as color returns a string (A) somebody who had more luck with his / her tries.

    gr KoffiePatje

    SOLVED MYSELF :p Solution for whoever
    /cmd = chat( concat( color('red'), 'lol' ) )
  23. Offline


    Code (Text):
    1. /weather [$change=''] [$time=''] = /weather if(equals($change,'rain'),stormy,if(equals($change,'sun'),sunny,$change)) $time \  if(equals($change,'stormy'),run(/thunder on)) if(equals($change,''),'',run(/thunder off))
    can someone help me with is? plz
    edit: it the 2nd part i cant get right

    ok do not need help now lol
    i work it out :)
    Code (Text):
    2. /weather [$change=''] [$time=''] = >>>
    3. /weather if(equals($change,'rain'),stormy,if(equals($change,'sun'),sunny,$change)) $time \
    4. if(equals($change,''),'',if(equals($change,'stormy'),runas(player(),'/thunder on'),runas(player(),'/thunder off')))
    5. <<<
  24. Offline


    holy crap man, this is amazing. I can't believe I only just found this... no more asking devs to help me out, this will do all the neat stuff I want! I would like to know if anyone has a built script for commands for items, though, as this is exactly what I want to start using this for! Simply /command = does a command, and costs an item. I obviously can throw together that simple part, too, but what I wonder is if there's a script someone else built that will function a little more dynamically...

    namely: if you don't have enough of an item, it tells you "this" and then disallows the action.
    if you do have enough, it tells you "this" and allows the action, then removes the item from inventory.

    Not too hard to figure out I imagine, but before putting the time in I was wondering if anyone knew of a good combination and was willing to share with a newbie :p

    edit: Oh, and will this overwrite permissions, I hope? for instance, those who can't normally /home... can they use an alias with /home in it?
  25. Offline


    You can make users have the ability to use any command an OP can use. A way to do that would be:
    safe:/h = runas(~op, '/home')
    and then they would need the permission:

    The label doesn't have to be safe, it could be something else like default or blah, but it does need a label and a permission to go with the label so that they can use the restricted command runas()

    Some plugins don't let OPs have access to every command, so sometimes it's not possible unless there's an admin on that they could run as.
  26. Offline


    CommandHelper doesn't appear to like repeating commands with /. that have double slashes, which is odd because most of your plugins use double slashes.
  27. Offline


    Sorry bein a newfag, but how to do a /each command as I used to do on hmod plugin?
  28. Offline


    Code (Text):
    1. /each $group $ = foreach(all_players(), @player, if( or( equals($group, '*'), array_contains(pgroup(@player), $group)), runas(player(), replace($, ^, @player))) )
    Usage: /each <group> <command>
    Runs <command> once for every online player in <group>, replacing ^ with the player name.
    Use * as <group> to mach all online players.

    Example: /each Admin /me loves ^
    Love all online admins
  29. Offline


    I get the message, "unexpected newline" when attempting to do anything, really. My config.txt has one line:

    /rank $data1 $data2 = /manselect world \ /manuadd $data1 $data2 \ /manselect mainworld \ /manuadd $data1 $data2 \ /manselect survival \ /manuadd $data1 $data2 \ /manselect planetoids \ /manuadd $data1 $data2

    (all on one line)

    Is it a problem with my script, the plugin, or an incompatibility with another plugin?
  30. Offline


    That line seems to compile and run just fine here. You could upload config.txt somewhere ( works well) and I could check if there's something odd about it.

    Check if you're running the latest version of things and optionally, post your plugin list.
  31. Offline


    It doesnt work for me. Actually adding it to my config.txt breaks all the other shortcuts.

Share This Page