Difference between revisions of "Listen"

From Second Life Wiki
Jump to: navigation, search
(the most basic listen example (amazed it's not here already..))
Line 9: Line 9:
 
|spec
 
|spec
 
|caveats=*On [[state]] change all listens are released.
 
|caveats=*On [[state]] change all listens are released.
|examples=<lsl>
+
|examples=<pre>
 
// says beep whenever owner says something in main chat;
 
// says beep whenever owner says something in main chat;
 
string owner = "Your Name"; // replace Your Name with your name ;
 
string owner = "Your Name"; // replace Your Name with your name ;
Line 22: Line 22:
 
     }
 
     }
 
}
 
}
</lsl>
+
</pre>
 
|helpers
 
|helpers
 
|also_header
 
|also_header

Revision as of 02:42, 15 March 2007

Description

Event: listen( integer channel, string name, key id, string message ){ ; }

Trigged by chat, use llListen to enable and filter

• integer channel
• string name
• 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

  • On state change all listens are released.
All Issues ~ Search JIRA for related Bugs

Examples

// says beep whenever owner says something in main chat;
string owner = "Your Name"; // replace Your Name with your name ;
default
{
    state_entry()
    {
        llListen(0, owner, "", "");
    }
    listen( integer channel, string name, key id, string message ){
        llSay(0,"beep");
    }
}

See Also

Functions

•  llListen
•  llListenControl
•  llListenRemove
•  llDialog
•  llWhisper Sends chat limited to 10 meters
•  llSay Sends chat limited to 20 meters
•  llShout Sends chat limited to 100 meters

Deep Notes

Signature

event void listen( integer channel, string name, key id, string message );