[INACTIVE][INFO] HelpCenter v1.78 - A Flat and HTTP Helpfile/Topic Server [860]

Discussion in 'Inactive/Unsupported Plugins' started by weasel5i2, Feb 10, 2011.

  1. Offline

    weasel5i2

    HelpCenter - A Flat and HTTP Helpfile/Topic Server:
    Version: 1.78

    Description: **COLOUR CODES have CHANGED! See below...**

    This plugin allows you to serve any number of textfiles (and/or web-based texts) as help topics, using the /help command. The help files are placed in the HelpCenter/ folder, and their existence determines their availability within the game. Since the plugin reads the files each time it is invoked, any changes to the textfiles will be reflected immediately in-game. Note that the filenames must contain only characters which are enterable into the Minecraft client. It can also fetch helpfiles from a web server (the files must be in text/plain format, it will not strip out HTML tags or any weird characters, or do any unescaping() so make sure your help page(s) are returning plain text.)​

    If you create a file called HelpCenter/welcome.txt, it will be displayed to every user upon login. This is handy for displaying a message like "Type /help topics for a list of help topics." and so on..​

    If the file contains a specially crafted URL line (see below) then it will fetch the contents of a web page via the URL and return that to the player instead.​

    If the folder ./HelpCenter doesn't exist, it will be created when you first run the plugin.​

    Features:
    • Compatible with Craftbukkit running Minecraft 1.3x
    • Word-wrapping for those long lines of text
    • Dynamic: any changes to the helpfiles are reflected immediately to the players.
    • Directory traversal protection (trying "/help ../../../../../../../etc/passwd" will not work)
    • This plugin will support as many helpfiles as you can possibly create.
    • It can fetch web-based helpfiles via HTTP. :)
    • C o l o u r s ! (see codes below)
    • Default helpfile with randomly-chosen help item capability (otherwise will pass-thru the /help command if typed in without any arguments)
    • Helpfile redirection!
    Example help files:


    HelpCenter/spears.txt:
    Code:
    Spears are long and pointy. They can be used to stab things.
    You can also throw them or use them to roast hot dogs.
    ..will result in this when the player types /help spears:
    [​IMG]

    Here is an example of the text-wrapping feature. This is the help file I made:
    Code:
    The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.
    ..and here is the line-wrapping (it ended up being split into four separate lines):
    [​IMG]

    for web-based helpfiles, the format is a single line in the text file consisting of
    Code:
    [URL http://some.site.url.here..]
    e.g.: [URL http://bananas.are.nice] or [URL http://so.are.raspberries].

    If you want to make it so players can use the above example by typing "/help spear" as well, simply create a file called spear.txt and insert this redirection line:
    Code:
    [HELP spears]
    This way, you only need to update the original spears.txt to make changes to all linked helpfiles.

    Keywords (replaced by values) - If a help file contains any of the blue keywords listed below, they will be replaced by the following values, respectively:

    • %user% - Bukkit - player - The players name
    • %world% - Bukkit - player - The world the player is in
    • %health% - Bukkit - player - The players health value (0 = dead, 20 = full health)
    • %locx% - Bukkit - player - The players location X
    • %locy% - Bukkit - player - The players location Y
    • %locz% - Bukkit - player - The players location Z
    • %iteminhandid% - Bukkit - player - The ID of the item the player has in hand
    • %iteminhand% - Bukkit - player - The item the player has in hand
    • %isop% - Bukkit - player - Is the player an OP - "YES" or "NO"
    • %serveronlinecount% - Bukkit - Number of players currently on server
    • %serverver% - Bukkit - version of the server
    • %groups% - Plugin - Permissions - The list of groups to which the player belongs.
    • %prigroup% - Plugin - Permissions - The first group returned by Permissions to which the player belongs.
    • %helpver% - Plugin - HelpCenter - Version of the plugin
    Colour Codes:


    To use colours, simply add the following codes anywhere in the text file. They will be parsed out and replaced with the proper codes:​

    &0 = black, &8 = black (hi) = dark grey
    &1 = blue (lo), &9 = blue (hi)
    &2 = green (lo), &a = green (hi)
    &3 = cyan (lo), &b = cyan (hi)
    &4 = red (lo), &c = red (hi)
    &5 = magenta (lo), &d = magenta (hi)
    &6 = yellow (lo), &e = yellow (hi)
    &7 = white (lo) = light grey, &f = white (hi)


    Default Helpfile / Random Help Items:
    If you create a file called HelpCenter/HCdefault.txt (case-sensitive) it will display the contents when the player types /help without any parameters. You can also put multiple items, separated by #!HELP (on its own line) and the HelpCenter will randomly select one of the items and display it to the player when they type /help without any parameters. Otherwise, if HCdefault.txt doesn't exist, it will pass-thru the /help command and return the default Minecraft help text.​

    Example HCdefault.txt:

    Code:
    There are many help topics available. Please be more specific?
    #!HELP
    Help me Rhonda!
    #!HELP
    Here's a hint: /help topics
    #!HELP
    I'm sorry Dave, I can't help you.

    Installation:
    1. Copy the file HelpCenter.jar into your plugins folder.​
    2. Run the plugin at least once to create the HelpCenter/ directory.​
    3. Create your help text files as described above.​

    Download:
    Download The Plugin (JAR) v1.78 or..​
    Download The Plugin (ZIP) v1.78​

    Source is at Github ^_^​


    Older Versions (Why you'd want them, I don't know..)​

    Changelog:
    Version 1.78 13-Jun-2011 The_Nut
    • Fixed issue where long line without spaces was not displayed to user in console or ingame and caused the game to crash after a short while.
    Version 1.77 06-Jun-2011 The_Nut
    • Added additional key word replacement:
      %armor% - Bukkit - player - The players armor durability value (0 = none, 20 = full armor not damaged)

      Just a note, if you open up the .jar file you will see the README which is the change log and a player.txt file. The player.txt file is a sample help file with all the keyword replacements so you can see how it works.
    < 1.77:
    Show Spoiler

    Version 1.76 04-Jun-2011 The_Nut
    • Updated to work properly with permissions version 3.0+.
    • Fixed display of message on player login so it has proper line wrapping.
    • Tested and working well on my system CB 803 with permissions 2.7.2
    • Tested and working well on my system CB 818 with permissions 3.1
    Version 1.75 23-May-2011 The_Nut
    • Added more key word replacements (see list above)
    Version 1.73 10-May-2011 The_Nut
    • Add Javadoc, Cleaned up additional code.
    • Allow for HelpCenter to be used in console.
    • Fixed buildHelpFiles and buildPlugin commands to be more robust and consistent in building help files.
    • Added command helpp to pull help file information directly from the server's installed plugins.
    • Cleaned up internal code
    • Fixed line wrapping so it will not count chat color codes as part of the 60 char limit per line.
    Version 1.72c 05-May-2011 The_Nut, weasel5i2

    • Changed the colour codes to fit the accepted standard. I apologise if this broke all of your helpfiles!!
    • Incorporated changes by The_Nut (via Github merge)
    • Recompiled against latest recommended Craftbukkit build #740.
    Version 1.72 30-Mar-2011 weasel5i2

    • Recompiled against latest recommended Craftbukkit build #602.
    Version 1.71 21-Mar-2011 weasel5i2

    • Fixed a minor bug with the colour code parsing
    Version 1.7 18-Mar-2011 weasel5i2

    • Recompiled against latest recommended Craftbukkit build #556.
    • Added line-wrapping functionality for long lines
    Version 1.61 09-Mar-2011

    • Recompiled against latest recommended Craftbukkit build #522.
    • Fixed the CommandSender issues. Sorry about the inconvenience. :)
    Version 1.6 08-Mar-2011

    • HelpCenter folder now moved to plugins/HelpCenter. This should happen automatically. If you have an empty plugins/HelpCenter folder and all your helpfiles are in HelpCenter then simply delete the empty folder plugins/HelpCenter and restart the server and it should move it properly to the new location.
    • Complete rewrite of helpfile content handling.. Now nested help keys URL/HELP work properly (and infinitely, try not to make any infinite helpfile loops! :D)
    • Recompiled against latest recommended Craftbukkit build #493.
    Version 1.5 03-Mar-2011

    • Removed deprecated PLAYER_COMMAND code, replaced with the new onCommand() method.
    • Fixed /? to work the same as /help.
    Version 1.4 27-Feb-2011

    • Recompiled against Craftbukkit build 440
    • Added helpfile redirection capability.
    • Added informative console output error messages.
    • Now sends "No help found for ___." to player if an error occurs (malformed redirector/url formatting, file errors, etc).
    • Removed the need to add a space before the closing ] bracket. Both ways will work now. (e.g.: "[URL http://web.site/help.file]" and "[URL http://web.site/help.file ]" will both work)
    Version 1.31 24-Feb-2011

    • Removed stupidly long constructor and compiled against Craftbukkit build 432
    Version 1.3 15-Feb-2011

    • Fixed bug in which all PLAYER_COMMAND events were being intercepted and mishandled.
    Version 1.2 14-Feb-2011

    • Added colour capability (see codes above).
    • Added default helpfile random item capability per user request.
    Version 1.1 11-Feb-2011

    • Added web-based help fetching capability (see notes above)
    • Removed command case-sensitivity. Filenames must be in lowercase (excepting HCDefault.txt as described above).
    Version 1.0 10-Feb-2011

    • Created plugin.


    To Do:
    • Any suggestions? :)
    Please let me know what you think, if there are any issues or if it doesn't play nicely with the other plugins. It should, though. Also, it doesn't use any super-special classes, just the basic ones, so I'm certain this should work with most earlier versions of CraftBukkit. Suggestions are always welcome.


    --W5i2
     
  2. Offline

    clearwolves

    im needing an example use of the colored text.. not working 4 me.
     
  3. Offline

    Zaros

    I'll have to try this out later.

    Would it be possible to add page numbers aswell? That way documents that are cut off can go onto a second page.

    For example: /help spears
    /help spears 2
    etc

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 8, 2016
  4. Offline

    charlie k-j

    Has this been updated for 612/617??
     
  5. Offline

    treepunch

    Are you having any problems with it? I'm using 617 and it's working fine.
     
  6. Offline

    charlie k-j

    Just wondered as updating my server to 617
     
  7. Offline

    robbit

    Hey, can I convince you to give your URL to the CraftBukkitUpToDate guy in his thread, http://forums.bukkit.org/threads/ad...keep-your-server-plugins-up-to-date-617.5026/ ? I use it to keep updated, and yours is the only plugin I use all the time that is not currently listed with him. (I would just give your link to him, but I don't like to do that without permission.)

    Either way, thanks for a great plugin!
     
  8. Offline

    gothroach

    This plugin is awesome - the only suggestion I have is make a couple of variables available for users to put in either the help files or URLs. Specifically, something along the lines of %USER% to insert their in-game name or %PRIGROUP% to insert their primary Permissions/GroupManager group would be very helpful, especially in an URL such as http://mydomain/help/?user=%USER&group=%PRIGROUP% . This would allow for some much more robust server-side scripts that could react based on the user's permissions in-game.
     
  9. Offline

    Steve Cole

    I get an error when i type help in the console window
    running bukkit 617 on mac osx 10.6.7
    helepcenter 1.72

    Code:
    >help
    17:22:38 [WARNING] Unexpected exception while parsing console command
    org.bukkit.command.CommandException: Unhandled exception executing command 'help' in plugin Essentials v2.1.16
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:225)
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:391)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:377)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    Caused by: org.bukkit.command.CommandException: Unhandled exception executing command 'help' in plugin HelpCenter v1.72
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at com.earth2me.essentials.Essentials.onCommand(Essentials.java:547)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 6 more
    Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.command.ColouredConsoleSender cannot be cast to org.bukkit.entity.Player
        at net.weasel.HelpCenter.HelpCenter.onCommand(HelpCenter.java:52)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 8 more
    
     
  10. Offline

    Sylentdrake

    This plugin is awesome!
    Installed it the other day and spent the whole afternoon writing an awesome help menu for my players. I don't have to explain how to use the mess of commands for all our plugins anymore!
    Requires a bit of work to customize it to an individual server's plugins and commands, but also gives you complete control over that customization, which I really like.
    I also found that in combination with the global alias commands in CommandHelper, this becomes even better. Files they use all the time can be shortened from /help file to just /file, but HelpCenter keeps it all organized on my end.

    I like the idea of the stock help files, it would definitely be helpful to have an example help system to start from.

    The only thing I would add would be permissions support to limit access to different help files, or even possibly display different things to people in different groups. An in-game help system for my moderators would be handy.

    Keep up the great work!
     
  11. Offline

    dompie

    That's somethign I would like to integrate into this plugin, because I need it too. I hope weasel grants permission to publish the code on github to ease collaboration and make progress in development.
     
  12. Offline

    sambhur96

    Works great!
     
  13. Offline

    jmcneely

    For some reason my welcome message doesn't display correctly upon logging in, however it does when you enter /help welcome.

    When ever I log in it looks like this:
    Code:
    Welcome to Venture Industries!
    
    Please enter /help
    if
     you need any help.
    As you can see "if" starts the on the right line but then drops to the next line and continues. But when I enter /help welcome it doesn't do this drop.

    My welcome.txt looks like this:
    Code:
    #!cWelcome to Venture Industries!
    
    #!WPlease enter #!m/help
    #!Wif you need #!Rany #!Whelp.
     
  14. Offline

    DontMakeWaves

    It would be really nice if the pluggin would automaticaly seperate help files into multiple pages when they are too large to fit on the screen.
     
  15. Offline

    jmcneely

    That would save me a lot of room.
     
  16. Offline

    Agnate

    Yeah, this is bug with Bukkit. It used to happen for ALL of the help files, but Dinnerbone did an update to fix it for all of the in-game chat. However, it's still present in the welcome screen, for some reason. Never got fixed, I suppose.
     
  17. Offline

    RecovOne

    I skimmed through the posts and didn't see it, but is this compatible with Bukkit #670? I have been looking for a plugin like this for awhile, and would love to use it, if compatible.
     
  18. Offline

    DontMakeWaves

    Yea, I'm running it on 670, and it seems to work just fine.
     
  19. Offline

    5*stunner

    download link won't work for me, anyone else having this problem?
     
  20. Offline

    Eric V. Santoso

    hey.. love this plugin.. question.. is it possible to get it to hook into Permissions or a variant of permissions? that way my Admins can see one set of commands available, while default users see a different set. just figure it'd be easier than explaining to a newb that the /item command is for server admins only.

    hey, how about adding the ability to have help files that are mutliple pages long.. like /help instabreak [page] or something like that.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 8, 2016
  21. Offline

    ethood1999

    Alright, I'm a bit of a noob I guess. I created "competition.txt" in my "Bukkit/plugins/HelpCenter" directory. I thought I just needed to type in what I want to show up into "competition.txt". So all I did was type the rules for my competition, nothing special, just straight up typed it. Then I save it and I restarted my server, went on Minecraft to test it. But typing "/help competition" brings up this: "competition has no Help entries". Help please? :)
     
  22. Offline

    The_Nut

    Hi all, since weasel5i2 has taken a vacation or whatever for a while (a month maybe) and I needed some functionality that was not in this plugin, I have altered it and am posting it here for anyone to use. The source code is in the zip file along with the HelpCenter.jar and a README.txt file. I hope weasel5i2 takes my changes and incorporates them into his official version since I do not want to fork this plugin. I have changed the version to 1.72a so it is different from weasel5i2 version.

    EDIT: I have tested this on CB670 and it works for me.

    New functionality:
    1) can have a complete directory structure under HelpCenter. I don't believe there is a limit on the nesting.
    Code:
    plugins/
      HelpCenter/
        ChatBukkit.txt
        ChatBukkit/
          msg
          reply
          who
          admin.txt
          Admin/
            someCommand.txt
    
    This will allow for things like:
    /help ChatBukkit
    /help ChatBukkit msg
    /help Chatbukkit /msg (note: this will remove the "/" from the command to find the correct file.)
    /help Chatbukkit Admin
    /help chatbukkit admin/somecommand

    2) The help files can be with or without the .txt extension.
    3) The command "/help buildHelpFiles" will build help files for ALL installed plugins and defined commands.
    4) The command "/help buildPlugin <pluginName>" will build help files for the one plugin.

    In finding files, it will use the following rules to do so. Example: /help Chatbukkit msg
    1) Look for file with ".txt" appended to the end.
    plugins/Chatbukkit msg.txt
    2) look for the file as is.
    plugins/Chatbukkit msg
    3) look for the file replacing spaces with slashes and appending a ".txt" to the end.
    plugins/Chatbukkit/msg.txt
    4) look for the file replacing spaces with slashes only
    plugins/Chatbukkit/msg

    I have not touched anything dealing with URL's

    Hope you like it. Hope weasel5i2 integrates it. I have no intention of replacing weasel5i2 on this plugin or forking it.

    Regards,
    The_Nut

    EDIT:

    NOTE: the buildHelpFiles and buildPlugin can not be run again if the HCdefault.txt file exists or the pluginName.txt or pluginName/ directory exists. That way your users can not overwrite your help files by running the public commands. It will just show them an error message saying to remove the files and try again.

    EDIT2:
    This should allow you to make a structure like the following.
    Code:
    plugins/
        HelpCenter/
            HCdefault.txt         for the general users   /help
            mod.txt                  commands just for the mods   /help mod
            admin.txt               commands just for the admins /help admin
            mod/
                modcmd1.txt      moderator command  /help mod modcmd1
                modcmd2           moderator command  /help mod modcmd2
    
    etc..
    
    I also did not tie this to permissions in any way.
     

    Attached Files:

  23. Offline

    The_Nut

    Just wondering if anyone tried this my variation yet and what they think.

    my unofficial version would do what you want.
    you would have a directory called instabreak.txt with the first page in it. A directory called instabreak with files 1 2 3 4 etc in there for the specific page numbers.
     
  24. Offline

    The_Nut

    I have updated version of this plugin again: Internally I have labeled it 1.72b.
    New features:
    It now can get the group of groups that a player is assigned to in Permissions.
    If the user is assigned to the admin group and an admin directory exists in the HelpCenter folder, it will look for help in admin/ following the same 4 rules above.
    I have also tied the group name to the HTML extensions so you can do a replacement in the URL. Replacement variables are:
    %user% = the Players name. Example: The_Nut
    %prigroup% = the first group the player belongs to. Example: admins
    %groups% = all the groups the player belongs to (1 or more). note: spaces, periods, and slashes are removed
    1 group Example: [admins]
    multi group Example: [admins,users]

    My new version does this.

    my version does this... see attached.

    I got tired of waiting for github... I just downloaded the source, modified from there and reposted here in a zip file.

    I hope he integrates my source code changes into his for long-term use.

    The attached zip file contains an updated jar 1.72b AND the full source code.
     

    Attached Files:

  25. Offline

    gothroach

    Awesome, your changes make this so much more useful (at least to me)! Downloading now, will have more feedback later.
     
  26. Offline

    The_Nut

    Thanks... If there is an error, please PM me so we can keep this thread clean and only post errors related to the original plugin. :) I only like hijacking threads a little bit.
     
  27. Offline

    Adam Bilbaeno

    Any chance this is being updated for the lastest build?
    I loved this plugin and would like to be able to use it in 1.5_02
     
  28. Offline

    The_Nut

    I just updated this version again.. this time to 1.72c.
    To the 5 that downloaded my version and tried to use it without permissions, I am sorry for the error.

    I corrected an error when Permissions was NOT installed. Now it will not throw an error and if the %prigroup% or %groups% replacement variables are used, it will just replace them with 'prigroup' and 'groups' (without the quotes)

    Also fixed an error when there is no help file but there is a directory with the name as what they are looking for. This threw an error before, but now will just say a help file was not found.

    @Adam Bilbaeno,
    I have my v1.72c tested and working on CB733 without errors.
    Regards,
    The_Nut

    Just open up the zip file and place the .jar in the plugins directory. a readme and source is in the zip as well.
     

    Attached Files:

  29. Offline

    Adam Bilbaeno

    Good to know, thanks!
    One of my favorite plugins.


    EDIT:

    Just got it all installed, but word wrapping doesn't seem to be working.
    Or typing onto the next line actually appearing as the next line in minecraft.
     
  30. Offline

    The_Nut

    I have not touched or looked at any of the word wrapping issues in the code. My changes did not go there. so it should work exactly like your previous version.

    If your line wrapping issue is in the welcome message, I have heard it is a bukkit issue and not related to this plugin.

    If it is not the welcome message, give me more information as to what is happening, help file text pasted in code tags and I will take a peak when I have some time.
     
  31. Offline

    Adam Bilbaeno

    Ah, I see. It is just with the welcome message, and I already worked that one out with loooooots of spaces.
    As long as I don't have to do that with every helpcenter file than I'm a happy camper.
    Thanks again.
     

Share This Page