Difference between revisions of "LlInstantMessage"

From Second Life Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
{{LSLFunctionAll|func_id=118|func_sleep=2.0|func_energy=10.0|func=llInstantMessage|p1_type=key|p1_name=user|p2_type=string|p2_name=message|func_footnote=IMs message to the user|return_text|spec|caveats|examples|helpers|related|also|notes}}[[Category:LSL_Functions]][[Category:LSL_Stub]]
{{LSLFunctionAll
|func_id=118
|func_sleep=2.0
|func_energy=10.0
|func=llInstantMessage
|p1_type=key
|p1_name=user
|p2_type=string
|p2_name=message
|func_footnote=Sends an Instant Message specified in the string ''message'' to the user specified by the key ''key''.
|return_text
|spec
|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=
<lsl>
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!");
 
    }
}
</lsl>
|helpers
|related
|also
|notes=Instant Messaging has the benefit of allowing communication from an object to an avatar anywhere in the Grid. The downsides are, other objects can not recieve Instant Messages, nor, can an Avatar Instant Message an object. It's a one way communication avenue. Also the 2 second script delay can also be considered a downside in some applications.
}}[[Category:LSL_Functions]][[Category:LSL_Stub]]

Revision as of 13:05, 26 January 2007

   Outdated templated used

Please change the template from 'LSLFunctionAll' to 'LSL_Function' (just replace 'LSLFunctionAll' with 'LSL_Function', do this after fixing any other erorr messages.

  Either 'func_desc' or 'return_type' & 'return_text' must be defined

(Please use 'return_text' & 'return_type' or 'func_desc' to summarize the functions actions.)

Summary

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

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

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.

Examples

<lsl>

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

}

</lsl>

Notes

Instant Messaging has the benefit of allowing communication from an object to an avatar anywhere in the Grid. The downsides are, other objects can not recieve Instant Messages, nor, can an Avatar Instant Message an object. It's a one way communication avenue. Also the 2 second script delay can also be considered a downside in some applications.

Deep Notes

Signature

function void llInstantMessage( key user, string message );