Unofficial LSL Reference

[[functions:llsay]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

functions:llsay [2014-01-04 13:17 SLT]
omei created
functions:llsay [2016-11-12 15:33 SLT] (current)
sei Add note
Line 1: Line 1:
 +$nav
 ===== Function: llSay ===== ===== Function: llSay =====
  
 <code lsl2> <code lsl2>
-type llSay(integer channel, string message)+llSay(integer channel, string message)
 </​code>​ </​code>​
 +Say a message on the given channel with a range of 20 metres.
  
 ===== Parameters ===== ===== Parameters =====
  
 === channel === === channel ===
-Determines the channel that message will be sent on. +Determines the channel that message will be sent on. Channel can be any integer, positive or negative. Channel 0 is open chat (also known as $lct[PUBLIC CHANNEL])Channel ​$lct[DEBUG_CHANNELwill send the message to the //Script Warning/​Error window//.
-Channel can be any integer, positive or negative. +
-Channel 0 is open chat (also known as PUBLIC CHANNEL) +
-Channel DEBUG_CHANNEL will send the message to the Script Warning/​Error window+
-Messages sent on channel 0 or the DEBUG_CHANNEL,​ are throttled to a rate of <200/10sec, per region, per owner/user. +
-Negative channels are typically used for inter-object communication.+
  
 === message === === message ===
-Contains the text to be said+Contains the text to be said.
  
 ===== Notes ===== ===== Notes =====
  
-  * Text said via llSay can be heard up to 20 metres away from the PRIM the script is in. +  * Text said via llSay can be heard up to 20 metres away from the prim the script is in. 
-  * message can be a maximum of 1024 bytes. ​This can convey 1024 ASCII characters, or 512 UTF-8 characters such as á.+  * Messages sent on channel 0 or on $lct[DEBUG_CHANNEL],​ are throttled to a rate of about 200 every 10 seconds, per region, per owner/​user. 
 +  * $prm[messagecan be a maximum of 1024 bytes when translated to [[http://en.wikipedia.org/​wiki/​UTF-8|UTF-8]]. The allowed number of characters ​can vary depending on what characters ​the message contains. For exampleit allows: 
 +      * up to 1024 UTF-8 characters in the ASCII range such as A or %, 
 +      * up to 512 two-byte ​UTF-8 characters such as И or £, 
 +      * up to 341 three-byte UTF-8 characters such as ツ or €, 
 +      * etc. or a mixture of them. 
 +  * Negative channels are typically used for inter-object communication. 
 +  * A script cannot hear anything said by any script within the same prim. This avoids recursion problems. It can hear text sent from a script in another prim within the same object, if it's within range. 
 +  * Attached objects in avatars can't be heard by other avatars if the avatars can't see nor hear each other due to parcel privacy settings. They still can be heard by other objects, though.
  
 ===== Short examples ===== ===== Short examples =====
  
 <code lsl2> <code lsl2>
-llSay(0, "Hello friends"​); ​// Sends the text "Hello friends"​ on channel zero. It will appear in the chat window of any avatar within 20 meters.+// Send the text "Hellofriends"​ on channel zero. It will appear 
 +// in the chat window of any avatar within 20 metres. 
 +llSay(0, "​Hello,​ friends"​);​ 
 +llSay(PUBLIC_CHANNEL,​ "Hello friends"​);​ // Variant of the above 
 + 
 +// Send the text "Error in the script!"​ to the script warning/​error window 
 +llSay(DEBUG_CHANNEL,​ "Error in the script!"​);​
 </​code>​ </​code>​
  
Line 37: Line 48:
     {     {
         // Send a message on a specific negative channel         // Send a message on a specific negative channel
-        // The message will only be received by scripted ​objects ​that are listening on that channel +        // The message will only be received by scripted ​prims that are listening on that channel 
-        llSay(-123456,​ "I was touched by " + llDetectedName(0) );+        // and are within 20 metres of this prim. 
 +        llSay(-123456,​ "I was touched by " + llDetectedName(0));​
     }     }
 } }
Line 45: Line 57:
 ===== See also ===== ===== See also =====
  
-  * [[llWhisper]] +  * $lfn[llWhisper] ​for a 10 metres range version. 
-  * [[llShout]] +  * $lfn[llShout] ​for a 100 metres range version. 
-  * [[llOwnerSay]] +  * $lfn[llOwnerSay] ​to say something to the owner only. 
-  * [[lRegionSay]] +  * $lfn[lRegionSay] ​to say something in a certain channel to every avatar/prim in the region (but channel 0 is disallowed). 
-  * [[llRegionSayTo]] +  * $lfn[llRegionSayTo] ​to say something to a specific avatar or prim in the region. 
-  * [[llInstantMessage]]+  * $lfn[llInstantMessageto send an instant message to the specified avatar (can be across regions). 
 +  * $lfn[llListen] to listen to what avatars or scripts say in a certain channel, and the accompanying $lev[listenevent.