Difference between revisions of "LlInstantMessage"

From Second Life Wiki
Jump to: navigation, search
m (edit for clarity and style)
Line 1: Line 1:
 
{{LSL_Function
 
{{LSL_Function
|func_id=118
+
|func_id=118|func_sleep=2.0|func_energy=10.0
|func_sleep=2.0
+
|func_energy=10.0
+
 
|func=llInstantMessage
 
|func=llInstantMessage
|sort=InstantMessage
+
|p1_type=key|p1_name=user|p1_desc
|p1_type=key
+
|p2_type=string|p2_name=message|p2_desc
|p1_name=user
+
|p2_type=string
+
|p2_name=message
+
 
|func_desc=Sends an Instant Message specified in the string ''message'' to the user specified by the key ''key''.
 
|func_desc=Sends an Instant Message specified in the string ''message'' to the user specified by the key ''key''.
 
|return_text
 
|return_text
Line 14: Line 9:
 
|caveats=The calling script is delayed for 2 seconds to prevent Instant Message spamming. 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 other means. The message sent can not be longer than 1024 bytes.
 
|caveats=The calling script is delayed for 2 seconds to prevent Instant Message spamming. 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 other means. The message sent can not be longer than 1024 bytes.
 
|examples=
 
|examples=
<lsl>
+
<pre>
key owner;
+
key owner;
  
 
default {
 
default {
Line 21: Line 16:
 
     on_rez(integer start_param)
 
     on_rez(integer start_param)
 
     {
 
     {
    owner=llGetOwner();  // get the key of the objects owner.
+
        owner=llGetOwner();  // get the key of the objects owner.
 
     }
 
     }
 
     touch_start(integer total_num)
 
     touch_start(integer total_num)
 
     {         
 
     {         
    llInstantMessage(owner,llKey2Name(owner)+", " + (string)total_num +" Avatar(s) touched me!");
+
        llInstantMessage(owner,llKey2Name(owner)+", " + (string)total_num +" Avatar(s) touched me!");
 
+
 
     }
 
     }
 
}
 
}
</lsl>
+
</pre>
 
|helpers
 
|helpers
 
|also_functions=*{{LSLG|llWhisper}}
 
|also_functions=*{{LSLG|llWhisper}}
Line 36: Line 30:
 
*{{LSLG|llShout}}
 
*{{LSLG|llShout}}
 
|also
 
|also
|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 recieve 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.
+
|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.
}}[[Category:LSL_Functions]][[Category:LSL_Stub]]
+
|cat1=Communications
 +
|cat2
 +
|cat3
 +
|cat4
 +
}}

Revision as of 14:32, 21 February 2007

Summary

Function: llInstantMessage( key user, string message );

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

• key user
• string message

Caveats

  • This function causes the script to sleep for 2.0 seconds.The calling script is delayed for 2 seconds to prevent Instant Message spamming. 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 other means. The message sent can not be longer than 1024 bytes.
All Issues ~ Search JIRA for related Bugs

Examples

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!");
    }
}

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

Deep Notes

Search JIRA for related Issues

Signature

function void llInstantMessage( key user, string message );