LlListenControl
Looking for the current API? Open the llListenControl reference →
Wiki description
Makes listen event callback
handle active or inactiveCaveats
- On state change or script reset all listens are removed automaticaly.
Examples
a small example of an on and off switchable listen by use of llListenControl()
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)
{
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: functions
See also: events
Shared wiki helpers
The original page also injects shared parameter notes, caveats or issue information through these helpers. Their conditional MediaWiki logic is not reproduced here; inspect the preserved helper source for additional material.
Original shared helper source (conditional wiki logic is not evaluated)
{{LSL Injection Test}}{{#if:
{{#vardefine:p_{{{1|}}}_desc|handle to control [[{{{2|}}}{{#var:lang}}|{{{2|}}}]] {{#if:{{{3|}}}|and [[{{{3|}}}{{#var:lang}}|{{{3|}}}]] events|event}}}}
{{#vardefine:p_{{{1|}}}_hover|handle to control {{{2|}}} {{#if:{{{3|}}}|and {{{3|}}} events|event}}}}
}}<noinclude>
{| {{Prettytable}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p__desc}}
|-
{{VarPair|p__hover}}
|-
{{Footnotes}}
|}
</noinclude>Original shared helper source (conditional wiki logic is not evaluated)
{{LSL Injection Test}}{{#if:
{{#vardefine:nbdv|{{#switch:{{uc:{{{default|}}}}}|T|TRUE=true|F|FALSE=false}}}}
{{#vardefine:p_{{{1|}}}_desc|{{#if:{{{bool|}}}|{{HoverLink|boolean{{#var:lang}}|A type that can only be true or false|boolean}},}} {{{pd|}}} {{#if:{{{bool|}}}{{{pd|}}}|{{#ifeq:{{{if|}}}|*|if|{{{if|}}}}}|{{ucfirst:{{#ifeq:{{{if|}}}|*|if|{{{if|}}}}}}}}} {{#vardefineecho:TRUE|{{LSL Const{{#var:lang}}|TRUE|integer|1}}}}{{#vardefine:FALSE|{{LSL Const{{#var:lang}}|FALSE|integer|0}}}}{{#if:{{{non-zero|}}}|{{Footnote|handle=non-zero|Any value that is not zero/{{#var:FALSE}} is treated the same as {{#var:TRUE}}. This behavior should not be depended upon.|Any value that is not zero/FALSE is treated the same as TRUE. This behavior should not be depended upon.}}}}{{#ifeq:{{#var:nbdv}}|true| ({{HoverText|default|default for new objects etc}})}} {{#if:{{{td|}}}|{{{td|}}}|enables}}, {{#ifeq:{{{if|}}}|*|if|{{{if|}}}}} {{#var:FALSE}}{{#ifeq:{{#var:nbdv}}|false| ({{HoverText|default|default for new objects etc}})}} {{#if:{{{fd|}}}|{{{fd|}}}|disables}}}}
{{#vardefine:p_{{{1|}}}_hover|{{#if:{{{bool|}}}|boolean,}} {{#if:{{{ph|}}}|{{{ph|}}}|{{{pd|}}}}} {{#if:{{{bool|}}}{{{pd|}}}{{{ph|}}}|{{#ifeq:{{{if|}}}|*|if|{{{if|}}}}}|{{ucfirst:{{#ifeq:{{{if|}}}|*|if|{{{if|}}}}}}}}} TRUE{{#ifeq:{{#var:nbdv}}|true| (default)}} {{#if:{{{th|}}}|{{{th|}}}|{{#if:{{{td|}}}|{{{td|}}}|enables}}}}, {{#ifeq:{{{if|}}}|*|if|{{{if|}}}}} FALSE{{#ifeq:{{#var:nbdv}}|false| (default)}} {{#if:{{{fh|}}}|{{{fh|}}}|{{#if:{{{fd|}}}|{{{fd|}}}|disables}}}}}}
}}<noinclude>
{| {{Prettytable}}
|+<code><nowiki>{{{{FULLPAGENAME}}|bool|bool=*|pd=1|ph=2|default=false}}</nowiki></code>{{{{FULLPAGENAME}}|bool|bool=*|pd=1|ph=2|default=false}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_bool_desc}}
|-
{{VarPair|p_bool_hover}}
|-
{{Footnotes}}
|}
{| {{Prettytable}}
|+<code><nowiki>{{{{FULLPAGENAME}}|bool|bool=*|pd=1|ph=2|td=3|th=4|fd=5|fh=6}}</nowiki></code>{{{{FULLPAGENAME}}|bool|bool=*|pd=1|ph=2|td=3|th=4|fd=5|fh=6}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_bool_desc}}
|-
{{VarPair|p_bool_hover}}
|-
{{Footnotes}}
|}
{| {{Prettytable}}
|+<code><nowiki>{{{{FULLPAGENAME}}|bool|bool=*|if=*|non-zero=*|pd=1|ph=2|td=3|th=4|fd=5|fh=6}}</nowiki></code>{{{{FULLPAGENAME}}|bool|bool=*|if=*|non-zero=*|pd=1|ph=2|td=3|th=4|fd=5|fh=6}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_bool_desc}}
|-
{{VarPair|p_bool_hover}}
|-
{{Footnotes}}
|}
{| {{Prettytable}}
|+<code><nowiki>{{{{FULLPAGENAME}}|bool|if=when|non-zero=*|td=3|th=4|fd=5|fh=6}}</nowiki></code>{{{{FULLPAGENAME}}|bool|if=when|non-zero=*|td=3|th=4|fd=5|fh=6}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_bool_desc}}
|-
{{VarPair|p_bool_hover}}
|-
{{Footnotes}}
|}
</noinclude>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.