[INACTIVE][INFO] Help 0.2: The smart /help menu [531]

Discussion in 'Inactive/Unsupported Plugins' started by tkelly, Feb 28, 2011.

  1. Offline

    tkelly

    Help v0.2
    Download Help v0.2
    Download Help (Static Jar)
    Help Source Code
    Suggest Features

    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 http://dev.bukkit.org/bukkit-plugins/ (#)[/I][/B]:[/FONT] Shows all the help entries for [I][plugin][/I]. [B][FONT=courier new]/help plugins[/FONT][/B] : Shows a list of all the plugins with Help entries. [FONT=courier new][B]/help search [I][query][/I][/B][/FONT] : Searches for [I][query][/I] within it' entries. [B][FONT=courier new]/help reload[/FONT][/B] : Reloads the entries from ExtraHelp.yml. [FONT=helvetica][SIZE=5][B]Plugin Support[/B][/SIZE][/FONT] 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... [SIZE=5][FONT=helvetica][B]Custom ExtraHelp/[/B][/FONT][/SIZE] In the Help.zip download, I include a Help/ folder with a sample extra helps inside the ExtraHelp folder. This shows you how you can add custom commands to the /help menu. I'll also cover how to do that 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 [U][I][B]need[/B][/I][/U] 3 things: command, description, and plugin. These should be self-explanatory. The two optional pieces are "main" and "permissions". 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 [/CODE] [B][SIZE=5][FONT=helvetica]How To Hook into Help.[/FONT][/SIZE][/B] 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 [URL='https://github.com/tkelly910/MyHome/blob/master/src/main/java/me/taylorkelly/myhome/HomeHelp.java']MyHome[/URL] and [URL='https://github.com/tkelly910/BigBrother/blob/master/src/main/java/me/taylorkelly/bigbrother/BBHelp.java']BigBrother[/URL]. [SIZE=4][FONT=helvetica][B]Help API[/B][/FONT][/SIZE] [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); [/CODE] [SIZE=4][FONT=helvetica][B]Basic Example[/B][/FONT][/SIZE] [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."); } [/CODE] [SIZE=4][FONT=helvetica][B]Slightly More Advanced Example[/B][/FONT][/SIZE] [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]); [/CODE] [FONT=helvetica][SIZE=5][B]Plugins with Help Support[/B][/SIZE][/FONT] 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+ [FONT=helvetica][SIZE=5][B]ExtraHelp Packs[/B][/SIZE][/FONT] [URL='https://github.com/FabianN/MC-Bukkit-HelpExtra']FabianN put together a repository of entries for your ExtraHelp/ that represent other plugins' commands.[/URL] It's really awesome and was helped put together by others from the community. [SIZE=5][B][FONT=helvetica]Preview[/FONT][/B][/SIZE] [IMG]http://i.imgur.com/AE9cG.jpg[/IMG] [IMG]http://i.imgur.com/cII2X.jpg[/IMG] [SIZE=5][B][FONT=helvetica]Changelog[/FONT][/B][/SIZE] [SPOILER="Changelog"] [SIZE=5][FONT=helvetica][B][URL='http://taylorkelly.me/plugins/Help/Help%20v0-2.zip'][COLOR=rgb(16, 97, 179)]Help v0.2 [531][/COLOR][/URL][/B][/FONT][/SIZE] [I]Released 15 Mar, 2011[/I] - 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. [SIZE=5][FONT=helvetica][B][URL='http://taylorkelly.me/plugins/Help/Help%20v0-1-1.zip']Help v0.1.1 [493][/URL][/B][/FONT][/SIZE] [I]Released 6 Mar, 2011[/I] - Built with latest recommend build (493) - Updated for GroupManager 1.0 [SIZE=5][FONT=helvetica][B][URL='http://taylorkelly.me/plugins/Help/Help%20v0-1.zip'][COLOR=rgb(16, 97, 179)]Help v0.1 [440][/COLOR][/URL][/B][/FONT][/SIZE] [I]Released 28 Feb, 2011[/I] - Intial Release [/SPOILER]/
     
  2. Offline

    IncendiaDrakon

    Is this the "latest version" of the plugin?
     
  3. Offline

    jascotty2

    it would appear so, since tkelly hasn't updated it in a month now..
    at the moment, i'm just making sure it still functions, not adding anything new yet
    (too many other projects at the moment...)
     
  4. Offline

    jin hong ji

    i have a bunch of mods how do i add them? can some one make a video please?
     
  5. Offline

    gamerluke

    In the route of the /help when you first type it,
    Its showing me commands I dont even have on my server... Could you make these screens simple to customise?
     
  6. Offline

    khamseen_air

    When you install the help plugin it auto generates help files for the essentials plugin I believe it is, if you delete the help files for things you don't have from the plugins/help/ directory then these commands will no longer be listed. :)
     
  7. Offline

    Celtic Minstrel

    Or just delete all the help files that have "_orig" in the name? Depending on details, that might be sufficient.
     
  8. Offline

    dompie

    Well, I don't know the code but did you ever heard about design patterns? Kind of singleton and alike. That might be the reason for private constructors.
     
  9. Offline

    Juze

    Please update to latest RB.
     
  10. Offline

    MacG32

    Still going strong for CB #680. Thank you jascotty2. :)
     
  11. Offline

    Celtic Minstrel

    Well, I guess it might be time for @jascotty2 or I to officially fork this...
     
  12. Offline

    jascotty2

    i do have a fork... do you mean start a new thread?

    (if so, i should probably add a few new features ;) )
     
  13. Offline

    Celtic Minstrel

    I meant making it official, which means starting a new thread and adding features.
     
  14. Offline

    GizmoTheGreen

    yes please...
     
  15. Offline

    MacG32

    jascotty2, will you be forking this plugin? Seems most of tkelly's other plugins have been and new threads started. Would be great. :)
     
  16. Offline

    khamseen_air

    Please do. TKelly has been completely inactive and it is much easier to keep track of updates and problems with a fresh dedicated thread. :)
     
  17. Offline

    khamseen_air

    Any news on someone taking this on officially with a new thread? With the updates coming from 1.5 release it'd be nice to be able to track updates on this plugin.
     
  18. Offline

    jascotty2

    Bjourk and khamseen_air like this.
  19. Offline

    Bjourk

  20. Offline

    Don Redhorse

  21. Offline

    yourock129

    I put the things i need into the help.yml file but when i load my server and type /help it says
    "----------------------------HELP (1/0)------------------------------"
    then i try to go to a different page and it says 0 pages. my help.yml (i have transfered it to a txt file because it wouldnt let me upload a .yml file) file is attached.
    What is going wrong? HELP please!
     

    Attached Files:

  22. Offline

    Bjourk

    First of all, this plugin is now located here:
    http://forums.bukkit.org/threads/info-help-2-4-a-smarter-help-677.13601/
    Second, please read all the tutorial and setup info! Help.yml is the old way of doing it, which doesn't work with the new version. Help now uses separate YAML files for each plugin you manually add, which all go in the ExtraHelp folder. Also on the first post is a link to FabianN's database of user-submitted ExtraHelp files for lots of plugins so you don't have to do all the work yourself.
     
  23. Offline

    vildaberper

    If you want the help list to be filled automaticly, without any support from the plugin authors, take a look at the source for DefaultCommands. Its really simple. :)
     
  24. Offline

    khamseen_air

    You know this is inactive and the Help plugin now has a new thread and has been updated, right?
     

Share This Page