OBST

OBST is a CAOS command to do with motion - specifically, obstacles. OBST checks what is likely to be in an agent's way as it moves.

Usage
Syntax: OBST (float) direction (int)

Gives the distance from the agent to the nearest wall that it might collide with in the specified direction. Directions that can be checked are LEFT, RGHT, _UP_, or DOWN. If the distance to the collision is greater than the agent's RNGE then a very large number is returned.

Examples
From the basic lift script:

loop setv vely 3 untl obst down < 10 wait 4 setv vely 0 setv ov01 0 dpas 0 0 0