def llGetAlpha(face):
    face = fi(face)
    if face > 8:
        return 1.0
    # Negative face numbers return (float)llGetNumberOfSides(), which isn't
    # computable.
    raise ELSLCantCompute
def llDetectedTouchUV(idx, evsym=None):
    idx = fi(idx)
    if 0 <= idx <= 15 and (evsym is None or 'detect' in evsym):
        # In detection events that are not touch events, it returns
        # TOUCH_INVALID_TEXCOORD if idx < num, else ZERO_VECTOR,
        # but we only know that num >= 1.
        if idx == 0 and evsym is not None and 'touch' not in evsym:
            # index 0 always exists, so we know the result
            return TOUCH_INVALID_TEXCOORD
        raise ELSLCantCompute
    return ZERO_VECTOR
def llDetectedOwner(idx, evsym=None):
    idx = fi(idx)
    if 0 <= idx <= 15 and (evsym is None or 'detect' in evsym):
        raise ELSLCantCompute
    return Key(NULL_KEY)
def llDetectedLinkNumber(idx, evsym=None):
    idx = fi(idx)
    if 0 <= idx <= 15 and (evsym is None or 'detect' in evsym):
        raise ELSLCantCompute
    return 0
def llDetectedGrab(idx, evsym=None):
    idx = fi(idx)
    if 0 <= idx <= 15 and (evsym is None or 'grab' in evsym):
        raise ELSLCantCompute
    return ZERO_VECTOR
def llAvatarOnLinkSitTarget(link):
    link = fi(link)
    if link > 255 or link == -2147483648:
        return Key(NULL_KEY)
    raise ELSLCantCompute
def llGetLinkName(link):
    link = fi(link)
    if link < -2147483646 or link > 256:
        return NULL_KEY
    raise ELSLCantCompute
def llGetInventoryPermMask(item, category):
    item = fs(item)
    category = fi(category)
    if category < 0 or category > 4 or item == u'':
        return 0
    raise ELSLCantCompute
def llGetInventoryNumber(kind):
    kind = fi(kind)
    if kind != -1 and kind not in valid_inventory_kinds:
        return 0
    raise ELSLCantCompute
def llGetInventoryName(kind, index):
    kind = fi(kind)
    index = fi(index)
    if kind != -1 and kind not in valid_inventory_kinds or index < 0:
        return u''
    raise ELSLCantCompute
def llGetExperienceErrorMessage(errno):
    errno = fi(errno)
    if errno < -1 or errno > 18:
        errno = -1
    return xp_error_messages[errno]
def llGetColor(face):
    face = fi(face)
    if face > 8:
        return Vector((1.,1.,1.))
    # Returns the average colour when negative (can't be computed)
    raise ELSLCantCompute
def llGetAgentList(scope, options):
    scope = fi(scope)
    options = fl(options)
    if scope not in (1, 2, 4):
        return [u'INVALID_SCOPE']
    raise ELSLCantCompute
def llDetectedTouchPos(idx, evsym=None):
    idx = fi(idx)
    if 0 <= idx <= 15 and (evsym is None or 'touch' in evsym):
        raise ELSLCantCompute
    return ZERO_VECTOR
def llDetectedTouchFace(idx, evsym=None):
    idx = fi(idx)
    if 0 <= idx <= 15 and (evsym is None or 'touch' in evsym):
        raise ELSLCantCompute
    return -1 if 'detect' in evsym and 0 <= idx <= 15 else 0
def llDetectedRot(idx, evsym=None):
    idx = fi(idx)
    if 0 <= idx <= 15 and (evsym is None or 'detect' in evsym):
        raise ELSLCantCompute
    return ZERO_ROTATION