[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. umm... i'm new to alot of this stuff can someone tell me where i put the redirection file?
     
  3. Offline

    gchristopher

  4. Offline

    jmcneely

    All of a sudden this plugin is causing my server to become unresponsive even to console commands. The welcome message still works good but is even worse then from my previous report. Yet, when someone enters /help it brings up the message incorrectly and stops the server pretty much. I think craftbukkit has changed something that is causing this problems with this plugin.
     
  5. Offline

    The_Nut

    Can you give me an example of your help files in question and permissions file so I can try to recreate your issue.

    Does it also do the same thing with the original 1.72 version of the plugin?
     
  6. Offline

    Selryam

    I get "No help found for HCdefault."
     
  7. Offline

    The_Nut

    You need to create a file in the plugins\HelpCenter directory called HCdefault or HCdefault.txt and put in there your default Help message. This plugin has no default messages.. it is all up to you to make them.

    If you are using the 1.72 version (official) this is your only option. if you are using my unofficial version 1.72c, you can use the /help buildHelpFiles from inside the game to have the plugin probe your plugins and try to build a default set of help files. This will be a good starting point for you to adjust to your liking.
     
    weasel5i2 likes this.
  8. Offline

    Selryam

    Hmm, oddly enough it works; I do not know if it matter the text file to be named as HCdefault or HCdefault.txt, but earlier I used HCdefault.txt, and it did not work. Now I used HCdefault and it worked.

    P.S. Handy plugin!
     
  9. Offline

    jmcneely

    @The_Nut Yes, that is the current version I am using.
     
  10. Offline

    chlitto

    how do i break into another line ?
     
  11. Offline

    The_Nut

    just start a new line in your help text file.
     
  12. Offline

    chlitto

    it doesn't work work for me with the welcome.txt file
     
  13. Offline

    The_Nut

    This is best answered by Agnate's reply on page 3
     
  14. Offline

    Plague

  15. Offline

    weasel5i2

    Arrg, sorry about that. I will update it today as well as look into the welcome.txt issue.. My helpfiles disappeared completely from my server for some odd reason. @The_Nut, I will merge your 1.72c changes into the source. :)

    Any improvements anyone would like me to commit, please send them to me and I'll add them! Or you can fork my Github repo if you'd like, send me your Github id and I'll happily add you to the project.

    Good news is that I will be fixing the colour codes to be the same as the standard used by most other plugins which have colours..

    --W5i2
     
  16. Offline

    weasel5i2

    Updating my Eclipse, apparently there's a bug with the Git repo pull functionality.. :p

    **EDIT** w00t! Merged, pulled, recompiled, uploaded, fixed, committed, recompiled, uploaded again! Colour codes are now the standard &_... format. I apologise in advance if this breaks a bunch of your helpfiles!!
     
  17. Offline

    chlitto

    i was rather thinking about #_... format :p but thanks a lot! :)

    btw @helpCENTER maybe you could add a "Moderator Ticket Request System" (name after http://forums.bukkit.org/threads/admn-modtrs-v1-3-moderator-ticket-request-system-740.11652/ :) ) where you can only call an OP after you used "/help cuboid"

    or popping announcements after standing on a "help block" (like http://wiki.afforess.com/Minecart_Mania-Plugin/Sign_Commands#Announcement_Signs but where you write on the sign only the help ID)
     
  18. Offline

    Haekon

    Beautiful. :)
     
  19. Offline

    Krispy

    I can't seem to get color code parsing working. I have a lines such as, " &1-&f Use &c/sethome&f to set your respawn and &c/home&f to port there." in my HCdefault.txt but they just shows up as is without the &x being parsed.

    False alarm. Whatever I was doing wrong, I fixed it.
     
  20. Offline

    casso

    Just wanted to check: are colours working? see below for my HCdefault.txt - it's all white...
    ------
    &cHelp Topics (usage: /help [topic below])
    General
    Land
    Currency
    Protection
    Runecraft
    Warp
    ------
    Otherwise, lovin this plugin!
     
  21. Offline

    The_Nut

    @casso, The color codes have changed. Please see the OP for the new correct codes. They have been converted to the standard &_ format.
     
  22. Offline

    Pontus Lantz

    I can't get the colors to work i write
    &2www.minetopia.net/server
    But it just writes &2 in the help.
    What am i doing wrong?
     
  23. I'm also having this same problem, I seem to have tried everything, tried removing other plugins that use colours etc. Nothing seems to work, I just get standard chat.

    EDIT: downgraded to Version 1.72c, seems to work fine with "standard" colour codes.
     
  24. Offline

    The_Nut

    Pontus & Elate,
    Please try this latest build and see if it works for you. The colors work well for me (using color codes '&0' - '&f'). I have also reworked the "/help buildHelpFiles" and "/help buildPlugin" to work better.
    I have reworked the plugin to also work in console.
    I have added a new command: /helpp (with the extra p at the end) This command will pull the help commands/info directly out of the installed plugins of the server. It will not look at files.
    /helpp This by itself, will give a list of installed plugins.
    /helpp <pluginName> This will give a list of commands for a given plugin.
    /helpp <pluginName> <command> This will give the description of a plugin's command.

    NOTE: the pluginName and command are not case sensetive.

    This has been tested on CB740.

    Regards,
    The_Nut

    @weasel5i2, I will upload the new code to github soon.

    HelpCenter 1.73 download link.
     
  25. Offline

    Pontus Lantz

    @The_Nut
    Thanks <3. Works fine now[meat]

    Edit: Btw is there anyway to configure the plugins /helpp file?
     
  26. Offline

    The_Nut

    You are welcome
    What do you mean?
    I added helpp as a way to look at the help files of the server plugins without configuration.
    If you want to customize what the players sees, then I would suggest using the "/help buildHelpFiles" command. This command will go through the installed plugins just like /helpp does, but it will create a tree structure of files in the plugins/HelpCenter folder that can be customized.

    Please let me know what you wanted to configure. or if the buildHelpFiles command works for you.
     
  27. Offline

    Pontus Lantz

    @The_Nut
    Thanks. /help buildHelpFiles did exactly what i wanted[meat]
     
  28. Offline

    The_Nut

    Just another hint, you can have a separate set of help files for each Permissions group.
    Example: (where you have a Builder and an Admin permissions group)
    Code:
    plugins\   (bukkit plugins directory)
      HelpCenter\        (This is the directory where you put all the help files you make)
        HCdefault.txt  (The generic help file specific for the players not in the builder or admin groups)
        helpcenter.txt  (The HelpCenter index of commands for the players not in the builder or admin groups)
        helpcenter\        (This is the plugin directory with files for each command. This is a fallback directory if a file is not found in the specific group directory.)
          help
          helpp
          buildhelpfiles
          buildhelpfile
        builder\             (Directory specific to the Builder Permission group)
          HCdefault.txt  (The generic help file specific for the Builder group)
          helpcenter.txt  (The HelpCenter index of commands for the builder group)
        admin\
          HCdefault.txt  (The generic help file specific for the Admin group)
          helpcenter.txt  (The HelpCenter index of the commands for the admin group)
          helpcenter\
            buildhelpfiles  (the help file for the "buildhelpfiles" command that is custom for admin group. This will be displayed to the admin group instead of the generic one.)
    
    The Builder group will see only two available commands, and the Admin will see all four.
     
  29. Offline

    weasel5i2

    Great work, The_Nut! Updated thread, links and changelog :)

    I can't remember if I amended the colour code interpreter before or after the merge with your changes.. I think I did it after.. It has also been suggested that it be changed again to "#_" instead of "&_". Which colour format do most other plugins use?
     
  30. Offline

    The_Nut

    There may be a way to get it both of them to work. I will look into it.

    HelpCenter v1.74 download link

    This will now support the new style and old style color tags.

    &0 or #!k = black​
    &1 or #!b = blue (lo)
    &2 or #!g = green (lo)
    &3 or #1c = cyan (lo)
    &4 or #!r = red (lo)
    &5 or #!m = magenta (lo)
    &6 or #!y = yellow (lo)
    &7 or #!w = white (lo) = light grey
    &8 or #!K = black (hi) = dark grey
    &9 or #!B = blue (hi)
    &a or #!G = green (hi)
    &b or #!C = cyan (hi)
    &c or #!R = red (hi)
    &d or #!M = magenta (hi)
    &e or #!Y = yellow (hi)
    &f or #!W = white (hi)
     
    chlitto likes this.
  31. Offline

    jamdis

    Hey Weasel and Nut. This plugin is amazing. I started using the HTTP function to point at and execute PHP scripts. Now my players can trigger all sorts of zany events. For example, I'm using the TriggerCMDS plugin to run a HelpCenter request when a button is pressed. The HelpCenter command runs a PHP script that sends a little pre-written update to twitter.
    So. much. fun.
    Any chance that in a future version there could be the ability to pass certain data, such as username, world, etc. as GET or POST variables in the HTTP request? Or maybe someone else could create a cURL-like plugin?
    Sorry to beg like this. The plugin is already phenomenal. :) I'd do it myself, but I have zero java chops.
     

Share This Page