Don't click here unless you want to be banned.

LSL Wiki : llInstantMessage

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl423.us.archive.org
llInstantMessage(key user, string message)

Sends an IM to user containing message and delays the script for 2 seconds. This delay exists to prevent IM spamming.

To message the object owner, llOwnerSay(messsage) is the best option as it does not delay the script.
To send a short message in a popup dialog box, consider using llDialog instead.

Objects can send, but not receive IMs. To send a message from one object to another - llEmail may be useful. Also see communications for methods for communicating with other scripts.

This call does not open a separate tab in the IM window as user-to-user IMs do. Instead, it prints to the chat history but is a private message that other agents within close range do not receive.

If the user has configured their account to send offline IMs to email, (Edit > Preferences > General, check "Send IM to E-mail") they will get offline messages sent to their email account. When the user logs in, they will recieve the message text. This will be the case regardless of whether or not they have the "Send IM to E-mail" option turned on.

Note: If message exceeds 1023 bytes (excluding null), it will be truncated. String length can be determined with llStringLength.

For a multi-line message, use new lines:
"This is on one line.\nThis is on another line."
However, bear in mind that this will display as a single line if the chat history window is closed, but will show up appropriately if it's open.
Multiple lines are displayed correctly in RC 1.23.3, so the above is probably not correct. - DomchiUnderwood

Example:
// when touched, IM the owner with the name of the touching agent
default {
    touch_start(integer num_detected) {
        llInstantMessage(llGetOwner(), llDetectedName(0) + " touched me.");
    }
}

The time penalty can be worked around by using link messages and to send IMs. Cycling through these allows for very short delays, decreasing with the number of scripts in the cycle. However, abusing this for TOS violations can lead to a warning/suspension/banning.

Compare with llOwnerSay, llWhisper, llSay, llShout, and llMessageLinked

Q: Hey, I'm getting some kind of weird delay when I use llInstantMessage. What's that about?
A: llInstantMessage has a built-in delay of 2 seconds. If you're communicating with the object's owner and the communications can be limited to a single sim, (IE, if it's an attachment) you can replace llInstantMessage(llGetOwner(),message) with llOwnerSay(message) without any delay. If communicating with other users, you might consider using llMessageLinked in your main script and having a second script actually send the instant messages.


This article wasn't helpful for you? Maybe the [[http://wiki.secondlife.com/wiki/llInstantMessage related article at the LSL Portal] is able to bring enlightenment. ---- [[functions Functions]] | Communications | Agent/Avatar
Comments [Hide comments/form]
llIstantMessage will not work from group owned objects, you get an error message that says "Group owned objects are unable to instant message."
-- EloisePasteur (2005-03-08 03:50:11)
llInstantMessage does send IMs to people who are offline, but because it appears in a 'talk window' rather than an IM window it can be easy to miss when you log on.

It does also correctly trigger the forwarding IM e-mails if that option is set.
-- EloisePasteur (2005-03-12 10:47:54)
The truncation appears to be 255 characters, not 1024.
-- SasunSteinbeck (2006-07-12 00:15:20)
Nope my test shows it chops the 1024th character.

default
{
    state_entry()
    {//generates a 1030 character string
        integer a=104;
        string b;
        while(--a)
            b = (b = "0123456789") + b;
        llInstantMessage(llGetOwner(), b);
    }
}
-- BlindWanderer (2006-07-12 03:12:42)
Attach a comment to this page: