Difference between revisions of "Listen/fr"

From Second Life Wiki
Jump to navigation Jump to search
("modification in progress")
 
Line 1: Line 1:
{{LSL_Event|event_id=12|event_delay
{{LSL_Event|event_id=12|event_delay
|event=listen
|event=listen
|p1_type=integer|p1_name=channel|p1_desc
|p1_type=integer|p1_name=cannal|p1_desc
|p2_type=string|p2_name=name|p2_desc
|p2_type=string|p2_name=nom|p2_desc
|p3_type=key|p3_name=id|p3_desc
|p3_type=key|p3_name=id|p3_desc
|p4_type=string|p4_name=message|p4_desc
|p4_type=string|p4_name=message|p4_desc
|event_desc=Trigged by chat, use {{LSLG|llListen}} to enable and filter
|event_desc=Déclenché par le chat, utilisez {{LSLG|llListen}} pour l'activer et le filtrer
|constants={{LSL Constants/Chat}}
|constants={{LSL Constants/Chat}}
|spec
|spec
|caveats=*On [[state]] change or [[llResetScript|script reset]] all listens are [[llListenRemove|closed]] automaticaly.
|caveats=*Sur un changement d'état[[state/fr]] ou [[llResetScript|script reset]] toutes les écoutes sont fermées [[llListenRemove|closed]] automatiquement.
*When an object changes owner any listen registered with [[llGetOwner]] will not automatically update itself until the script is reset. The scripter can catch this scenario per the example below.
*When an object changes owner any listen registered with [[llGetOwner]] will not automatically update itself until the script is reset. The scripter can catch this scenario per the example below.
|examples=
|examples=

Revision as of 09:01, 20 January 2008

Description

Event: listen( integer cannal, string nom, key id, string message ){ ; }

Déclenché par le chat, utilisez llListen pour l'activer et le filtrer

• integer cannal
• string nom
• key id
• string message
Channel Constant Description
DEBUG_CHANNEL 0x7FFFFFFF Chat channel reserved for script debugging and error messages, broadcasts to all nearby users.
PUBLIC_CHANNEL 0x0 Chat channel that broadcasts to all nearby users. This channel is sometimes referred to as: open chat, local chat and public chat.

Caveats

  • Sur un changement d'étatstate/fr ou script reset toutes les écoutes sont fermées closed automatiquement.
  • When an object changes owner any listen registered with llGetOwner will not automatically update itself until the script is reset. The scripter can catch this scenario per the example below.


Examples

Trivial example to listen to any chat from the object owner and respond once. To reduce lag and avoid spamming surrounding users, it is vastly preferable to listen on channels other than 0 and to trigger the listen event by chatting on an alternative channel such as '/5 hello'. <lsl>// says beep to owner the first time owner says something in main chat; integer listen_handle;

default {

   state_entry()
   {   //Registers the listen to the owner of the object at the moment of the call. This does not automatically update when the owner changes.
       // Change 0 to another positive number to listen for '/5 hello' style of chat.
       listen_handle = llListen(0, "", llGetOwner(), "");
   }
   listen( integer channel, string name, key id, string message )
   {
       llOwnerSay("beep");
       // Stop listening until script is reset
       llListenRemove(listen_handle);
   }
   on_rez(integer param)
   {   //Triggered when the object is rezed, like after the object had been sold from a vendor
       llResetScript();//By resetting the script on rez it forces the listen to re-register.
   }
   changed(integer mask)
   {   //Triggered when the object containing this script changes owner.
       if(mask & CHANGED_OWNER)
       {
           llResetScript();
       }
   }

}</lsl>

See Also

Functions

•  llListen
•  llListenControl
•  llListenRemove
•  llDialog
•  llOwnerSay Sends chat to the owner only to avoid spamming the PUBLIC_CHANNEL
•  llWhisper Sends chat limited to 10 meters
•  llSay Sends chat limited to 20 meters
•  llShout Sends chat limited to 100 meters
•  llRegionSay Sends chat limited to region

Deep Notes

Signature

event void listen( integer cannal, string nom, key id, string message );