Difference between revisions of "Manual:DIL Manual/SFB TICK"
Jump to navigation
Jump to search
(checked against the compiler and the interpreter; example compiles) |
(fix links to mudday/mudhour/mudmonth/mudyear/skip) |
||
| Line 47: | Line 47: | ||
* [[Manual:DIL Manual/wait()|wait()]] | * [[Manual:DIL Manual/wait()|wait()]] | ||
* [[Manual:DIL Manual/priority|priority]] | * [[Manual:DIL Manual/priority|priority]] | ||
| − | * [[Manual:DIL Manual/mudhour | + | * [[Manual:DIL Manual/mudhour|mudhour]] |
Latest revision as of 23:28, 14 November 2026
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_RANTIMEadded, 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(andvme -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.