Write in brackets the \l;name of the object\u cbot\category; that you look for. Put the result in a variable of the \l;type\u cbot\type; \c;object\n;. Here is an example that looks for the closest ant:
Determines which way the objects are detected. With value \c;1\n;, returns the closest object found in the specified zone. With value \c;-1\n;, the farthest object in the zone will be returned.
Determines which type of objects should be detected. Especially useful in use with an \l;array\u cbot\array; or \const;Any\norm;. The following filters are available:
The last three are mainly useful in \l;code battles\u battles;. You can also pass a team ID to search only for objects from a specific team. Attention: you should use \const;FilterNeutral\norm; instead of \c;0\n; or else it will not work.
Filters and IDs can be mixed using bitwise OR operator \c;|\n;, for example \c;radar(Any, 0, 360, 0, 1000, 1, 2 | FilterOnlyLanding);\n; will only detect an object from team \c;2\n; that is on the ground. Attention: you can specify only one team ID at once, but you can specify several filters at once.
Returns the first object found that corresponds to the specified category in the specified zone. If no object was found, returns the value \c;\l;null\u cbot\null;\n;.
\t;Remark
You do not have to give all the parameters. Here are two examples of instructions that are equivalent:
\c;
\s; radar(Titanium, 0, 360, 0, 1000);
\s; radar(Titanium); // equivalent
\s; radar(Titanium, 0, 90, 0, 1000);
\s; radar(Titanium, 0, 90); // equivalent
\n;
When one or more parameters are not specified, the default values indicated above are used instead; only the first parameter is compulsory.
Generally, only the first parameter is specified: f. ex. \c;radar (AlienAnt)\n; detects the closest ant, wherever it may be.