llListen
LSLinteger llListen(integer channelID, string name, string ID, string msg)
Creates a listen callback for Text on Channel from SpeakersName and SpeakersID (SpeakersName, SpeakersID, and/or Text can be empty) and returns an identifier that can be used to deactivate or remove the listen.\ Non-empty values for SpeakersName, SpeakersID, and Text will filter the results accordingly, while empty strings and NULL_KEY will not filter the results, for string and key parameters respectively.\ PUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts.
Parameters
| Type | Name | What it does |
|---|---|---|
| integer | channelID | |
| string | name | Only this object or avatar name, or "" for any. |
| string | ID | |
| string | msg | Only this exact text, or "" for any. |
Example
integer handle;
default
{
state_entry()
{
// Hear only the owner, on channel 5: "/5 open", "/5 close".
handle = llListen(5, "", llGetOwner(), "");
}
listen(integer channel, string name, key id, string message)
{
if (message == "open") llSay(0, "Opening.");
if (message == "close") llSay(0, "Closing.");
}
}Stop listening
llListenRemove(handle);
The Linden Scripting Library — what every SL-compatible grid provides.