function
Function syntax
llListenControl(integer handle,// Integer listener handle returned byllListen.integer active// Boolean. IfTRUE, activates the listener; ifFALSE, deactivates it.
);- Energy
- 10
Enables or disables the listener specified by the integer handle. If active is TRUE, the listener is activated; if FALSE, it is deactivated.
Makes listen event callback handle active or inactive
llListenControl(0, 0);Caveats
Section titled “Caveats”- On state change or script reset all listens are removed automaticaly.
Examples
Section titled “Examples”a small example of an on and off switchable listen by use of llListenControl()
5 collapsed lines
integer handle;integer toggle;default{ state_entry() { handle = llListen(5, "", NULL_KEY, ""); // Establish a listener to listen to anything on channel 5 ... llListenControl(handle, FALSE); // ... but make the listener inactive for now llSetText("not listening", <0.0,0.0,0.0>, 1.0); }
touch_start(integer total_number) { toggle = !toggle; llListenControl(handle, toggle); // Make the listener active or inactive as required
if(toggle)16 collapsed lines
{ llSay(0, "now listening on channel 5"); llSetText("listening on ch 5", <1.0,0.0,0.0>, 1.0); } else { llSay(0, "not listening any more"); llSetText("not listening", <0.0,0.0,0.0>, 1.0); } }
listen(integer channel, string name, key id, string message) { llSay(0, name + " just said " + message); }}See also
Section titled “See also”Functions
Section titled “Functions”Events
Section titled “Events”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.