cmd_misc
index
/Users/hollis/Desktop/nakedmud/lib/pymodules/cmd_misc.py

################################################################################
#
# cmd_misc.c
#
# a collection of miscellaneous commands that come with NakedMud(tm)
#
################################################################################

 
Modules
       
event
mudsys

 
Functions
       
add(...)
add(type, function)
 
Register a new hook function. Hook functions should take one argument:
an information string that can be parsed with hooks.parse_info
add_cmd(...)
add_cmd(name, shorthand, cmd_func, user_group, interrupts_action)
 
Add a new command to the master command table. If a preferred shorthand
exists, e.g., 'n' for 'north', it can be specified. Otherwise, shorthand
should be None. Command functions take three arguments: a character
issuing the command, the command name, and a string argument supplied
to the command. Commands must be tied to a specific user group, and they
can optionally interupt character actions.
add_cmd_check(...)
add_cmd_check(name, check_func)
 
Add a new command check to a registered command. Check functions take
two arguments: the character issuing the command, and the command name.
If a check fails, it should return False and send the character a
message why.
build_info(...)
build_info(format, args)
 
Returns hook information from a string format and a tuple of values for
the format.
chk_can_save lambda ch, cmd
cmd_clear(ch, cmd, arg)
This command will clear your display screen.
cmd_delay(ch, cmd, arg)
Usage: delay <seconds> <command>
 
Allows the user to prepare a command to be executed in the future. For
example:
 
> delay 2 say hello, world!
 
Will make you say 'hello, world!' two seconds after entering the
delayed command.
cmd_motd(ch, cmd, arg)
This command will display to you the mud's message of the day.
cmd_quit(ch, cmd, arg)
Attempts to save and log out of the game.
cmd_save(ch, cmd, arg)
Attempt to save your character and all recent changes made to it, to
disk. This automatically happens when logging out.
cmd_stop(ch, cmd, arg)
If you are currently performing an action (for example, a delayed
command), make an attempt to stop performing that action.
erase_global(...)
erase_global(name)
 
Delete a value from the global variable table.
event_delayed_cmd(ch, filler, cmd)
used to perform delayed commands
extract(...)
extract(thing)
 
Extracts an object, character, or room from the game.
format_string(...)
format_string(text, indent=True, width=80)
 
Format a block of text to be of the specified width, possibly indenting
paragraphs.
generic_find(...)
Deprecated. Use mud.parse_args instead.
get_global(...)
get_global(name)
 
Return a non-persistent global variable, or None.
get_greeting(...)
get_greeting()
 
returns the mud's connection greeting.
get_hour(...)
get_hour()
 
Return the current in-game hour of day.
get_motd(...)
get_motd()
 
Returns the mud's message of the day.
get_time(...)
get_time()
 
Return time of day (morning, afternoon, evening, night).
is_afternoon(...)
True or False if it is afternoon.
is_evening(...)
True or False if it is evening.
is_morning(...)
True or False if it is morning.
is_night(...)
True or False if it is night.
is_race(...)
is_race(name)
 
Returns True or False if the string is a valid race name.
ite(...)
ite(logic_statement, if_statement, else_statement=None)
 
A functional form of if/then/else.
keys_equal(...)
keys_equal(key1, key2)
 
Returns whether two world database keys are equal, relative to the
locale (if any) that the current script is running in.
list_races(...)
list_races(player_only=False)
 
Return a list of available races. If player_only is True, list only the
races that players have access to.
log_string(...)
log_string(mssg)
Send a message to the mud's log.
message(...)
message(ch, vict, obj, vobj, show_invis, range, mssg)
 
Send a message via the mud messaging system using $ expansions. Range
can be 'to_room', 'to_char', 'to_vict', or 'to_world'.
parse_args(...)
parse_args(ch, show_usage_errors, cmd, args, format)
 
equivalent to parse_args written in C. See parse.h for information.
parse_info(...)
parse_info(info)
 
Returns a tuple of parsed hook information.
remove(...)
remove(type, function)
 
Unregister a hook function.
run(...)
run(hooktypes)
 
Runs hooks registered to the given type.
set_global(...)
set_global(name, val)
 
Sets a non-persistent global variable. Val can be any type.