attacking fixed

This commit is contained in:
Boki 2026-02-21 16:05:00 -05:00
parent 109b1b4059
commit f914443d86
5 changed files with 96 additions and 66 deletions

View file

@ -171,18 +171,24 @@ public class ScreenReader : IScreenReader
public Task<TemplateMatchResult?> TemplateMatch(string templatePath, Region? region = null)
{
var result = _templateMatch.Match(templatePath, region);
if (result != null)
Log.Information("Template match found: ({X},{Y}) confidence={Conf:F3}", result.X, result.Y, result.Confidence);
return Task.FromResult(result);
return Task.Run(() =>
{
var result = _templateMatch.Match(templatePath, region);
if (result != null)
Log.Information("Template match found: ({X},{Y}) confidence={Conf:F3}", result.X, result.Y, result.Confidence);
return result;
});
}
public Task<List<TemplateMatchResult>> TemplateMatchAll(string templatePath, Region? region = null, double threshold = 0.7, bool silent = false)
{
var results = _templateMatch.MatchAll(templatePath, region, threshold);
if (!silent)
Log.Information("TemplateMatchAll: {Count} matches for {Template}", results.Count, Path.GetFileName(templatePath));
return Task.FromResult(results);
return Task.Run(() =>
{
var results = _templateMatch.MatchAll(templatePath, region, threshold);
if (!silent)
Log.Information("TemplateMatchAll: {Count} matches for {Template}", results.Count, Path.GetFileName(templatePath));
return results;
});
}
// -- Save --