BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.5 support => Topic started by: ZoeF on March 10, 2008, 05:10:02 pm

Title: Make a help file
Post by: ZoeF on March 10, 2008, 05:10:02 pm
Hello everyone, i trold the forums alot but couldn't find any feedback on how 2 make a help file. I recently downloaded the loot module and puted it in the module folder. But whe i do !help loot in the bot it doesn't give me any info on the module itself. So i started to look around on how to make one. But i couldn't find any info.

Anyone who can give me some feedback on where to start searching or how 2 make one ?

Tnx in advance.
Title: Re: Make a help file
Post by: Alreadythere on March 10, 2008, 05:27:28 pm
Maybe the wiki (http://bebot.link/wiki/help_system) entry will help you. The current bebot versions don't use help files anymore, they got their help inside the module classes.
Title: Re: Make a help file
Post by: ZoeF on March 10, 2008, 07:15:24 pm
Code: [Select]
function Rolls (&$bot) {
$this -> bot = &$bot;
$this -> mode = "single";

//Sed default access control levels
$this -> bot -> accesscontrol -> create('tell', 'loot', 'GUEST');
$this -> bot -> accesscontrol -> create('gc', 'loot', 'GUEST');
$this -> bot -> accesscontrol -> create('pgmsg', 'loot', 'GUEST');

$this -> help['description'] = "Plugin to make a loot roll.";
$this -> help['command']['loot <item>'] = "Add item to the loot list.";
$this -> help['command']['list'] = "Makes a list of items curently rold.";
$this -> help['command']['clear'] = "Clear all items in the list.";
$this -> help['command']['add <number>'] = "Add <number> to choose what you want to win.";
$this -> help['command']['roll'] = "Roll all the items curently in the list.";
$this -> help['notes'] = "No notes.";
        }

Ok so i got it halfly to work. The strange thing is that it only shows the "first ( loot <item> )" command and the notes. What did i do wrong ? Even if i change the order of commands it stil only shows the loot <item>. And when we // the loot command it only shows the description of the list command and the notes.
Title: Re: Make a help file
Post by: Alreadythere on March 10, 2008, 07:22:58 pm
If you do !help loot you only get the help entry for loot, same for the other commands. If you do !help you'll see that all commands are at least listed.
There is no !help module command.
Title: Re: Make a help file
Post by: ZoeF on March 10, 2008, 07:30:43 pm
So i can't add the other function for that specific module in this file ? If so is there a way 2 add those things in the helpfile ?
Title: Re: Make a help file
Post by: Alreadythere on March 10, 2008, 07:51:44 pm
You could try something like the following:
Code: [Select]
$this -> help['description'] = "Plugin to make a loot roll.";
$this -> help['command']['loot'] = "Put a long explanation about the working and all the commands of this module here.";
$this -> help['command']['list'] = $this -> help['command']['loot'];
$this -> help['command']['clear'] = $this -> help['command']['loot'];
$this -> help['command']['add'] = $this -> help['command']['loot'];
$this -> help['command']['roll'] = $this -> help['command']['loot'];
That way you would get always the same text, and could list all commands inside one help text. This is a crude hack though, I'll try to add a way to list all commands of a single module, and show all their help texts in one blob.
Title: Re: Make a help file
Post by: Temar on March 10, 2008, 08:26:09 pm
wouldn't changeing the module to use subcommands be better? (assuming it doesn't looking at the help) eg !add is more of a general command not loot module . If you know what i mean
Title: Re: Make a help file
Post by: Temar on March 10, 2008, 08:29:08 pm
also !roll is the random number roll

If there are subcommands then you are doing the help wrong
Title: Re: Make a help file
Post by: Temar on March 10, 2008, 08:37:09 pm
and alreadythere won't what you posted just do the same description and they will still show just 1 command
Title: Re: Make a help file
Post by: Alreadythere on March 10, 2008, 08:46:20 pm
and alreadythere won't what you posted just do the same description and they will still show just 1 command
Yes, it's an ugly hack. But I think it's currently the only way to accomplish what ZoeF wants.
Title: Re: Make a help file
Post by: Alreadythere on March 10, 2008, 09:17:41 pm
I've added listing of all commands of a module to the help blobs.

Download the most current version of BotHelp for your bot version:
BeBot 0.4 (http://svn.shadow-realm.org/index.py/BeBot/branches/0.4/core/BotHelp.php?view=co), save as core/BotHelp.php
BeBot 0.5 (aka trunk version) (http://svn.shadow-realm.org/index.py/BeBot/trunk/main/05_BotHelp.php?view=co), save as main/05_BotHelp.php
SimplePortal 2.3.7 © 2008-2024, SimplePortal