From Second Life Wiki
Function: integer llDetectedType( integer number );
Returns an integer mask that is the types of detected object or avatar.
|| Index of detection information
number does not support negative indexes.
Returns zero if number is not valid sensed object or avatar.
| Flag Mask
|| Description (llDetectedType())
|| Description (llSensor() and llSensorRepeat() mask)
|| This is used to find agents by legacy name.
|| This is also used to find agents by legacy name, and is functionally identical to AGENT_BY_LEGACY_NAME
|| This is used to find agents by username.
|| Physical tasks. (Physical objects & agents)
|| Physical objects that are moving or objects containing an active script. Thus, it is using SL server resources now.
|| Non-physical objects.
|| Non-scripted or script is inactive and non-physical or, if physical, not moving. Thus, it is not using SL server resources now.
|| Objects containing any active script.
|| Objects that has any script, which is doing anything in simulator just now.
- If number is out of bounds this function returns zero and the script continues to execute without an error message.
- Events that enable the llDetected* functions always return at least one detected item.
- Detection events are not raised if there is nothing detected.
- The detection event's items detected parameter is initially never less than 1.
~ Search JIRA for related Bugs