This script makes it easy for you to detect avatars and objects in a customized range
Using Sensor's API you will be able to detect and be notified when avatars/object get into/out of the capture range
VERY EASY TO USE! EXAMPLES ARE PROVIDED WITH FULLY COMMENTED CODE FOR EASIER UNDERSTANDING.
USAGE IS ENDLESS AND SCRIPTING KNOWLEDGE REQUIRED IS BASIC.
HOW TO START
------------
First of all, copy in a box the scripts in this order:
1. Sensor
2. Sensor_Cryptic
3. Example
FUNCTIONS PROVIDED
------------------
SENSOR_setlinkMessageNum(integer linkMessageNumToSet)
Change the linkMessageNum to use for the messages to be sent to Sensor script. By default -4.
SENSOR_setlinkMessageNumResponse(integer linkMessageNumToSet)
Change the linkMessageNum to use for the messages to be received from Sensor script. By default 4.
SENSOR_sensor(string name, key id, integer type, integer range)
Detect what is in the range (only one time)
SENSOR_sensorRepeat(string name, key id, integer type, integer range, float rate)
Detect what is in the range every <rate> seconds.
name: Object or avatar name!
id: group, avatar or object UUID
type: mask (AGENT_BY_LEGACY_NAME, AGENT_BY_USERNAME, ACTIVE, PASSIVE, and/or SCRIPTED)
range: range in meters, [0.0, 96.0]
rate: How often a sensor/no_sensor will be queued.
SENSOR_sensorRepeatRemove()
Remove the sensorRepeat activity.
SENSOR_sensorDeltaOn()
Get notifications when avatars/object get into/out of the capture range
SENSOR_sensorDeltaOff()
Remove the sensorDelta activity.
EVENT NOTIFICATIONS
------------------
llMessageLinked messages with Json data structure are sent from Sensor script in the following cases:
- When a avatar/object is detected:
["sensorResponse","id"]
- When an avatar/object get into/out of the capture range:
["sensorResponseDelta","id","IN"]
["sensorResponseDelta","id","OUT"]
- When Sensor will start sending sensorResponse notifications
["sensorPingBegin"]
- When Sensor finished sending sensorResponse notifications
["sensorPingEnd"]
If you have questions, concerns or suggestions can contact the resident Valentin Elan.