command_control |
Discworld object help |
command_control |
Name
command_control - Function to handle different commands.
Syntax
int command_control(string verb, object *in_dir, string direct, string indirect,
mixed *args, string format)
Description
This function will be called by several command, in the future :). Right now it will be called, by the throw, and get commands. The verb will be the name of the command that called it, while the other arguments are similar to the arguments in add_command For better information about them, look at the docs in do_throw_at, do_get and add_command.
Return Value
Return 1 if the function handled the command, otherwise return 0.
See also
do_throw_at, do_get
Example
inherit "/std/object";
void setup() {
set_name("rock");
set_short("radioactive rock");
set_adjective("radioactive");
set_long("It's a small radioactive rock.\n");
} /* setup */
int command_control(string verb, object *in_dir, string direct, string indirect,
mixed *args, string format) {
if(verb == "throw") {
/* do whatever you want when someone wants to throw the object */
return 1;
}
if(verb == "get") {
/* do whatever you want when someone wants to get the object */
return 1;
}
return 0;
}