blob: ca8a086b73588d6cd0f449de54b81c0ba1fa84dc [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra715ec202025-07-09 22:18:31 +02002 string query_verb(void)
Zesstrad59c3892019-11-28 20:53:39 +01003 string query_verb(int flag)
MG Mud User88f12472016-06-24 23:31:02 +02004
Zesstra715ec202025-07-09 22:18:31 +02005DESCRIPTION
6 Return the verb of the current command, of 0 if not executing from
7 a command. If <flag> is 0 or not given, the verb as given by the user
8 is returned (this is the first word from the line input by the player,
9 up to but not including the first space or lineend). If <flag> is
10 non-0, the verb as specified in the add_action() statement is returned.
MG Mud User88f12472016-06-24 23:31:02 +020011
Zesstra715ec202025-07-09 22:18:31 +020012EXAMPLES
Zesstrad59c3892019-11-28 20:53:39 +010013 void init() {
Zesstra715ec202025-07-09 22:18:31 +020014 ...
15 add_action("sing","sing");
16 add_action("sing","chant", 1);
17 ...
MG Mud User88f12472016-06-24 23:31:02 +020018 }
Zesstrad59c3892019-11-28 20:53:39 +010019 int sing(string str) {
Zesstra715ec202025-07-09 22:18:31 +020020 write("Your command was: "+query_verb()+(str ? str : "")+"\n");
21 write("The action verb was: "+query_verb(1)+(str ? str : "")+"\n");
22 return 1;
MG Mud User88f12472016-06-24 23:31:02 +020023 }
24
Zesstra715ec202025-07-09 22:18:31 +020025 The command 'sing ...' will print:
26 Your command was: sing
27 The action verb was: sing
MG Mud User88f12472016-06-24 23:31:02 +020028
Zesstra715ec202025-07-09 22:18:31 +020029 The command 'chant ...' will print:
30 Your command was: chant
31 The action verb was: chant
MG Mud User88f12472016-06-24 23:31:02 +020032
Zesstra715ec202025-07-09 22:18:31 +020033 The command 'chantit ...' will print:
34 Your command was: chantit
35 The action verb was: chant
MG Mud User88f12472016-06-24 23:31:02 +020036
Zesstra715ec202025-07-09 22:18:31 +020037HISTORY
38 LDMud 3.2.9 added the optional flag argument.
MG Mud User88f12472016-06-24 23:31:02 +020039
Zesstra715ec202025-07-09 22:18:31 +020040SEE ALSO
Zesstrad59c3892019-11-28 20:53:39 +010041 add_action(E), query_command(E)