How do I find enemies with the scanner?
The scanner looks along a 30° arc that you point with scanner.sense, and reports up to four contacts within 30 m as bearings. Sweep the arc round until scanner.ping(0) is true, then keep it pointed at scanner.bearing(0). The scanner gives no distance and can't tell an enemy from a teammate or an obstacle, so your code has to work that out.