Event Functions for Mocha
Note that events and messages can never be created in do_finish, and that
only functions running at God level can create events or messages in
do_start.
- event add_event (room rm, person mob, object obj, entity ent, integer
type, integer delay);
- event add_event_unchecked (room rm, person mob, object obj, entity ent,
integer type, integer delay);
- Adds an event to fire in delay pulses. delay must be
greater than 0. The item on which the current function is running must be
sent in the appropriate argument slot: rm, mob, or obj.
Any valid entity can be passed as the ent argument, and except as
noted previously, the first four arguments all accept the value none.
The type of the event is user-defined and is passed to the do_event
handler when the event occurs. Unless the event is unchecked, an item
may have only one event extant at any time.
- event send_message (entity target, entity ent1, entity ent2, entity ent3,
integer type);
- event send_message_unchecked (entity target, entity ent1, entity ent2,
entity ent3, integer type);
- Sends a message to the target. The second through fourth
arguments all accept the value none. The type of the message
is user-defined and is passed to the recv_message handler when the message
is received. Unless the message is unchecked, an item may have only one
message extant at any time.
- integer evt.time;
- Returns the number of pulses until the event evt occurs.
- void reschedule (event evt, integer delay);
- Reschedules an event to occur after delay pulses. delay
must be greater than 0.
- void evt.destroy;
- Cancels the event evt.
Return to Mocha's Main Page