Difference between revisions of "LlInstantMessage"

From Second Life Wiki
Jump to navigation Jump to search
(Updated new length limit warning)
m (<lsl> tag to <source>)
Line 17: Line 17:


|examples=Tell the owner somebody touched the object:
|examples=Tell the owner somebody touched the object:
<lsl>
<source lang="lsl2">
default
default
{
{
Line 24: Line 24:
         llInstantMessage( llGetOwner(), "Someone touched me" );
         llInstantMessage( llGetOwner(), "Someone touched me" );
     }
     }
}</lsl>
}</source>
Send an IM to a detected avatar only
Send an IM to a detected avatar only
<lsl>
<source lang="lsl2">
default
default
{
{
Line 34: Line 34:
     }
     }
}
}
</lsl>
</source>
|helpers
|helpers
|also_functions=
|also_functions=

Revision as of 10:31, 22 January 2015

Summary

Function: llInstantMessage( key user, string message );
2.0 Forced Delay
10.0 Energy

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

• key user avatar UUID
• string message message to be transmitted

To send a message directly to an object, use llRegionSayTo.

Caveats

  • This function causes the script to sleep for 2.0 seconds.
  • All object IM's are throttled at a maximum of 2500 per 30mins, per owner, per region in a rolling window. this includes IM's sent after the throttle is in place
    • Throttled IM's are dropped. for implementation see notes below
  • Messages longer than 1175 bytes will be truncated to 1175 bytes. This can convey 1175 ASCII characters, or fewer if non-ASCII characters are present.
KBcaution.png Important: The 1175 byte limit is changing. As of Feb 26th, 2013 in all sims, Instant messages are now truncated to 1023 bytes to prevent certain types of delivery failure. (see https://wiki.secondlife.com/wiki/Release_Notes/Second_Life_Server/13#13.02.15.270481 ).
  • 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.)

Examples

Tell the owner somebody touched the object:

default
{
    touch_start( integer total_num )
    {        
        llInstantMessage( llGetOwner(), "Someone touched me" );
    }
}

Send an IM to a detected avatar only

default
{
    touch_start( integer total_num )
    {
        llInstantMessage( llDetectedKey(0), "Hands Off!");
    }
}

Notes

  • llRegionSayTo may be a better choice if the target is in the same region as the object sending the message, as it has no built-in delay and can communicate directly with objects, as well as with avatars and their attachments.
  • Instant Messaging allows communication from an object to an avatar anywhere on the Grid. However, an object cannot receive an Instant Message.
  • Using llInstantMessage from one or more child scripts will avoid delays in the main script. Child scripts will still be subject to delays, message queue limits, and region throttles.
  • Throttling Implementation (Kelly Linden):
    • The throttle is on all IMs from the object owner. It does not disable all IMs in the region, but does disable all IMs from the owner of the object.
    • The throttle is not per object, but per owner. Splitting the spamming object into multiple objects will not help unless owned by different people. This also means that owning multiple almost too spammy objects will cause you to hit the limit.
    • 2500 IMs in 30 minutes will trigger the block.
    • IMs that are blocked continue to count against the throttle. The IM count must drop below 2500 before any IMs will be delivered.
    • The IM count of the previous window is used to approximate the rolling window. If it is 20% into the current window the IM count will be the current count + 80% of the previous count. This allows us to approximate a rolling average, however it has the behavior that a flood of IMs can have an effect on the throttle for double the window length. This is why in practice the throttle behaves more like 5k in 1hr than 2.5k in 30min.

See Also

Functions

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

Deep Notes

Signature

function void llInstantMessage( key user, string message );