How to Find an Image
Displaying the coordinates of the found image
You can import a ready-made example from here: https://eu.eyeauras.net/share/S20240223230622FB6T3303xKok
- Create an aura (named ImageSearch in the example) and add an Image Search trigger to it.
- Specify what to search for and where in the trigger settings.
- Create an aura with a script.
- Copy and paste the script, run it, and if everything is fine, the script will print the coordinates.
// Find the aura by name and then find the "Image Search" trigger inside it
var trigger = AuraTree.GetTriggerByPath<IImageSearchTrigger>(@".\ImageSearch");
var matchResult = trigger.Refresh(); // Trigger the search
if (matchResult.Detected.Success == false) {
// If not found, there's nothing more to do
Log.Warn("Image not found");
return;
}
// Found the color, get the local (window) coordinates
var localRect = matchResult.Detected.Bounds.Value;
// Convert to screen coordinates
var screenRect = matchResult.ToScreen(localRect);
Log.Info($"Image found @ {screenRect}");