From the NannyMUD documentation

LAST CHANGE

2001-01-06

FUNCTION


NAME

        heart_beat - called every 2 seconds in objects

LOCATION

	/obj/living.c, and can be placed in any object.

SYNTAX

void heart_beat();

DESCRIPTION

	When a true value is passed to set_heart_beat(E), then the driver
	starts to call heart_beat() in that object every 2 seconds until
	it is shut off.
	This can be shut off by passing 0 to set_heart_beat, or will 
	be shut off if an error occurs.

NOTE

	Try not to have objects with heart_beat running continuously.  It
	is rather costly in cpu usage.  Instead, you might want to shut it
	off if no interactive players are nearby.

	If the object in which the heart_beat is running is living, then
	everytime heart_beat is called, this_player() will return the
	object.  If it is not alive, this_player() will return 0.
	Error messages, accordingly, will be either printed to the object
	or to nobody.

	If you just want to print out a message or two after some delay,
	use the call_out(E) efun.

EXAMPLE

	In some silly object.
	object owner; /* An external variable */

	void reset(int arg) {
	   if( !arg ) {
	      owner = this_player(); /* See NOTES above for reason */
	      set_heart_beat(1);
	   }
	}

	void heart_beat() {
	   tell_object(owner, "Your heart goes DUNK DUNK.\n");
	}

SEE ALSO

        set_heart_beat in efun/object_related/set_heart_beat

SEE ALSO

        call_out in efun/object_related/call_out

SEE ALSO

        enable_commands in efun/object_related/enable_commands