Manual:DIL Manual/nopriority

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:23, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

nopriority

Procedure. Ends the priority set by this program.

nopriority;

After nopriority, the unit's other programs get events again. When no priority is set it does nothing, so a program can call it at the top of its loop every time.

Notes

  • Call it before going back to waiting. A program that waits under priority keeps the unit's later programs dead while it waits.
  • Ending the program ends the priority too; no nopriority is needed before quit.

Example

dilbegin fnpri(FN_PRI_MISSION) john_assist();
external
   integer walk_room@function(s : string, i : integer);
var
   tf : integer;
   s : string;
code
{
   heartbeat := PULSE_SEC * 3;
   on_activation(self.position <= POSITION_SLEEPING, skip);

   :start:
   nopriority;
   wait(SFB_MSG, activator.nameidx == "mary");
   priority;
   s := argument;
   tf := walk_room@function("cabin@haon_dor", 4);
   exec("kill " + s, self);
   pause;
   exec("emote screams, 'Murderer, " + s + "!'", self);
   goto start;
}
dilend

John runs home to help his wife, with his random walking held back by priority until he goes back to waiting. From haon_dor.zon.

See also