attacking fixed
This commit is contained in:
parent
109b1b4059
commit
f914443d86
5 changed files with 96 additions and 66 deletions
|
|
@ -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 --
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue