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

    MineralMC

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

    In the sense of:

    /command1
    -wait 2
    /command2

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

    xlilcasper

    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

    Jdbye

    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

    xlilcasper

    took the die off and it still does not work, he is the line as it is now
    Code:
    /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:
    08:26:10 [INFO] CommandHelper 5-wiz enabled
    08:26:10 [SEVERE] com/sk89q/bukkit/migration/PermissionsResolverManager loading CommandHelper v5-wiz (Is it up to date?)
    java.lang.NoClassDefFoundError: com/sk89q/bukkit/migration/PermissionsResolverManager
            at com.sk89q.commandhelper.CommandHelperPlugin.onEnable(CommandHelperPlugin.java:70)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:632)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:218)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:116)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:94)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:217)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:144)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:259)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.ClassNotFoundException: com.sk89q.bukkit.migration.PermissionsResolverManager
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            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(ClassLoader.java:307)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
            ... 11 more
    
    I don't have permissions installed, but this looks like like a build error to me.
     
  8. Offline

    fugue2005

    i keep trying to do simple aliases but keep getting "unexpected newline"
     
  9. Offline

    emoknight

    do u have anything in ur config?
     
  10. Offline

    fugue2005

    yes, a few that i put in manually, but when i try /alias it doesn't work
     
  11. Offline

    emoknight

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

    sk89q

  13. Offline

    baunegaard

    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(AliasCore.java:232)
    2011-05-05 13:26:44 [SEVERE] at com.laytonsmith.aliasengine.AliasCore.reload(AliasCore.java:117)
    2011-05-05 13:26:44 [SEVERE] at com.laytonsmith.aliasengine.AliasCore.<init>(AliasCore.java:43)
    2011-05-05 13:26:44 [SEVERE] at com.sk89q.commandhelper.CommandHelperPlugin.onEnable(CommandHelperPlugin.java:75)
    2011-05-05 13:26:44 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
    2011-05-05 13:26:44 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:670)
    2011-05-05 13:26:44 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:234)
    2011-05-05 13:26:44 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:130)
    2011-05-05 13:26:44 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:108)
    2011-05-05 13:26:44 [SEVERE] at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:217)
    2011-05-05 13:26:44 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:204)
    2011-05-05 13:26:44 [SEVERE] at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:144)
    2011-05-05 13:26:44 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:259)
    2011-05-05 13:26:44 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    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
    show-warnings=true
    #Whether or not to display the original command in the console
    console-log-commands=true
    #Whether or not to display debug information in the console
    debug-mode=false
     
  14. Offline

    fugue2005

    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

    emoknight


    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

    emoknight

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

    MrMagical

    It's easier to use
    Code:
    broadcast(<Message>)
    which is basically equivalent to
    Code:
    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:
    /hello = >>>
     assign( @hello, 'Hello World' )
     assign( @hello, replace(@hello, 'World', player()) )
     msg(@hello)
     <<<
    
    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:
    /backwords [$] = >>>
    if(equals($, ''),
        msg('§cUsage: /backwords <word> [[word2]...]'),
        g(
            assign(@resultarray, array()),
            for(assign(@i, array_size(parse_args($))), gt(@i, 0), dec(@i),
                array_push(@resultarray, array_get(parse_args($), subtract(@i, 1)))
            ),
            foreach(
                @resultarray, @resultindex, assign(@result, sconcat(@result, @resultindex))
            ),
            msg(trim(@result))
        )
    )
    <<<
    
    Is Notch on the server?

    Code:
    /notch = if(array_contains(all_players(), 'Notch'), msg('§aNotch is on this server! :D'), msg('§cNotch is not on this server. :('))
     
  19. Offline

    MG127

    i have the same, but i have permissions installed.
    Code:
    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)
    2011-05-06 21:35:38 [INFO] Preparing level "world"
    2011-05-06 21:35:38 [INFO] Preparing start region
    2011-05-06 21:35:39 [INFO] [Permissions] (Phoenix) was Initialized.
    2011-05-06 21:35:39 [INFO] CommandHelper 3.0.1 enabled
    2011-05-06 21:35:39 [SEVERE] com/sk89q/bukkit/migration/PermissionsResolverManager loading CommandHelper v3.0.1 (Is it up to date?)
    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:127)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:632)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:218)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:116)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:94)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:217)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:204)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:144)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:259)
        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-06 21:35:41 [INFO] DefaultCommands 3.2.2 is enabled.
    2011-05-06 21:35:41 [INFO] [Permissions] version [2.7.2] (Phoenix)  loaded
    
     
  20. Offline

    Juze

    Same problem in here. I've used 2.0 in past. #740
     
  21. Offline

    MG127

    i forgot to mention ... this is on my minimal testserver for plugins. on my main-server i have an other error
    Code:
    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.
    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. Offline

    KoffiePatje

    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

    emoknight

    Code:
    /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

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

    LucidLethargy

    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

    DeanDip

    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: commandhelper.alias.safe

    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

    QQCucumber

    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

    anon

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

    MrMagical

    Code:
    /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

    BaconFace

    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

    MrMagical

    That line seems to compile and run just fine here. You could upload config.txt somewhere (http://ge.tt/ 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

    anon

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

Share This Page