blob: 96abdee6465a387791fd033e5d286ec59a161691 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 void heart_beat()
3
4DESCRIPTION
5 This function will be called automatically every
6 __HEART_BEAT_INTERVAL__ seconds. The driver will call the function
7 directly in the object, even if the function is being shadowed.
8
9 The start and stop of heart beat is controlled by the efun
10 set_heart_beat(). Be careful not to have objects with heart
11 beat running all the time, as it uses a lot of driver
12 resources. If there is an error in the heart beat routine, the
13 heart beat will be turned off for this object and the
14 master function heart_beat_error() is called. If the call
15 to the master function returns a non-zero value, the heart beat
16 will be turned back on again.
17
18 The function this_player() will return this object, but only if
19 it is living. Otherwise, this_player() will return 0.
20
MG Mud User88f12472016-06-24 23:31:02 +020021 Note that error messages will be given to the current user
22 which will be the object itself or nobody.
23
24EXAMPLE
25 object owner;
26 void create() {
27 ...
28 owner=this_player();
29 set_heart_beat(1);
30 }
31 void heart_beat() {
32 tell_object(owner, "Your heart goes: BUM BUM\n");
33 }
34
35 We have to use tell_object() because write goes to the current
36 user and this can only be the object itself or nobody.
37
38HISTORY
39 LDMud 3.3.687 made the interval time configurable at driver compile
40 time (used to be 2 seconds fixed).
41
42SEE ALSO
43 set_heart_beat(E), call_out(E), enable_commands(E),
44 heart_beat_error(M)