Zesstra | b6ac9f6 | 2020-01-21 11:11:16 +0100 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 2 | void tell_room(string|object ob, string str) |
| 3 | void tell_room(string|object ob, string str, object *exclude) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 4 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 5 | void tell_room(string|object ob, |
Zesstra | 5481d49 | 2021-04-08 20:07:06 +0200 | [diff] [blame] | 6 | mixed *|mapping|struct|object|lwobject msg) |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 7 | void tell_room(string|object ob, |
Zesstra | 5481d49 | 2021-04-08 20:07:06 +0200 | [diff] [blame] | 8 | mixed *|mapping|struct|object|lwobject msg, |
| 9 | object *exclude) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 10 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 11 | DESCRIPTION |
| 12 | Send a message <str> to all living objects in the room ob. ob |
| 13 | can also be the name of the room given as a string. If a |
| 14 | receiving object is not a interactive user the lfun |
| 15 | catch_tell() of the object will be invoked with the message as |
| 16 | argument. If living objects define catch_tell(), the string |
| 17 | will also be sent to that instead of being written to the |
| 18 | user. If the object is given as its filename, the driver |
| 19 | looks up the object under that name, loading it if necessary. |
| 20 | If array *exclude is given, all objects contained in |
| 21 | *exclude are excluded from the message str. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 22 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 23 | If the second arg is an array/mapping/struct/object, catch_msg() will |
| 24 | be called in all listening livings. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 25 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 26 | EXAMPLES |
| 27 | tell_object(environment(this_player()), "Hi!\n"); |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 28 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 29 | Just send a simple "Hi!" to all livings in the current. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 30 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 31 | Object 1 (living): |
| 32 | void catch_tell(string str) { |
| 33 | write("Received: "+str+"\n"); |
| 34 | } |
| 35 | Object 2: |
| 36 | void func() { |
| 37 | ... |
| 38 | tell_room(environment(this_player()), "HiHo!\n"); |
| 39 | ... |
| 40 | } |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 41 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 42 | This examples shows how tell_room() together with catch_tell() works. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 43 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 44 | HISTORY |
| 45 | LDMud 3.3.686 added the use of a mapping/struct/object as second |
| 46 | argument. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 47 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 48 | SEE ALSO |
Zesstra | b6ac9f6 | 2020-01-21 11:11:16 +0100 | [diff] [blame] | 49 | write(E), say(E), tell_object(E), catch_tell(A), catch_msg(A) |