From the NannyMUD documentation

LAST CHANGE

2002-07-21

NAME

        msg.examples - Examples on the usage of /std/msg.c.

DESCRIPTION

        This document provides a few examples on the usage of /std/msg.c.
        You should read the man page for msg to understand the examples.

NOTE

        In most cases, PRON and OBJ will generate the same strings but if the
        first person(s) can also be the second person(s) then you should make
        sure to use OBJ instead of PRON, to get the proper reflexive pronouns.

        A bad example of this, if target is this_player(), would be:
        "/std/msg" -> msg("\bPRON smile\b$ happily at \b2PRON.", 0, target);
        The first person will see:
          You smile happily at you.
        Everyone else will see:
          Mickey smiles happily at Mickey.

        The correct way would be:
        "/std/msg" -> msg("\bPRON smile\b$ happily at \b2OBJ.", 0, target);
        The first person will see:
          You smile happily at yourself.
        Everyone else (third person) will see:
          Mickey smiles happily at himself.

NOTE

        In the examples below, the first person would be referred as Mickey
        and the second person as Minnie. In the cases where target has been
        used, we assume it is the player object Minnie.

EXAMPLE

        These are a few simple examples of how to use msg:

        "/std/msg" -> msg("\bPRON smile\b$ happily.");
        The first person will see:
          You smile happily.
        Everyone else (third person) will see:
          Mickey smiles happily.

        "/std/msg" -> msg("\bPRON poke\b$ \b2OBJ on the nose.", 0, target);
        The first person will see::
          You poke Minnie on the nose.
        The second person will see:
          Mickey pokes you on the nose.
        Everyone else (third person) will see:
          Mickey pokes Minnie on the nose.

        "std/msg" -> msg("\bPRON \bis now a Wizard.", 0, 0, 
                         users() - ({ this_player() }));
        The first person will see:
          You are now a Wizard.
        Everyone else (third person) will see:
          Mickey is now a Wizard.

        "/std/msg" -> 
          msg("\bPRON tickle\b$ \b2OBJ with \bposs feather.", 0, target);
        The first person will see:
          You tickle Minnie with your feather.
        The second person will see:
          Mickey tickles you with his feather.
        Everyone else (third person) will see:
          Mickey tickles Minnie with his feather.

        "/std/msg" ->
           msg("\bPOSS nose gives off a flash of bright pink light.");
        The first person will see:
          Your nose gives off a flash of bright pink light.
        Everyone else (third person) will see:
          Mickey's nose gives off a flash of bright pink light.

        "/std/msg" -> msg("\bPRON hug\b$ \b2OBJ and kiss\b$$ \b2obj on " +
                          "the nose.", 0, target);
        The first person will see:
          You hug Minnie and kiss her on the nose.
        The second person will see:
          Mickey hugs you and kisses you on the nose.
        Everyone else (third person) will see:
          Mickey hugs Minnie and kisses her on the nose.

EXAMPLE

        This is an example of how to use the {a|b} identifier and the cap
        modifier:
 
        "/std/msg" -> 
          msg("\bPRON love\b$ \b2OBJ \b{truly, madly, deeply|immensely}. " +
              "\bcappron \b{really do!|looks serious.}", 0, target);
        The first person will see:
          You love Minnie truly, madly, deeply. You really do!
        The second person will see:
          Mickey loves you immensely. He looks serious.
        Everyone else (third person) sees:
          Mickey loves Minnie immensely. He looks serious.

        Note that the cap modifier has been used in the second sentence and not
        in the first, since the beginning of messages are always capitalized.

EXAMPLE

        This is an example of how to use \b| separators:
    
        "/std/msg" -> 
          msg("Something grows in your pants when you look at \b2OBJ.\b|" +
              "Your attention is suddenly drawn towards \bOBJ and you " +
              "wonder if that's a banana in \bposs pocket or is \bpron " +
              "just happy to see me?\b|When \bPRON looks at \b2OBJ " +
              "something seems to grow in \bposs pants.", 0, target);
        The first person will see:
          Something grows in your pants when you look at Minnie.
        The second person will see:
          Your attention is suddenly drawn towards Mickey and you wonder if
          that's a banana in his pocket or is he just happy to see me?
        Everyone else(third person) will see:
          When Mickey looks at Minnie something seems to grow in his pants.

EXAMPLE

        This is an example of when the fix modifier may be used:

        "/std/msg" -> msg("Monster says: \bfixPRON, I hate you!");
        Everyone, including the first person, will see:
          Monster says: Mickey, I hate you!

EXAMPLE

 
        This is an example of when you might want to use the fifth argument
        echo in msg. The random message string may or may not contain a \b 
        tag but should in any case be displayed to all persons:

        messages = ({ "Monster says: Hi there!", 
                      "Monster says: What are you doing, \bfixPRON?", 
                      "Monster says: Hmm, I don't know you.",
                      "Monster grabs \bPOSS hand and says: \bfixPRON, " +
                      "I love you!" });
        message = messages[random(4)];
        "/std/msg" -> msg(message, 0, 0, 0, 1);

SEE ALSO

        msg in std/text/msg
        msg in std/text/msg