LlInstantMessage - Second Life Wiki

LlInstantMessage

From Second Life Wiki

Jump to: navigation, search
([17:01] Andrew Linden: llInstantMessage was built to fit within one UDP packet (1.5kB))
m (Added new llRegionSayTo method for "see also" area)
Line 37: Line 37:
|helpers
|helpers
|also_functions=
|also_functions=
-
{{LSL DefineRow||[[llOwnerSay]]|}}
+
{{LSL DefineRow||[[llOwnerSay]]|Sends chat region wide to owner}}
{{LSL DefineRow||[[llRegionSay]]|Sends chat region wide}}
{{LSL DefineRow||[[llRegionSay]]|Sends chat region wide}}
 +
{{LSL DefineRow||[[llRegionSayTo]]|Sends chat region wide to an object/avatar}}
{{LSL DefineRow||[[llWhisper]]|Sends chat limited to 10 meters}}
{{LSL DefineRow||[[llWhisper]]|Sends chat limited to 10 meters}}
{{LSL DefineRow||[[llSay]]|Sends chat limited to 20 meters}}
{{LSL DefineRow||[[llSay]]|Sends chat limited to 20 meters}}

Revision as of 16:54, 25 June 2011

Contents

Summary

Function: llInstantMessage( key user, string message );

Sends an Instant Message specified in the string message to the user specified by key.

• key user avatar UUID
• string message

Caveats

  • This function causes the script to sleep for 2.0 seconds.
    • For applications where this is problematic, it's possible to place the call to llInstantMessage in a child script and pass the information to that script via llMessageLinked.
  • message will be truncated if it exceeds 1199 bytes.
  • message will appear in the chat window and will not logged by the InstantMessage logging facility. (If a the specified user is not signed it, the messages will be delivered to their email just like a regular instant message, if the user has enabled email for their account.)
All Issues ~ Search JIRA for related Bugs

Examples

Tell the owner somebody touched the object:

// This particular example is for demonstration only.
// Use llOwnerSay() for the same functionality, in case the owner is known to be in the same Region.
 
key owner;
 
default
{
    on_rez(integer start_param)
    {
        owner=llGetOwner();  // get the key of the objects owner.
    }
    touch_start(integer total_num)
    {        
        llInstantMessage(owner,llKey2Name(owner)+", " + (string)total_num +" Avatar(s) touched me!");
    }
}

Send a confirmation to the Avatar that touches an object without spamming other Avatars:

default
{
    touch_start(integer total_num)
    {        
        llInstantMessage(llDetectedKey(0),"You have been registered!");
    }
}

Notes

Instant Messaging has the benefit of allowing communication from an object to an avatar anywhere in the Grid. The downside is that an object cannot receive an Instant Message, therefore an avatar cannot send an Instant Message to an object. It's a one-way communication avenue. Also, the two-second script delay can be considered a downside in some applications.

See Also

Functions

•  llOwnerSay Sends chat region wide to owner
•  llRegionSay Sends chat region wide
•  llRegionSayTo Sends chat region wide to an object/avatar
•  llWhisper Sends chat limited to 10 meters
•  llSay Sends chat limited to 20 meters
•  llShout Sends chat limited to 100 meters

Deep Notes

All Issues

~ Search JIRA for related Issues
   llTargetSay() - region-wide direct communication
This article wasn't helpful for you? Maybe the related article at the LSL Wiki is able to bring enlightenment.