Manual:DIL Manual/sendtext()

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:21, 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

sendtext()

Procedure. Sends a text to one character's screen, exactly as it is.

sendtext(text : string, u : unitptr)

The plain way to talk to one player. Nothing is added or filled in: end each line with <br/> yourself, and put names in with +. Text in the game is HTML; the web client shows it as such, and a telnet player gets it turned into plain text with their colours.

Parameters

Name Type Meaning
text string The text, with <br/> where lines end.
u unitptr The character to send it to.

Notes

  • It reaches whoever is connected to u: a player, or the god switched into an
 NPC. To an NPC with nobody in it, an object, a room or null it sends nothing, and an empty
 text sends nothing.
  • Unlike act() it ignores whether u is asleep or can
 see anything; use act() for what happens in the room, so that each one sees names as they
 should.
  • For long text that should be shown a page at a time, use
 pagestring().

Example

dilbegin who_follows(pc : unitptr);
var
   mast : unitptr;
code
{
   mast := pc.master;
   if (mast == null)
      sendtext("You are not following anyone.<br/>", pc);
   else
      sendtext("You are following " + mast.name + ".<br/>", pc);
   quit;
}
dilend

Tells a player whom they follow, as the follow command in commands.zon does.

See also