evennia.commands.default.help

The help command. The basic idea is that help texts for commands are best written by those that write the commands - the admins. So command-help is all auto-loaded and searched from the current command set. The normal, database-tied help system is used for collaborative creation of other help topics such as RP help or game-world aides.

class evennia.commands.default.help.CmdHelp(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

View help or a list of topics

Usage:

help <topic or command> help list help all

This will search for help on commands and other topics related to the game.

key = 'help'
aliases = ['?']
locks = 'cmd:all()'
arg_regex = re.compile('\\s|$', re.IGNORECASE)
return_cmdset = True
help_more = True
suggestion_cutoff = 0.6
suggestion_maxnum = 5
msg_help(text)[source]

messages text to the caller, adding an extra oob argument to indicate that this is a help command result and could be rendered in a separate help window

static format_help_entry(title, help_text, aliases=None, suggested=None)[source]

This visually formats the help entry. This method can be overriden to customize the way a help entry is displayed.

Parameters
  • title (str) – the title of the help entry.

  • help_text (str) – the text of the help entry.

  • aliases (list of str or None) – the list of aliases.

  • suggested (list of str or None) – suggested reading.

Returns the formatted string, ready to be sent.

format_help_list(hdict_cmds, hdict_db)[source]

Output a category-ordered list. The input are the pre-loaded help files for commands and database-helpfiles respectively. You can override this method to return a custom display of the list of commands and topics.

check_show_help(cmd, caller)[source]

Helper method. If this return True, the given cmd auto-help will be viewable in the help listing. Override this to easily select what is shown to the account. Note that only commands available in the caller’s merged cmdset are available.

Parameters
  • cmd (Command) – Command class from the merged cmdset

  • caller (Character, Account or Session) – The current caller executing the help command.

should_list_cmd(cmd, caller)[source]

Should the specified command appear in the help table?

This method only checks whether a specified command should appear in the table of topics/commands. The command can be used by the caller (see the ‘check_show_help’ method) and the command will still be available, for instance, if a character type ‘help name of the command’. However, if you return False, the specified command will not appear in the table. This is sometimes useful to “hide” commands in the table, but still access them through the help system.

Parameters
  • cmd – the command to be tested.

  • caller – the caller of the help system.

Returns

True – the command should appear in the table. False: the command shouldn’t appear in the table.

parse()[source]

input is a string containing the command or topic to match.

func()[source]

Run the dynamic help entry creator.

help_category = 'general'
lock_storage = 'cmd:all()'
search_index_entry = {'aliases': '?', 'category': 'general', 'key': 'help', 'tags': '', 'text': '\n View help or a list of topics\n\n Usage:\n help <topic or command>\n help list\n help all\n\n This will search for help on commands and other\n topics related to the game.\n '}
class evennia.commands.default.help.CmdSetHelp(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

Edit the help database.

Usage:

help[/switches] <topic>[[;alias;alias][,category[,locks]] [= <text>]

Switches:

edit - open a line editor to edit the topic’s help text. replace - overwrite existing help topic. append - add text to the end of existing topic with a newline between. extend - as append, but don’t add a newline. delete - remove help topic.

Examples

sethelp throw = This throws something at … sethelp/append pickpocketing,Thievery = This steals … sethelp/replace pickpocketing, ,attr(is_thief) = This steals … sethelp/edit thievery

This command manipulates the help database. A help entry can be created, appended/merged to and deleted. If you don’t assign a category, the “General” category will be used. If no lockstring is specified, default is to let everyone read the help file.

key = 'sethelp'
switch_options = ('edit', 'replace', 'append', 'extend', 'delete')
locks = 'cmd:perm(Helper)'
help_category = 'building'
func()[source]

Implement the function

aliases = []
lock_storage = 'cmd:perm(Helper)'
search_index_entry = {'aliases': '', 'category': 'building', 'key': 'sethelp', 'tags': '', 'text': '\n Edit the help database.\n\n Usage:\n help[/switches] <topic>[[;alias;alias][,category[,locks]] [= <text>]\n\n Switches:\n edit - open a line editor to edit the topic\'s help text.\n replace - overwrite existing help topic.\n append - add text to the end of existing topic with a newline between.\n extend - as append, but don\'t add a newline.\n delete - remove help topic.\n\n Examples:\n sethelp throw = This throws something at ...\n sethelp/append pickpocketing,Thievery = This steals ...\n sethelp/replace pickpocketing, ,attr(is_thief) = This steals ...\n sethelp/edit thievery\n\n This command manipulates the help database. A help entry can be created,\n appended/merged to and deleted. If you don\'t assign a category, the\n "General" category will be used. If no lockstring is specified, default\n is to let everyone read the help file.\n\n '}