How to Select a Target

sanderling
guide
eve-online

#1

When you activate one of your ship’s modules, you might want to select a target first. This guide shows how to make your bot do this for you.

To select a target there are multiple ways, for example:

  • Click on the target in the ship UI. Below in this post, there is a guide on how to make your bot do this for you.
  • Click on the entry in the overview which represents the same object in space as the target.

How to Make Your Bot Click on a Target

To make a bot click on a target in the ship UI, the first step is to get the targets UIElement from the memory measurement. There can be multiple targets at the same time, and the memory measurement contains an UIElement for each of those. This set of UIElements can be read from the property Sanderling.MemoryMeasurementParsed?.Value?.Target.
For example, you can use the following code to pick one arbitrary target from this set and store it in a variable to make it available for further processing:

var theTargetUIElement = Sanderling.MemoryMeasurementParsed.Value?.Target?.FirstOrDefault();

After selecting the UIElement of the target that you are interested in, you can click on it with the following code:

Sanderling.MotionExecute(theTargetUIElement?.MouseClick(MouseButtonIdEnum.Left));

And that’s it, now the target is selected.

As a next step, you can affect the target by activating a module on it.


How to Activate a Ship Module in EVE Online
Chat text as triggers for retreat?
Development of BotEngine - Aggregating Feedback