[INACTIVE][GEN] HelpPages 1.4 [612] Custom index and sub /help pages

Discussion in 'Inactive/Unsupported Plugins' started by Jonbas, Feb 15, 2011.

  1. Offline

    Jonbas

    Download


    Overview:
    This plugin overrides the /help command to allow a two tiered /help file that is fully customizable from a help.txt file.

    If a user types "/help" they will see something like the following:

    [​IMG]

    and then if they used "/help server" they would see this:

    [​IMG]

    Usage:

    The help.txt file is laid out like follows:
    Code:
    [Server, <Page> - Server Commands]
    /help, <Page> - Shows a list of commands. 7 per page.
    /playerlist
    /kit, [Kit] - Gives a kit. To get a list of kits type /kit
    /motd, - Displays the MOTD
    
    #add an extra text line and blank line to help page
    [;Some extra help text]
    [;]
    
    [Position, <Page> - Commands for movement:mods]
    ;Commands for movement:
    /spawn, - Teleports you to spawn
    /home, - Teleports you home
    /sethome, - Sets your home
    /listwarps, - Gives a list of available warps
    /warp, [Warp] - Warps to the specified warp.
    /getpos, - Displays your current position.
    /compass, - Gives you a compass reading.
    Define your own help message by using the format:
    /command, your help message

    Lines that start with the ; character will just be added as plain text without checking for a command. This can also be used to add blank lines.


    In the config above the page server will be visible to the default user group and the page position will be visible to the group mods. More than one group can be added by separating the group names with a comma like so: vip,mods,admins


    Installation

    Copy the HelpPages.jar to the plugins directory reload your plugins. It will create all the needed files the first time it runs. You can then edit your plugins/HelpPages/help.txt file to suit your server.

    Version History
    v1.4
    • Works on RB612 and with Permissions and GroupManager
    v1.2
    • Fixed GroupManager connections. Now supports Permissions 2.5 as well.
    v1.1
    • GroupManager integration added (optional)
    v1.0
    • Updated for craftbukkit 450 (Minecraft 1.3)
    • Using newest onCommand and plugin constructors
    • No feature changes, but required for craftbukkit compatibility.
    v0.9
    • Initial port from hMod
    • Removed implementation of groups and permissions
    v0.9.1
    • Fixed major bug. If you have downloaded the original version this is a required update or all of your other plugins will stop responding to player commands.
     
    Pallanas, Graloth and davispuh like this.
  2. Offline

    Jonbas

    Code:
    [Server, <Page> - Server Commands]
    /help, <Page> - Shows a list of commands. 7 per page.
    /playerlist
    /kit, [Kit] - Gives a kit. To get a list of kits type /kit
    /motd, - Displays the MOTD
    
    Take the above for example. If your help.txt only contained that bit of code you would see this when you typed /help:

    Server <Page> - Server Commands

    And when you typed /help server (not case sensitive) you would get:

    /help <Page> - Shows a list of commands. 7 per page.
    /playerlist
    /kit [Kit] - Gives a kit. To get a list of kits type /kit
    /motd - Displays the MOTD

    So any time you see a section heading in [] brackets, that will appear on your default /help list. The command in the brackets before the comma, in this case Server, is the name of the page that will show the sub-section of help commands listed below it.
     
  3. Offline

    The24man

    Thanks, that really helped a lot.
     
  4. Offline

    KingofTown

    Perhaps I'm missing something here, but I too am trying to do different pages. Here is an example of my help.txt

    Code:
    [Plugin, - Version X.Y.Z]
    ;Page 1 - This table of Contents
    ;Page 2 - What is it
    ;Page 3 - How to use it
    ;Page 4 - More Information
    ;Page 5 - Blah
    ;Page 6 - Blah blah
    [;]
    [;]
    [;]
    ;Page 2 - What is it
    ;This page has a few lines about what this plugin
    ;does.
    [;]
    [;]
    [;]
    [;]
    ;Page 3 - How to use it
    
    ...etc

    However, when I do /help Plugin, it only shows up as 1 page. I tried switching from [;] to just ;. This was promising as now I have 6 pages, but they aren't spacing right. For example

    Code:
    ;Page 2 - What is it
    ;This page has a few lines about what this plugin
    ; does
    ;
    ;
    ;
    ;
    
    ;Page 3 - How to use it
    ;blah
    ;blah
    
    shows up as:
    Page 2 - What is it
    This page has a few lines about what this plugin
    does

    Page 3 - How to use it
    blah
    blah

    In other words, it only returns on the first ;, but ignores all the others. I even tried adding whitespace after the ;, but this too is ignored.
    Doing
    ;.
    ;.
    ;.
    ;.
    for 4 returns only does a single . and ignores all others!
    I only want different pages! :/


    P.S. In an unrelated note, the following shows up in CraftBukkit 53
    2011-02-22 00:02:04 [WARNING] Using the stupidly long constructor net.centerleft
    .jonbas.bukkit.helppages.HelpPages(PluginLoader, Server, PluginDescriptionFile,
    File, File, ClassLoader) is no longer recommended. Go nag the plugin author of H
    elpPages to remove it! (Nothing is broken, we just like to keep code clean.)
     
  5. Offline

    Jonbas

    Thanks for the note. Good lord, I can't wait for them to standardize this thing.

    But back to your main point. I can see that you are getting confused with the format. For your example above, if you want Page1, Page2, Page3, etc.. to be the names of your sub pages, you should setup the file like this:

    Code:
    # ; at the beginning because this is a comment, not an index page
    [;Plugin - Version X.Y.Z]
    
    # One word followed by a , defines the name of the index.
    [Page1, - This table of Contents]
    [Page2, - What is it]
    ;This page has a few lines about what this plugin
    ;does.
    
    [Page3, - How to use it]
    ;blah
    ;blah
    ;blah
    
    
    Give it a try and see if that makes any sense for you.
     
  6. Offline

    KingofTown

    They should know how it feels when the API changes (Beta 1.3!!!).

    I think I understand the sub pages part. What I am trying to do is force different sub pages to be multiple pages. Maybe I'll just post what I'm currently trying to do....
    Code:
    
    [Plugins, <Page> - A list of currently installed plugins]
    WorldGuard,  - Version 3.2.3
    WorldEdit,  - Version 3.2.2
    PumpkinDiver, - Version 0.14
    WarpGate, - Version 1.4
    MosterTamer,  - Version 1.0
    HeroicDeath, - Version 1.4.1
    ;
    
    
    [Server, <Page> - A list of server commands]
    /help, - displays this help page
    /playerlist, - shows a list of players on the server
    
     
    [WorldGuard, <page> - Protects the world from YOU!]
    ;For some reason, this updated version lets creeper explosions hurt again.
    ;For now, I disabled creeper spawning until this is fixed.
    ;Protects the world from stuff...like fire spread, etc
    
    
    [WorldEdit, <page> - Needed for WorldGuard]
    ;Does a lot of things.... Let me know of something you
    ; would want permissions for.
    
    
    [PumpkinDiver, - Breathe Underwater!]
    ;With a pumpkin on your head, you can breath longer
    ;under water. The GUI still shows air running out but
    ;the actual remaining air is displayed in the text
    
    
    [WarpGate, <page> - Create a fargate]
    /wg, - display this plugin menu
    /warpgate, - also displays this menu
    ;only Moderators can place/link gates
    
    
    [MonsterTamer, <page> - Catch em all]
    ;Page 1 - Table of Contents
    ;Page 2 - What it is
    ;Page 3 - How to do it
    ;Page 4 - Success Rate
    ;Page 5 - ItemBonus
    ;Page 6 - MonsterBonus
    ;
    
     
    [What it is:]
    ;Catch/Release Mobs! Use item to try and catch a mob
    ;and release it as you see fit. Scare your friends with
    ;a creeper, attack your enemies with a flood of spiders,
    ;and keep a ready stock of pigs to populate your farm.
    ;
    
    
    [How to do it:]
    ;Swing your arm while holding one of the defined items at
    ;any monster. This will attempt to catch the monster - you
    ;will be told when this happens. To release the monster,
    ;simply throw (using q) an item of the defined type at the
    ;ground - the monster will appear and the item consumed.
    ;/ms to show the monsters you currently have
    ;
    
    
    ;Success Rate:
    ;The formula is as follows
    ;a =(3*MaxHealth-2*CurrentHealth)*MonsterBonus*ItemBonus/
    ;                 3*MaxHealth
    ;Catch Rate: a/256*100
    ;
    
    
    ;ItemBonus:
    ;Yellow Flower - Item Bonus 1
    ;Bread - Item Bonus 2
    ;Book - Item Bonus 3
    ;Diamond - Item Bonus 255 (never fail)
    ;
    
    
    ;MonsterBonus:
    ;Chicken:40 Cow:40 Creeper:25 Ghast:30 Pig:40 PigZombie:30
    ;Sheep:40 Skeleton:30 Slime:25 Spider:30 Squid:38 Zombie:30
    ;
    ;
    ;
    
    
    [HeroicDeath, Don't Die]
    ;Displays messages when you DIE for all to see and laugh at
    
    Right now, the MonsterTamer subpage isn't working how I would like. I want the user to be able to type
    /help MonsterTamer 3
    to jump to page 3 "How to do it" of the monster tamer sub page

    I think this would be easy enough, but I can't seem to put multiple line breaks. Your code seems to ignore anything that is the same as a previous line. For example:

    ;
    ;
    ;
    ;
    ;
    will only be 1 blank line and

    ;#
    ;#
    ;#
    ;#
    ;#
    will only be 1 line showing a #.

    The only way I've found to force multiple pages is

    ;Page 1
    ;blah
    ;#
    ;##
    ;###
    ;####
    ;#####
    ;

    ;Page 2
    ;blah2
    ;###### <-- Cant match a line above...or it too is ignored!
    ;#######
    ;########


    Anyway, sorry for the lengthy posts, and thanks for the help!
     
  7. Offline

    Jonbas

    Hmm... it's true. It does ignore exact duplicate lines. That was an artifact of checking command permission in the hMod version. I'll look into changing this, but it might be a pretty major surgery to the code, so probably won't get anything out until this weekend.

    In the meantime, you might try putting different number of spaces on the ; lines. I can't remember if that will be a work around for you or not, but it's worth a try until I get back into the code.
     
  8. Offline

    KingofTown

    Ha...I didn't even think of different number of spaces [​IMG]. I remember trying to add alt_255 to see if that was different, and it worked for one extra line break, but not subsequent (this before I determined duplicate lines were skipped). I will go ahead and try it again for now.

    Either way, thanks for the plugin. This was something I've been looking for ever since my friends have been bugging me about which plugins I had installed and what commands they have available. [​IMG]
     
  9. It seems that permissions check doesn't work, here is my help.txt.
    For some reason, even guests can see and use all /help commands.

    Code:
    #HelpPages Default Help File
    #
    #
    [Basic, <Page> - Basic Commands]
    /help, <Page> - Shows a list of commands. 7 per page.
    /who, - Displays a list of online players.
    /motd, - Displays the Message of The Day.
    /rules, - Displays the server Rules.
    /news, - Displays the server News.
    /kit, [kit] - Gives you a kit, or displays list of kits.
    
    [Position, <Page> - Position related Commands]
    /getpos, - Displays your current position.
    /compass, - Gives you a compass reading.
    /warp, [warp] - Sends you to [warp] or shows list if empty.
    /spawn, - Sends you to Spawn location.
    /home, - Sends you to your home.
    /sethome, - Sets your home to your current location.
    /tpaccept, - Accept teleportation request.
    /tpdeny, - Deny teleportation request.
    /back, - Returns you to your last position.
    
    [Social, <Page> - Social and Chat Commands]
    /afk, - Marks your as being away, or removes said mark.
    /msg, <player> <message> - Send a private message to <player>.
    /r, - Quick reply to latest private message.
    /me, <message> - Make an IRC style chat emote.
    
    [AdvBuilder, <Page> - Your special Commands:AdvBuilder]
    /mc, - Gives you a magic carpet, so you can fly
    /top, - Teleports you to the highest block at your current location.
    /depth, - Displays your current block depth in relation to sea-level.
    
    [VIP, <Page> - Your special Commands:VIP]
    /mc, - Gives you a magic carpet, so you can fly
    /top, - Teleports you to the highest block at your current location.
    /depth, - Displays your current block depth in relation to sea-level.
    /god, [player] - Make yourself or <player>, invulnerable.
    /heal, [player] - Heal yourself or <player>.
    /give, <player> <item> [amount] - Give item to another player.
    /item, <item> [amount] - Give yourself items.
    /tpa, <player> - Request permission to teleport to <player>.
    /tpahere, <player> - Request permission to teleport <player> to you.
    /tp, <player> - Teleport to <player>.
    /tphere, <player> - Teleport <player> to you.
    
    [Moderator, <Page> - Server moderation Commands:Moderator]
    /setspawn, - Sets the Spawn location to your current location
    /spawnmob, [Mob] [amount] - Spawns mobs, or displays available mobs.
    /broadcast, <message> - Broadcast a message to the entire server.
    /kill, <player> - Kill a player.
    /time, <day|night> - set the time to day or night.
    /setwarp, <warp> - Create <warp> at your current location.
    /delwarp, <warp> - Delete <warp>.
    /kick, <player> - Kicks <player> from the server.
    /kickall, - Kicks all players from the server.
    /ban, <player> - permanently bans <player>.
    /unban, <player> - removes <player>'s permanent ban.
    /banip, <player> - permanently bans the IP of <player>.
    /unbanip, <player> - removes <player> IP's permanent ban.
    /shift, <day|night|stop> - set time to loop day, night or stop the current loop.
    /clearinventory, [player] - Clears your inventory or that of [player].
     
  10. Offline

    Jonbas

    You are correct, a permissions check is a planned feature for the next release, but it's not ready yet.

    Sorry, i just checked my op and I see I didn't edit that part when I copied it over from hMod's forum. I'll work on getting permission integration out in the next couple days.
     
  11. Sounds awesome! can't wait :)
     
  12. Offline

    Jonbas

    Just released version 1.0. No feature changes, but fixes warnings in console and required update for newer versions of Craftbukkit.
     
  13. Offline

    Juze

    @Jonbas
    ETA on permissions check? Oh, and could you implement Permissions support from 2.0 to 2.4 and GroupManager support, thanks. :)
     
  14. Offline

    Jonbas

    Probably next weekend. (March 5th or so)

    I'm currently hip deep in another project, but that will probably be released in the next few days and then I'll come back.
     
  15. Offline

    Juze

    @Jonbas
    Just like DynamicMarket with DMWrapper, huh? :) I'd appreciate if you could update this plugin though, it's a smaller fix than doing a whole other plugin.
     
  16. Offline

    Jonbas

    hah. Alright, i'll see if I can do something tonight.
     
  17. Offline

    Juze

    Thanks, I'll be waiting. :)
     
  18. Offline

    Jonbas

    v1.1 Posted - Uses GroupManager to decide if a sub page should be presented to the user. Set it up like this:

    [Position, <Page> - Commands for movement:mods]

    All users that are in the group mods or that inherit the group mods will be able to see the Position page. More groups can be added with commas like so: builders,vip,admin
     
  19. AWESOME! now my helpfile is complete :D
     
  20. Offline

    amplifier

    Is it possible to make only one customizable help page with this?
    I only have 8 commands on my server, so i don't really need the subpages feature.
     
  21. Offline

    Jonbas

    it should work if you did something like this:

    PHP:
    [;/getpos, - Displays your current position.]
    [;/
    compass, - Gives you a compass reading.]
    [;/
    warp, [warp] - Sends you to [warp] or shows list if empty.]
    [;/
    spawn, - Sends you to Spawn location.]
    [;/
    home, - Sends you to your home.]
    [;/
    sethome, - Sets your home to your current location.]
    [;/
    tpaccept, - Accept teleportation request.]
    [;/
    tpdeny, - Deny teleportation request.]
    [;/
    back, - Returns you to your last position.]
     
  22. Offline

    amplifier

    Works like a charm, thanks :3

    I have to note that the maximum mumber of printed lines is 7.
     
  23. Offline

    Jonbas

    That's true. It should let you do /help [page #] though.
     
  24. Offline

    Pallanas

    Great work, I'm looking forward to colours and advanced configuration.
    It would be great if we could edit the auto-displayed message when somebody type /help :)
     
  25. Offline

    Giganox

    Hi,
    is permissions check still working?

    I'm using GroupManager.
    my goups.yml:
    Code:
     [...]
         vip:
            default: false
            info:
                build: true
                prefix: '&2'
                suffix: '&f'
            inheritance:
            permissions:
            - 'lwc.protect'
    
        mods:
            default: false
            info:
                build: true
                prefix: '&4'
                suffix: '&f'
            inheritance:
            - vip
            permissions:
            - 'groupmanager.*'
    [...]
    my help.txt:
    Code:
    [...]
    #A help page for the group Vip
    [vip, <Page> - Commands for Vip:vip]
    /getpos, - Displays your current position.
    /compass, - Gives you a compass reading.
    [;]
    
    #A help page for the group mods
    [group, <Page> - GroupManager Commands:mods]
    /manuadd,  <Player> <group>  -  Change player group to one desired.
    /manudel, <Player> - Take user to default group. Removes user specific permissions.
    /mangadd, <group> - Add group to the system.
    [;]
    [...]
    A user of the group vip is able to view the mods commands. but why???
     
  26. Offline

    JinkLeft


    same issue with 493 CB, still love the plugin though!
     
  27. Offline

    jeddeliso

    so wait, technically we all have to TYPE, all the commands in? well that sucked, now i have to write all this!
     
  28. Offline

    Jonbas

    Alright, just updated plugin to work with 493 and current GroupManager and Permissions. (Should probably work with 522 but I haven't tested it yet)
     
  29. Offline

    Codisimus

    haven't done much testing but now when i type /help it only lists the Admin commands. ill do sum more testing later and show to my help text
     
  30. Offline

    Jonbas

    Make sure your group inherits all of the other groups that you want to see. Otherwise you need to add explicit usernames to the pages.
     
  31. Offline

    Codisimus

    do i need to have :Default for each category?
    here is my text file
    Code:
    [Main, <Page> - Main Commands]
    ;    Main Commands:
    /motd - Displays the message of the day.
    /stats (player) - List stats of player.
    /played - Displays your playedfor-time.
    /listach (page) (#achievement) - List of achievments.
    /ach - List earned acievements.
    /lvl - Displays LevelCraft help page.
    /lwc - Displays LWC help page.
    /hunt - Sign up for the next event.
    /huntstatus - Display status of the plugin, current player score, and time until counting stops.
    /huntscore - Display player's personal highscore.
    /citizens help - Displays a list of npc commands.
    
    [Warp, <Page> - Warp Commands]
    /warp [name] - Warp yourself for 500 coins.
    /warpto [player] [name] - Warp target player for 500 coins.
    /listwarps - List all available warps.
    /setwarp [name] - Create a warp for 5000 coins.
    /removewarp [name] - Removes a warp for 500 coins.
    /home - Warp to your set home for 100 coins.
    /sethome - Sets your home for 2000 coins.
    /zmod list - Display a list of zones.
    
    [Econ, <Page> - Economy Commands]
    /bounty - Displays HeroBounty help page.
    /money - Check your balance.
    /money rank (player) - Rank on the topcharts.
    /money top (amount) - Richest players listings.
    /money pay [player] [amount] - Send money to another player.
    /shop create [name] - Creates a shop that is 3x3x3 in size for 5000 coins.
    /shop destroy [name] - Removes a shop.
    /shop add (all) (itemname) (quantity) - Stocks item in your hand to the shop.
    /shop remove [itemname] - Removes an item type from the shop.
    /shop list (buy or sell) -  List shop inventory.
    /shop sell (itemname) (amount or all) - Sells item in hand to the shop.
    /shop buy [itemname] [amount] - Buys item from the shop.
    /shop set buy [itemname] [price] (stack size) - Adds item to sell to the shop.
    /shop set sell [itemname] [price] (stack size) - Adds item to buy to the shop.
    /shop set manager (+player) (-player) - Edit managers of the shop.
    /shop set owner [player] - Transfers ownership to new player.
    
    [Mods, <Page> - Commands for Moderators:Mods]
    ;Commands for Admins only:
    /prefix [player] (prefix) (color) - adds a prefix to a player.
    /prefix list - display a list of colors.
    /zmod - display iZone help page.
    
    [Admin, <Page> - Commands for Admins:Admins]
    ;Commands for Admins only:
    /prefix [player] (prefix) (color) - adds a prefix to a player.
    /prefix list - display a list of colors.
    /zmod - display iZone help page.
    /zedit - display iZone help page.
    /huntstart [World name] - manually start hunt.
    /huntstop [World name] - manually stop hunt in selected world.
    /money grant [player] (-)(amount) - give a player money
    /money set [player] (balance) - set account balance of a player
    /money stats - view stats of players
    /money reset - reset all player accounts
    /shop reload - Reloads the config and shop files.
     

Share This Page