Difference between revisions of "LlSensorRemove"

From Second Life Wiki
Jump to navigation Jump to search
(Focus example 1 on demonstrating the function in question. Example 2 added nothing to the understanding of llSensorRemove() and is available elsewhere.)
 
(9 intermediate revisions by 5 users not shown)
Line 5: Line 5:
|func=llSensorRemove
|func=llSensorRemove
|func_desc=Removes the sensor setup by [[llSensorRepeat]].
|func_desc=Removes the sensor setup by [[llSensorRepeat]].
|func_footnote=There are no parameters or return value for this function, as only one [[llSensorRepeat]] can be specified per prim.
|func_footnote=There are no parameters or return value for this function, as only one [[llSensorRepeat]] can be specified per script.
|spec
|spec
|caveats=*If called within the [[sensor]] event then it also removes all of the sensor data that is accessed by the {{LSLGC|Detected|detection}} functions.  
|caveats=*If called within the [[sensor]] event then it also removes all of the sensor data that is accessed by the {{LSLGC|Detected|detection}} functions.  
|constants
|constants
|examples
|examples=The following basic example shows an object that when touched starts scanning for avatars in 10m every 30 seconds, and stops as soon as at least one is found, and returns their name.
<source lang="lsl2">default {
    touch_start(integer x) {
        llSensorRepeat("", NULL_KEY, AGENT, 10.0, PI, 30.0);
    }
    sensor(integer x) {
        llSay(0, llDetectedName(0) + " was found first!");
        llSensorRemove();
    }
}
</source>
 
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||[[llSensorRepeat]]|Scans for agents or objects every time period}}
{{LSL DefineRow||[[llSensorRepeat]]|Scans for agents or objects every time period}}
{{LSL DefineRow||[[llSensor]]| Runs a sensor once}}
|also_tests
|also_tests
|also_events=
|also_events=
{{LSL DefineRow||[[sensor]]|}}
{{LSL DefineRow||[[sensor]]|Triggered when a sensor detects something}}
{{LSL DefineRow||[[no_sensor]]|Triggered when a sensor detects nothing}}
|also_articles
|also_articles
|notes
|notes
|cat1=Sensor
|cat1=Sensor
|haiku={{Haiku|Call off the hounds.|The quarry has escaped us.|Back to the stables.}}
|cat2
|cat2
|cat3
|cat3
|cat4
|cat4
}}
}}

Latest revision as of 13:19, 17 January 2016

Summary

Function: llSensorRemove( );

Removes the sensor setup by llSensorRepeat.

There are no parameters or return value for this function, as only one llSensorRepeat can be specified per script.

Caveats

  • If called within the sensor event then it also removes all of the sensor data that is accessed by the detection functions.
All Issues ~ Search JIRA for related Bugs

Examples

The following basic example shows an object that when touched starts scanning for avatars in 10m every 30 seconds, and stops as soon as at least one is found, and returns their name.

default {
    touch_start(integer x) {
        llSensorRepeat("", NULL_KEY, AGENT, 10.0, PI, 30.0);
    }
 
    sensor(integer x) {
        llSay(0, llDetectedName(0) + " was found first!");
        llSensorRemove();
    }
}

See Also

Events

•  sensor Triggered when a sensor detects something
•  no_sensor Triggered when a sensor detects nothing

Functions

•  llSensorRepeat Scans for agents or objects every time period
•  llSensor Runs a sensor once

Deep Notes

Search JIRA for related Issues

Signature

function void llSensorRemove();

Haiku

Call off the hounds.
The quarry has escaped us.
Back to the stables.