[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

    Alpha

    Hey I don't understand how to get all the commands to pop up when I type in /help! Does anyone know how? Can you please help if you know how?
     
  3. Offline

    Celtic Minstrel

    I suppose you didn't use the line-splitting function that I posted, then. Oh well.

    @Alpha - You need an ExtraHelp pack. I'm pretty sure the opening post tells you how to make one; it also gives to a link to where you can download some for various plugins.
     
  4. Offline

    Daniels3RE

    is there any way way to disable the entries that are automaticly added by other plugins and just use the ones I enter manually? I use the General plugin, and it adds its commands to the help menu automaticly, and they look absolutly terrible. I'd rather just enter them in myself and keep things looking nice. If there is a way to do this, this help system would be by far the best help system ever.
     
  5. Offline

    xZise

    Hello, I want to ask if it is possible to create a own help page for each command? This is the only missing one feature.

    For example to get the help for the warp create command you could use in my plugin:
    Code:
    >xwarp help create
    10:34:09 [INFO] xWarp help: warp create <name>
    10:34:09 [INFO] Creates a new warp, the visibility is by default public
    10:34:09 [INFO] Aliases: +, add
    Fabian
     
  6. Offline

    ToshNeox

    Hi, looks good. I will be testing this when I get a chance.
    Can I ask what the permissions are for the plugin? I'm guessing it's like: smarthelp.help
     
  7. Offline

    Celtic Minstrel

    If you use the version posted a few posts up by jascotty2, General's automatically added commands should display better. If that's not good enough for you, go into the ExtraHelp folder in the Help folder, rename General_orig.yml to General.yml, and edit as much as you want.

    @ToshNeox - There are no permissions for just using the /help command; however, provided stuff is set up right, users should only see commands that they actually have permission to use.
     
  8. Offline

    Azlodin

    So it seems the main: true option will display the item regardless if the permissions: condition is set. Is there a way to change this, so if the user does not have the relevant permission it will not show the line?

    Example:

    It will show the /help Mods menu heading within the main listing for /help. The contents of everything associated with Mods will not be visible when /help Mods is typed for anyone that doesn't meet the permission, but I would like to remove /help Mods from showing. The only way to do this is to set main:false, but that defeats the purpose of segmenting the extrahelp lists for each group I have set up.
     
  9. Offline

    Celtic Minstrel

    I think this is actually an error in your config. For "help Mods", you have "permission"; for "ban [playername]", you have "permissions". Only one is right, and it's probably the latter from what you describe.
     
  10. Offline

    Alpha

    How do I get to put the commands in the help when I type it in /help?
     
  11. Offline

    Celtic Minstrel

    Read the opening post.
     
  12. Offline

    Alpha

    Does anyone have a video? Because I am completely lost!
     
  13. Offline

    Jinkoo

    I can just put a new file into the "ExtraHelp" Folder and call it my mod name.. And add the commands to it right??

    I canot get this to work for the life of me.

    error is here http://pastebin.com/4nnE5bMA


    Code:
    mvcreate [WORLDNAME] [ENVIRONMENT]:
        visible: true
        description: Create a World
        permissions:
        - multiverse.world.create
        command: mvcreate
        Plugin: MultiVerse
        main: false
    mvtp [DESTINATION]:
        visible: true
        description: Teleport between Worlds/Portals
        permissions:
        - multiverse.tp
        command: mvtp
        Plugin: MultiVerse
        main: true
    mvimport [WORLDNAME] [ENVIRONMENT]:
        visible: true
        description: Import a World
        permissions:
        - multiverse.world.import
        command: mvimport
        Plugin: MultiVerse
        main: false
    mvremove [WORLDNAME]:
        visible: true
        description: Remove a World
        permissions:
        - multiverse.world.remove
        command: mvremove
        Plugin: MultiVerse
        main: false
    mvsetspawn:
        visible: true
        description: Set World Spawn
        permissions:
        - multiverse.world.setspawn
        command: mvsetspawn
        Plugin: MultiVerse
        main: false
    mvspawn:
        visible: true
        description: Spawn
        permissions:
        - multiverse.world.spawn
        command: mvspawn
        Plugin: MultiVerse
        main: false
    mvlist:
        visible: true
        description: List Worlds
        permissions:
        - multiverse.world.list
        command: mvlist
        Plugin: MultiVerse
        main: true
    mvpc [PORTALNAME] [w/p DESTINATION]:
        visible: true
        description: Portal Creation
        permissions:
        - multiverse.portal.create
        command: mvpc
        Plugin: MultiVerse
        main: false
    mvps [PORTALNAME]:
        visible: true
        description: Portal Selection
        permissions:
        - multiverse.portal.select
        command: mvps
        Plugin: MultiVerse
        main: false
    mvpd [DESTINATION]:
        visible: true
        description: Changes or Sets a Portals Destination
        permissions:
        - multiverse.portal.destination
        command: mvpd
        Plugin: MultiVerse
        main: false
    mvprename [OLDNAME] [NEWNAME]:
        visible: true
        description: Renames existing Portal
        permissions:
        - multiverse.portal.rename
        command: mvprename
        Plugin: MultiVerse
        main: false
    mvpr [PORTALNAME]:
        visible: true
        description: Removes said portal
        permissions:
        - multiverse.portal.remove
        command: mvpr
        Plugin: MultiVerse
        main: false
    mvplist:
        visible: true
        description: Lists Portals
        permissions:
        - multiverse.portal.list
        command: mvplist
        Plugin: MultiVerse
        main: false
    
     
  14. Offline

    Celtic Minstrel

    @Jinkoo - I think that might be fixed in the version jascotty2 posted at the top of page 7.
     
  15. Offline

    Jinkoo

    Thanks :)
     
  16. Offline

    thiefzer0

    Can anyone here provide me with a precompiled updated/fixed version of this mod please :)
    ie, with multi-line support fixed, and the issue of some plugins showing up twice, and some not at all fixed. I do not know how to go into compiling source in java... unless somebody can lead me to a good guide. Thanks!
     
  17. Offline

    d3x

    Getting a NPE when I try and load the plugin
    Code:
    2011-03-26 21:53:37 [SEVERE] null loading Help v0.2 (Is it up to date?)
    java.lang.NullPointerException
        at me.taylorkelly.help.HelpLoader.load(HelpLoader.java:22)
        at me.taylorkelly.help.Help.onEnable(Help.java:39)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:451)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:92)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:70)
        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)
     
  18. Offline

    Celtic Minstrel

    Top of page 7. I said that like two posts before you posted.
     
  19. Offline

    thiefzer0

    derp didn't see the link :p
     
  20. Offline

    Techcuron

    :\ Not that great.
     
  21. Offline

    Jinkoo

    Attached Files:

  22. Offline

    sweetswear4665

    Are guests automatically allowed to use /help or do I have to add something into permissions to allow them to use that command?
     
  23. Offline

    Celtic Minstrel

    Yes. If they have access to no commands, though, they won't see anything.
     
  24. Offline

    GizmoTheGreen

    needs updating for build 602?
     
  25. Offline

    Celtic Minstrel

    No, it works in 602. I've tried it.
     
  26. Offline

    ethood1999

    This might be a stupid question as I'm new to Bukkit so please don't flame me.. :p Anyways, does this plugin work with Permission 2.5.4? Like if I type "permissions: Admins" for a certain command in the ExtraHelp.yml, will it make it so that only players apart of my "Admins" group (in my world.yml for Permissions) can see it?
     
  27. Offline

    Celtic Minstrel

  28. Offline

    lazy_architect

    That is good to know. I love this plugin hope it is updated soon.
     
  29. Offline

    Ditto8353

    Appears to work with RB612
     
  30. Offline

    derchris

    Can you show me the server.log from a start-up of the server?

    Not working for me, running latest recommended bukkit build 612 with MC 1.4, and the forked Help.jar from jascotty2.
    This is the error I see:

    Code:
    08:04:03 [SEVERE] tried to access method me.taylorkelly.help.HelpEntry.save(Ljava/io/File;)V from class me.taylorkelly.help.HelpList loading Help v0.2.3 (Is it up to date?)
    java.lang.IllegalAccessError: tried to access method me.taylorkelly.help.HelpEntry.save(Ljava/io/File;)V from class me.taylorkelly.help.HelpList
            at me.taylorkelly.help.HelpList.registerCommand(HelpList.java:201)
            at me.taylorkelly.help.Help.registerCommand(Help.java:151)
            at me.taylorkelly.help.Help.onEnable(Help.java:44)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:511)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:216)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:94)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:72)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:215)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:202)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:142)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:257)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    
    Apparently it looks like I see this error for every plugin which has Help support built in.
     
    Jinivus likes this.
  31. Offline

    Ditto8353

    Code:
    10:00:22 [INFO] Starting minecraft server version Beta 1.4
    10:00:22 [INFO] Loading properties
    10:00:22 [INFO] Starting Minecraft server on *:25565
    10:00:22 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-609-g39996e1-b612jnks (MC: 1.4)
    10:00:22 [INFO] Preparing level "World 3"
    10:00:22 [INFO] Preparing start region
    10:00:23 [INFO] 144 recipes
    10:00:24 [INFO] [AfkBooter] Permissions detected, attaching.
    10:00:24 [INFO] GroupManager - INFO - Scheduled Data Saving is set for every 10 minutes!
    10:00:24 [INFO] GroupManager version 1.0(alpha-5) is enabled!
    10:00:24 [INFO] Fake Permissions version 2.5.1 is enabled!
    10:00:24 [INFO] [AfkBooter] Version 0.7 is loaded.
    10:00:24 [INFO] [AfkBooter] Kick timeout 30 sec, exempt players: Krippner, Rnadmo, Tzimisce52
    10:00:24 [INFO] [FenceStack] version [1.13] loaded.
    10:00:24 [INFO] [HELP] 187 extra help entries loaded
    10:00:24 [INFO] [HELP] Permissions enabled using: GroupManager v1.0(alpha-5)
    10:00:24 [INFO] [HELP] Help 0.2 enabled
    10:00:24 [INFO] [iChat] Using Permissions 2.0 (2.0) for permissions
    10:00:24 [INFO] iChat (v2.2.0) enabled
    10:00:24 [INFO] LocalShops: Permissions found.
    10:00:24 [INFO] LocalShops: iConomy not found.
    10:00:24 [INFO] LocalShops: Loading shop test
    10:00:24 [INFO] LocalShops: Loaded 1 shop(s).
    10:00:24 [INFO] LocalShops: version 2.0b is enabled!
    10:00:24 [INFO] Done (0.165s)! For help, type "help" or "?"
    10:00:33 [INFO] drakonightwind [/75.62.40.214:56009] logged in with entity id 159
    10:00:33 [SEVERE] Nag author: 'Neromir' of 'AfkBooter' about the following: onPlayerJoin has been replaced with a new signature, (PlayerJoinEvent)
    10:00:41 [INFO] drakonightwind tried command: who
    >
    Some of it probably has to do with the fact that I am not running any plugins with built-in Help support at the moment. All of my help files are "extras"
     

Share This Page