[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

    NEO

    This has been a big issue for me, not having an up to date or accurate /help command for my users.

    This looks great, cant wait to try it out.
     
  3. Offline

    Pluckerpluck

    This looks like it could catch on... I need a proper help system and this will work nicely I think.
     
  4. Offline

    tkelly

    Yea. That's exactly why I made it. The help systems available were just not up to snuff (General's was my favorite), so I needed one that would work easily and simply with the users on the server I go on.
     
  5. Offline

    jwideman

    Clever. I'll see how this develops.
     
  6. Offline

    Alienware777

    FINALLY! Thank you so much for making this tkelly. I've been suggesting this to multiple developers, and even the bukkit staff haha. I hope every plugin dev starts using this [​IMG]
     
  7. Offline

    mrgreaper

    looks cool, at mo were using essentialshelp which just lists every command reather a player can use it or not lol

    will definatly be switching to this if it works on our server

    nice to see groupmanager supported too! its getting tricky trying to get plugins when some only support the dead permissions plugin lol
     
  8. Offline

    Dutchy

    I'll consider supporting this for my plugins.
     
  9. Offline

    SplenectomY

    Why not? It's not very invasive and having a universal help plugin by staff member (meaning it will likely get fully integrated into bukkit one day) is only a boon. Any developer who doesn't take advantage of this is really letting the users down.
     
  10. Offline

    Dutchy

    Yes, makes sense.
     
  11. Offline

    Phaedrus

    This looks great. Your help menus in MyWarp and MyHome are phenomenal. I can't wait to check it out. Right now I'm using MCdocs to make custom lists for each user group. This would be much easier.
     
  12. Offline

    Synicyde

    This looks promising, I like.
     
  13. Offline

    Juze

    Wow! Finally a plugin that automatically does HelpPages' job and does more than that + allows custom help pages! I love you, @tkelly !
     
  14. Offline

    GizmoTheGreen

    Amazing, just like how I envisioned it :p
     
  15. Offline

    Vaupell

    Thank you WERY much,, much needed. the others "on the market" is not ewen compareable with this..
    Again KIS* wins.

    KIS = Keep it simple
     
  16. Offline

    RTRD

    @tkelly I use Bukkit 468 and i get this error:
    Code:
    2011-03-01 20:44:05 [SEVERE] Could not load plugins\Help.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:65)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:129)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:94)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:59)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.util.zip.ZipException: invalid END header (bad central directory offset)
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:52)
    ... 8 more
     
  17. Offline

    Giant

    Hey tkelly,

    Is it correct that when you have admin permissions set to -'*', the plugin thinks you do not have the permissions to view the info?
     
  18. Offline

    petteyg359

    Giant, if there's no space between that dash and the apostrophe, then your admin probably has no permissions for anything.
     
  19. Offline

    Giant

    uhh that was just typed in here, my permissions file is correct haha :oops:

    Edit:

    Seems like that's not the issue, doesn't work when hard setting the permissions either :S
    myHome seems to not work aswell O__o

    Edit 2:

    I is a total idiot >__<
    Forgot that for more info you needed to use: /help http://dev.bukkit.org/bukkit-plugins/ srry (A)/
     
  20. Offline

    M1sT3rM4n

    A lot of plugins don't have this hooked Q_Q
     
  21. Offline

    PatrickFreed

    How long has this been out? I've been looking for a help plugin with permissions support forever. [​IMG]
     
  22. Offline

    TheJSeb

    I tried it and it works for me. But when one of my users online tries it, the console says: Unhandled exception executing command 'help' in plugin Help v0.1.

    Any reasons why?
     
  23. Offline

    creec

    Hey i made this config with most commands linked to proper permissions node to it if anyone is interested: http://horobox.co.uk/u/creec_1299150503.txt

    Sorry for hosting like that: Rename file to ExtraHelp.yml and put in plugins/Help folder.
     
    clash likes this.
  24. Offline

    jascotty2

    when reloading the help menu i got this:

    ( then got message in minecraft in light blue: "Successfully reloaded Help" )

    this was caused by an empty permissions field, so you may want to check for that in a future update
     
  25. Offline

    DThielke

    I love the concept. However, would you consider adding a way to add more detailed pages for specific commands? Some of my commands require more explaining than can fit on a single line.

    As an example, typing /ch help create while running HeroChat produces the following:
    [​IMG]

    It would be wonderful if this plugin supported command-specific help pages like this in addition to what you already have.
     
  26. Offline

    jascotty2

    i agree, that would be nice.
    conflicts would come if someone named a command the same as the plugin, though.. maybe if both pages were to be printed in the case of overlap?
    also, it should also take into account worldedit commands, many which start with //, and should be searchable by name without the preceding slash
     
  27. Offline

    Jacob Litewski

    Sweetness! Pixl is so getting this support built into it. I won't release it until tomorrow after I test to make sure GroupManager plays well with it, but as of Pixl 1.3 (Beta or otherwise) is going to support this plugin. You rock @tkelly!
     
  28. Offline

    MacG32

    Where might I find the permissions list for the different help commands at?
     
  29. Offline

    Josch

    Pleas update it for the new GropuManager alpha!
    I get this error:
    Code:
    org.bukkit.command.CommandException: Unhandled exception executing command 'help
    ' in plugin Help v0.1
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:33)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80
    )
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:1
    83)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:619)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:582)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:576)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:230)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.NoSuchMethodError: org.anjocaido.groupmanager.GroupManager.getHandler()Lorg/anjocaido/groupmanager/permissions/AnjoPermissionsHandler;
            at me.taylorkelly.help.HelpPermissions.permission(HelpPermissions.java:42)
            at me.taylorkelly.help.HelpEntry.playerCanUse(HelpEntry.java:40)
            at me.taylorkelly.help.HelpList.getSortedHelp(HelpList.java:38)
            at me.taylorkelly.help.Lister.setPage(Lister.java:32)
    
     
  30. Offline

    Daan

    I'm getting constantly this error, and I can't solve it.
    Maybe someone else can?
    Here's my ExtraHelp.txt http://pastebin.com/6KdsTEFc

    Code:
    [SEVERE] [HELP] Error!
    while scanning a simple key
     in "<reader>", line 14, column 1:
        .
        ^
    could not found expected ':'
     in "<reader>", line 15, column 10:
           plugin: MyWarp
                 ^
    
        at org.yaml.snakeyaml.scanner.ScannerImpl.stalePossibleSimpleKeys(ScannerImpl.java:400)
        at org.yaml.snakeyaml.scanner.ScannerImpl.needMoreTokens(ScannerImpl.java:231)
        at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:182)
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:564)
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:228)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122)
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:124)
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
        at me.taylorkelly.help.HelpLoader.load(HelpLoader.java:26)
        at me.taylorkelly.help.Help.onEnable(Help.java:29)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:414)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:187)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:83)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
        at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:205)
        at com.earth2me.essentials.commands.Commandreloadall.run(Commandreloadall.java:27)
        at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsCommand.java:42)
        at com.earth2me.essentials.Essentials.onCommand(Essentials.java:566)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:31)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:79)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:183)
        at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:619)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:582)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:576)
        at net.minecraft.server.Packet3Chat.a(SourceFile:24)
        at net.minecraft.server.NetworkManager.a(SourceFile:230)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
     

Share This Page