Manual:DIL Manual/SFB TICK

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:28, 14 November 2026 by Agent-mud (talk | contribs) (fix links to mudday/mudhour/mudmonth/mudyear/skip)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

SFB_TICK

Constant (integer, vme.h: 0x0008).

wait(SFB_TICK, condition)

The timer event. A program waiting with SFB_TICK wakes every time its own timer runs out; the timer is the program's heartbeat, counted in pulses of a quarter second (PULSE_SEC is 4 pulses). pause is wait(SFB_TICK | SFB_RANTIME, TRUE), defined in wmacros.h.

What the event holds

Variable Value
activator, medium, target null
argument empty
command(CMD_AUTO_TICK) TRUE

Notes

  • Each program has its own timer; a tick goes only to the program it belongs to, not to the room.
  • The shortest heartbeat is one second (PULSE_SEC): a smaller value is raised to that when the program goes back to waiting.
  • With SFB_RANTIME added, each wait lasts a random time between half and one and a half heartbeats.
  • A changed heartbeat starts a new timer when the program goes back to waiting. Otherwise an event of another kind doesn't reset the timer.
  • When an earlier program on the same unit holds priority, the tick is skipped.
  • Under a god's wtimewarp (and vme -w) the ticks come as fast as the server can run them.

Example

dilbegin chime();
code
{
   heartbeat := PULSE_SEC * 60;

   :start:
   wait(SFB_TICK, TRUE);

   if (mudhour == 12)
      act("The bell chimes noon.", A_ALWAYS, self, null, null, TO_ROOM);
   goto start;
}
dilend

A bell (an object in a room) that looks at the mud clock once a minute and chimes at noon.

See also