import mudpy
-def chat(actor):
+def chat(actor, parameters):
"""Toggle chat mode."""
mode = actor.get("mode")
if not mode:
if parameters and actor.owner:
# is the command word one for which we have data?
- if parameters in actor.universe.groups["command"]:
- command = actor.universe.groups["command"][parameters]
- else:
- command = None
+ command = mudpy.misc.find_command(parameters)
# only for allowed commands
if actor.can_run(command):
output = "$(red)"
else:
output = "$(grn)"
- output += parameters + "$(nrm) - " + description + "$(eol)$(eol)"
+ output = "%s%s$(nrm) - %s$(eol)$(eol)" % (
+ output, command.subkey, description)
# add the help text if provided
help_text = command.get("help")
actor.send(message)
-def quit(actor):
+def quit(actor, parameters):
"""Leave the world and go back to the main menu."""
if actor.owner:
actor.owner.state = "main_utility"
actor.owner.deactivate_avatar()
-def reload(actor):
+def reload(actor, parameters):
"""Reload all code modules, configs and data."""
if actor.owner: