MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 2 | void tell_object(object|string ob, string str) |
| 3 | void tell_object(object|string ob, |
Zesstra | 5481d49 | 2021-04-08 20:07:06 +0200 | [diff] [blame] | 4 | mixed *|mapping|struct|object|lwobject msg) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 5 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 6 | DESCRIPTION |
| 7 | Send a message str to object ob (which is looked up and if necessary |
| 8 | loaded if given by name). |
| 9 | |
| 10 | If the second argument is a string, the message will be printed |
| 11 | to <ob> if it is an interactive user, otherwise it will be passed to |
| 12 | the lfun catch_tell() of the target living. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 13 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 14 | If the second argument is an array/mapping/struct/object, it will be |
| 15 | passed to the lfun catch_msg() in the target. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 16 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 17 | EXAMPLES |
| 18 | object who; |
| 19 | who=find_player("wessex"); |
| 20 | tell_object(who, "Hi!\n"); |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 21 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 22 | Just tell Wessex a simple "Hi!". |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 23 | |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 24 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 25 | Object 1 (living with the name "dummymonster"): |
| 26 | void catch_tell(string str) { |
| 27 | write("Received: "+str+"\n"); |
| 28 | } |
| 29 | Object 2: |
| 30 | void func() { |
| 31 | object who; |
| 32 | who=find_living("dummymonster"); |
| 33 | tell_object(who, "Follow me, mortal one!\n"); |
| 34 | ... |
| 35 | } |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 36 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 37 | This examples shows how tell_object() together with |
| 38 | catch_tell() works. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 39 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 40 | HISTORY |
| 41 | LDMud 3.2.11 introduced the 'mixed *' form for symmetry reasons. |
| 42 | LDMud 3.3.686 added the use of a mapping/struct/object as second |
| 43 | argument. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 44 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 45 | SEE ALSO |
Zesstra | b6ac9f6 | 2020-01-21 11:11:16 +0100 | [diff] [blame] | 46 | write(E), say(E), catch_tell(A), catch_msg(A) |