Inactive [INFO] Help 3 - a Smarter /help [1060]

Discussion in 'Inactive/Unsupported Plugins' started by jascotty2, Apr 19, 2011.

     
  1. Offline

    jascotty2

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Help - The Smart /help Menu
    Version: 0.3.2
    Download: Help.jar

    This is a new thread for the Help version that i maintain
    (tkelly hasn't been on for about a month as of this submission, and no updates to his version since 531)

    Version 0.3 is (finally) out! :D

    (any suggestions for what to work on next are welcome ;) )


    Help has support for both GroupManager and Permissions, so you can use either one. You can also use neither if you so choose. Help will not force you to any which one.

    What is Help?
    Help is a clean and advanced /help menu. Help separates "main" commands from secondary ones, allowing you to have a clean initial menu, but still able to dig down and get access to every possible command.

    It is also the first /help menu to take into account permissions; some commands simply aren't applicable to all users, so those commands should clearly not be visible to those users. Now, default users' help menus won't be cluttered with commands for admin tools they have no way of using.

    Scroll down for a preview, or see below for how to hook into Help :)

    Help Commands
    /help (#) : Shows the /help menu.
    /help [plugin] (#): Shows all the help entries for [plugin].
    /help plugins : Shows a list of all the plugins with Help entries.
    /help search [query] : Searches for [query] within it' entries.
    /help reload : Reloads the entries from ExtraHelp.yml.

    Plugin Support
    Help requires that plugins tell Help about the commands they use. This makes sure that the commands and permissions are accurate and precise (rather than trying to auto fetch commands). Because it's ridiculous to assume that all plugins will instantly jump up and support Help (we can dream can't we? :D), server admins can mimic this behavior by supplying...

    Custom ExtraHelp/
    I'll also cover how you can add custom commands to the /help menu here.

    Each command has a "name", this name is only for you, as Help doesn't care about it (they just need to be unique names). In the following example the names are 'versions', 'pluginversions', 'kick' and 'essentialswho'. Within these Nodes you need 2 things: command, description, and plugin. These should be self-explanatory. The two optional pieces are "main" and "permissions"

    The previously required "plugin" node has been replaced by the filename itself.
    so if you have entries for "Minecraft", put those entries within "Minecraft.yml" in help's ExtreHelp folder.
    If you have many commands & don't want them cluttering the same file (like worldedit), you can put them in a folder instead (the folder name will be the name used for plugin)

    If you specify a "main", you can choose whether or not the command is important enough to show up on the main /help menu; if you leave it blank or skip it, it will default to 'false'

    If you specify a "visible", you can specify whether the command shows up at all. This is useful for overriding other plugins' built-in Help support (in case you don't want all the commands); if you leave it blank or skip it, it will default to 'true'.

    If you specify a "permissions", you can choose what is necessary for the user to see the command; and leaving it blank will allow all to see. So in the case of /version, all users can use it, so no permissions. But with /who, you have to have essentials.list, so that was specified. There is also a special permission case, "OP". By specifying this, this will require the user to be an OP to use the command (as is the case with Minecraft's built-in /kick command).
    Code:
    versions:
        command: version
        description: Show the version of Minecraft and CB
        plugin: CraftBukkit
        main: true
    pluginversions:
        command: version [plugin]
        description: Shows the version of [plugin]
        plugin: CraftBukkit
    kick:
        command: kick [player]
        description: Kicks [player] from the server
        plugin: Minecraft
        main: true
        permissions: OP
    essentialswho:
        command: who
        description: Show who's one the server
        plugin: Essentials
        main: true
        permissions: essentials.list
    
    How To Hook into Help.

    Hooking into Help is extremely easy, and very similar to hooking into any permission-plugin. When your plugin is starting up, just grab the Help plugin and register your commands with Help's registerCommand() method; that's it! Here's the API and some examples. If you'd like a concrete example, check out the relevant source code from MyHome and BigBrother.

    Help API
    Code:
    /**
     * Registers the given command, description, and plugin.
     * There are no permissions, so all users can see it.
     * It is also not a "main" help entry.
     * @return Whether or not it was successful
     */
    public boolean registerCommand(String command, String description, Plugin plugin);
    
    /**
     * Registers the given command, description, and plugin.
     * There are no permissions, so all users can see it.
     * You can set whether the plugin is a "main" entry or not
     * @return Whether or not it was successful
     */
    public boolean registerCommand(String command, String description, Plugin plugin, boolean main);
    
    /**
     * Registers the given command, description, and plugin.
     * You can specify one or more permissions.
     * If a user has permissions for at least (1) of them, he can see this command
     * It is also not a "main" help entry.
     * @return Whether or not it was successful
     */
    public boolean registerCommand(String command, String description, Plugin plugin, String... permissions);
    
    /**
     * Registers the given command, description, and plugin.
     * You can specify one or more permissions.
     * If a user has permissions for at least (1) of them, he can see this command
     * You can set whether the plugin is a "main" entry or not
     * @return Whether or not it was successful
     */
    public boolean registerCommand(String command, String description, Plugin plugin, boolean main, String... permissions);
    
    /**
    * Gets the help text associated with this command
    * @param command the command to lookup
    * @return help text, or null if none
    */
    public String getHelp(String command);
    
    /**
    * Gets all of the commands registered with this plugin
    * @param plugin plugin to lookup
    * @return list of commands
    */
    public ArrayList<String> getPluginCommands(String plugin);
    
    Basic Example
    Code:
    // plugin is the instance of your Plugin registering the commands
    Plugin test = plugin.getServer().getPluginManager().getPlugin("Help");
    if (test != null) {
        Logger log = Logger.getLogger("Minecraft");
        Help helpPlugin = ((Help) test);
        // Registers a main command. But all users will be able to see it
        helpPlugin.registerCommand("home help", "Help for all MyHome commands", plugin, true);
        // Registers a secondary command to our plugin (MyHome), but the user has to have the permission to see it
        helpPlugin.registerCommand("home", "Go home young chap!", plugin, "myhome.home.basic.home");
        log.log(Level.INFO, "'Help' support enabled.");
    } else {
        Logger log = Logger.getLogger("Minecraft");
        log.log(Level.WARNING, "'Help' isn't detected. No /help support.");
    }
    
    
    Slightly More Advanced Example
    Code:
    Help helpPlugin = ((Help) test);
    String[] permissions = new String[]{"bb.admin.watch", "bb.admin.info", "bb.admin.rollback", "bb.admin.cleanse"};
    // If a user has any one of those permissions, they'll be able to see /bb help. A main command
    helpPlugin.registerCommand("bb help", "Help for all BigBrother commands", plugin, true, permissions);
    // If a user has "bb.admin.watch" they'll be able to see /bb watch [player]. A secondary command
    helpPlugin.registerCommand("bb watch [player]", "Toggle the watch on [player]", plugin, permissions[0]);
    

    Plugins with Help Support
    Here's a quick list of plugins (and version) that have built in Help support.
    - MyHome v1.9.2+
    - MyWarp v1.10.3+
    - BigBrother v1.6.4+
    - Citizens v1.0+
    - General 3.1+
    - TelePlus 1.6+
    - Pixl 1.3+
    - Vampire 1.3+
    - BetterShop 1.6.2+
    - Wormhole-X-Treme 0.812+
    - Tele++ v1.3.4

    ExtraHelp Packs
    FabianN put together a repository of entries for your ExtraHelp/ that represent other plugins' commands. It's really awesome and was helped put together by others from the community.

    Preview
    [IMG]
    [IMG]


    Changelog

    Version 0.3.2 - 7/21/11
    • lowered chat fill size.. should fix some wrapping issues
    Version 0.3.1 - 7/7/11
    • fixed NullPointerException on entry save when no permissions
    Version 0.3 - 7/6/11
    • fixed loading help & plugin help registering before plugin onEnable


    Version 0.3 beta2 - 7/4/11
    • plugin console output fixed
    • console output width changed for when running windows
    • plugin help override can be disabled (default)
      • plugin help registering is ignored if the command exists already
      • alternatively, can be disabled completely
    • saving of registered commands can be disabled (also, now saves to file, not "_orig" files)
    • ExtraHelp now uses filename as plugin name (plugin field no longer used)
    • added formatting options:
      • shortenEntries : can show in old, one-line style
      • chat line (useWordWrap:false) - minecraft chat wraps to next line
      • columns (useWordWrap:true) - command on left, description in word wrap line(s)
        • can be right-aligned (wordWrapRight:true)
    • plugin entries can be set to not sorted (listed in the order found in the help file)
    • "/help reload" is now op-only
    • "ExtraHelp.yml" will now be converted (again.. seems to have been removed somewhere..)
    • ExtraHelp supports a multi-directory structure (like FabiaN's help package) (plugin name will be the directory name)
    • improved node error messages when loading
    • fixed permissions 3x illegalAccessErrors on load (and api errors)
    Version 0.2.4.1 - 4/4/11
    • another illegalAccessError (hopefully) resolved
    Version 0.2.4 - 4/2/11
    • updated an illegalAccess error that was occurring in 617
    Version 0.2.3 - 3/25/11
    • fixed a null pointer exception in plugin help
    Version 0.2.2 - 3/24/11
    • various null pointer fixes (could have nullpointerException on load without)
    • improved help listing
    • added console help support
    Before i started maintaining:

    Help v0.2 [531]
    Released 15 Mar, 2011
    - Built with latest recommend build (531)
    - Multiline support. Descriptions of commands can now be as long as you'd like.
    - Separated ExtraHelp.yml into separate YML files (for each plugin, etc).
    - Plugin overriding. Don't like how a plugin has their Help support? Completely customize their entries.

    Help v0.1.1 [493]
    Released 6 Mar, 2011
    - Built with latest recommend build (493)
    - Updated for GroupManager 1.0

    Help v0.1 [440]
    Released 28 Feb, 2011
    - Intial Release
    [\spoiler]
  2.  
  3. Offline

    Reazem

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    thanks I am using this on my server!
  4. Offline

    Jaker232

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Awesome! Here's a diamond. [diamond]
  5. Offline

    Martin-zz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Hey, love the plugin! Any news on getting it updated to work with 818?
  6. Offline

    maetthew

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Will there be any updates to this plugin? I would like 818 support
  7. Offline

    Jeyge

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    You'll need to post your errors because it works just fine for everyone else.
  8. Offline

    CainFoool

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Code:
    02:10:43 [SEVERE] Nag author: 'tkelly and n3x15' of 'BigBrother' about the following: This plugin is not properly shutting down its async tasks when it is being reloaded.  This may cause conflicts with the newly loaded version of the plugin
    02:10:43 [SEVERE] Nag author: 'tkelly and n3x15' of 'BigBrother' about the following: This plugin is not properly shutting down its async tasks when it is being reloaded.  This may cause conflicts with the newly loaded version of the plugin
    02:10:43 [SEVERE] Nag author: 'tkelly and n3x15' of 'BigBrother' about the following: This plugin is not properly shutting down its async tasks when it is being reloaded.  This may cause conflicts with the newly loaded version of the plugin
    
    Getting this error upon server start; however it's working fine but doesn't look nice and when reloading the server it always pauses on that error.

    Im not sure if it's any of my plugins that are corrupting with it, but..
    Code:
    Pitfall, Dontkickme, PlgDisableCmd, RedstonePlugin, Help, GroupManager, MotherNature, WorldEdit, WorldGuard, TelePlusPlus, ChatStuff, SecretDoors, WarnFreeze, NoCheat, RocketBoots, Slap, SimpleGive, iChat, Regios, PlgLogCmd, motd, DefaultCommands, ecoCreature, iConomy, ItemDetector, Jail, Lockette, SimpleModerator, BigBrother, VanishNoPickup, AutoHelp, PaintingSwitch, mobSpawner, Permissions, iCoLand
    
  9. Offline

    maetthew

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I made a commit with support for BukkitVote. Until FabianN has merged it with the master repository you can find it in my repo here
  10. Offline

    Olac09

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Shimmi could you explain your fix a little more?
    I seem to have the same problem
  11. Offline

    EpicATrain

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    This plugin corrupts my permissions plugin. Why?

    Here's the error. It was pulled from somebody else's pastie but the error is the same...

    http://pastebin.com/yxs8kHXH
  12. Offline

    alexanderpas

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Feature Request:
    Don't show "help <page>" items when they lead to an page with no items, or the only item on the page is themself.

    Examples:
    • Don't show "help worldguard" when there is no help for worldguard availble for a user.
    • Don't show "help worldguard" when the only item on the worldguard page is "help worldguard"
  13. Offline

    mig72

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    What version of Permissions do you have ? It seems that Help 2.4.1 breaks Permission 3+. You need to stick with Permissions 2.7.4.

    I also have this problem and it prevents me from upgrading McMyAdmin to the last build, as it only supports Permissions v3...
  14. Offline

    Tadas159

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Please update for permissions v3
  15. Offline

    wheresmyhotdog

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I have the same problem with it not working with the new version of permissions
  16. Offline

    Rytharr

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Shouldnt you be posting that in the Bigbrother thread since its a bigbrother error and not a help error?
  17. Offline

    Celtic Minstrel

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Ah, that looks like it might be an error in your ExtraHelp.yml file... which probably shouldn't exist anyway.
  18. Offline

    DJ_Idol

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    This plugin is working great, I just have one problem. No matter what I do, I CAN'T get the /home and /home set commands to get off the main /help page. I've deleted the MyHome_orig.yml, and they're not set to main: true anywhere else, they're actually not in any of the .yml's. How can I remove them from the main help page?
  19. Offline

    Celtic Minstrel

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Rename MyHome_orig.yml to MyHome.yml and change main:true to main:false.
  20. Offline

    DJ_Idol

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Thanks, but the thing is, I don't even have the MyHome_orig.yml, I deleted it completely. And that the other commands are nowhere in any of my other help files.
  21. Offline

    Celtic Minstrel

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    The MyHome_orig.yml will be generated whenever the server starts up. Possibly whenever Help loads, even; you could try to see if /help reload generates it.
  22. Offline

    RaCooN

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Please update it, so that it works with Permissions 3.x.x! It's a lovely plug-in but when I use it, it gives me errors because I use Permissions 3. Such a shame for such a wonderful plug-in!
  23. Offline

    Blackswordsman

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    A Permissions 3.x update would be wonderful! :D
  24. Offline

    Olac09

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    It seems to work for me with permissions 3+...
  25. Offline

    11RJB

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
  26. Offline

    dvdbrander

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Question, essentials keeps handling the /help instead of this plugin. How can I fix that?
  27. Offline

    Mansarde

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    One solution would be to generate your own .jar from the source-code, for which you'd change the "help" command to something else. For example, I chose "halp" as a replacement.
  28. Offline

    dvdbrander

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Fixed it, removed the help function out of the function-list in essentials (open it with winrar, open the right text-file and remove help)
  29. Offline

    lycano

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @dvdbrander: in Essentials 2.3.x you dont need to do this as it will redirect it to the overriden plugin. Which means: if a plugin exists that uses /help or /god this will be redirected to the plugin.
  30. Offline

    Mansarde

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I'm currently using Essentials 2.2.8 and it should also do what you said. At least that's what it says in its config file.
    But it doesn't seem to work. The config file even says that this method of first giving other plugins priority doesn't always work.
    Now I wonder: Do you actually use Smarter Help with Essentials 2.3.x? That would be nice to know, thanks in advance!
  31. Offline

    Gangsta_hotdog

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    It would be nice if more plugins had built in support for this, like essentials help. I don't really want to spend hours putting in all the commands and definitions. Couldn't stand how much essentials bloated the server though :/
  32. Offline

    shellthor

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I am having the same issue with BigBrother and PermissionsEx. I have renamed both generated bigbrother_orig.yml and permissionsex_orig.yml to bigbrother.yml and permissionsex.yml respectively but when the server is restarted, botth bigbrother_orig.yml and permissionsex_orig.yml are created and I am stuck with the commands staying on the main help page. Is there any way to fix this?

Share This Page