Say something in world, and type

From libsecondlife

Jump to: navigation, search

Contents

How to make an avatar something in world and type as well

Reason

I thought that this method may be useful for some people who have not yet found a way to make their avatar's speak in-world realistically like another avatar would.

Code

 
//TypeChat method to make avatar do typing animation and sound
//Typing is the key for the typing animation
//delay is the time delay in milliseconds between the avatar beginning to type and sending the message and stopping the typing animation
//type is the ChatType to use, such at ChatType.Normal for regular avatar speaking
static void TypeChat(int delay, string say,int channel,ChatType type) 
        {
            LLUUID typing = new LLUUID("c541c47f-e0c0-058b-ad1a-d6ae3a4584d9");
            client.Self.AnimationStart(typing, true);
            Thread.Sleep(delay);
            client.Self.Chat(say, channel, type);
            client.Self.AnimationStop(typing, true);
        }
 

Contributions

Big thanks to Yohan Pintens for help.