Difference between revisions of "LlListen"

From Second Life Wiki
Jump to: navigation, search
m (Fix for alphabetical order in Functions list)
(add anti lag tip)
Line 11: Line 11:
 
|func_desc=Sets a callback for '''msg''' on '''channel''' from '''name''' and '''id'''.
 
|func_desc=Sets a callback for '''msg''' on '''channel''' from '''name''' and '''id'''.
 
|func_footnote=If '''msg''', '''name''' or '''id''' are blank there are not used to filter incoming messages.<br/>
 
|func_footnote=If '''msg''', '''name''' or '''id''' are blank there are not used to filter incoming messages.<br/>
If '''id''' is an invalid key or a {{LSLG|NULL_KEY|null key}}, it is considered blank.
+
If '''id''' is an invalid key or a {{LSLG|NULL_KEY|null key}}, it is considered blank.<br/><br/>
 +
 
 +
[http://rpgstats.com/wiki/index.php?title=Lag Lag] tip: Avoid channel 0 and set name or id where possible. llListen(0,"",NULL_KEY,"") is extremely laggy and should be avoided at all cost.
 
|also_functions={{LSL DefineRow||{{LSLG|llListenRemove}}|Removes a listen}}
 
|also_functions={{LSL DefineRow||{{LSLG|llListenRemove}}|Removes a listen}}
 
{{LSL DefineRow||{{LSLG|llListenControl}}|Enables/Disables a listen}}
 
{{LSL DefineRow||{{LSLG|llListenControl}}|Enables/Disables a listen}}

Revision as of 17:59, 5 July 2007

Summary

Function: integer llListen( integer channel, string name, key id, string msg );

Sets a callback for msg on channel from name and id.
Returns an integer that can be used to deactivate or remove the listen.

• integer channel any valid integer, positive or negative.
• string name
• key id
• string msg

If msg, name or id are blank there are not used to filter incoming messages.
If id is an invalid key or a null key, it is considered blank.

Lag tip: Avoid channel 0 and set name or id where possible. llListen(0,"",NULL_KEY,"") is extremely laggy and should be avoided at all cost.

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

  • On state change or script reset all listens are released.
    • A state change can be used as a shortcut to releasing listens.
  • Only 64 listens can simultaneously be open in any single script.
    • If this number is exceeded an error is shouted.
All Issues ~ Search JIRA for related Bugs

Examples

See Also

Events

•  listen

Functions

•  llListenRemove Removes a listen
•  llListenControl Enables/Disables a listen
•  llWhisper Sends chat limited to 10 meters
•  llSay Sends chat limited to 20 meters
•  llShout Sends chat limited to 100 meters

Deep Notes

Search JIRA for related Issues

Signature

function integer llListen( integer channel, string name, key id, string msg );