blob: dc7b6c0bbb02c107b33e66ebbca71a63934bffdc [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra715ec202025-07-09 22:18:31 +02002 string query_command(void)
MG Mud User88f12472016-06-24 23:31:02 +02003
Zesstra715ec202025-07-09 22:18:31 +02004DESCRIPTION
5 Give the text of the current command, or 0 if not executing
6 from a command.
MG Mud User88f12472016-06-24 23:31:02 +02007
Zesstra715ec202025-07-09 22:18:31 +02008 The text is the command as seen by the parser, ie. after
9 modify_command and after stripping trailing spaces.
MG Mud User88f12472016-06-24 23:31:02 +020010
Zesstra715ec202025-07-09 22:18:31 +020011 query_command() returns 0 when invoked by a function which was started
12 by a call_out or the heart beat. Also when a user logs in
13 query_command() returns 0.
MG Mud User88f12472016-06-24 23:31:02 +020014
Zesstra715ec202025-07-09 22:18:31 +020015EXAMPLES
Zesstrad59c3892019-11-28 20:53:39 +010016 void init() {
Zesstra715ec202025-07-09 22:18:31 +020017 ...
18 add_action("sing","sing");
19 ...
MG Mud User88f12472016-06-24 23:31:02 +020020 }
Zesstrad59c3892019-11-28 20:53:39 +010021 int sing(string str) {
Zesstra715ec202025-07-09 22:18:31 +020022 write("Your command was:"+query_command()+"\n");
23 return 1;
MG Mud User88f12472016-06-24 23:31:02 +020024 }
25
Zesstra715ec202025-07-09 22:18:31 +020026 When ever you type "sing ..." you get "Your command was: sing ...".
MG Mud User88f12472016-06-24 23:31:02 +020027
Zesstra715ec202025-07-09 22:18:31 +020028SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020029 add_action(E), query_verb(E)