fix: auto get daily rewards not work #225

This commit is contained in:
huiyadanli
2024-01-17 23:31:33 +08:00
parent ee2f9f9368
commit 288c2856ca
2 changed files with 4 additions and 4 deletions

View File

@@ -119,7 +119,7 @@ public class Avatar
/// </summary>
public void Switch()
{
for (var i = 0; i < 40; i++)
for (var i = 0; i < 30; i++)
{
if (Cts is { IsCancellationRequested: true })
{
@@ -138,7 +138,7 @@ public class Avatar
AutoFightContext.Instance().Simulator.KeyPress(User32.VK.VK_1 + (byte)Index - 1);
// Debug.WriteLine($"切换到{Index}号位");
// Cv2.ImWrite($"log/切换.png", content.CaptureRectArea.SrcMat);
Sleep(250, Cts); // 比1秒多一点给截图留出时间
Sleep(250, Cts);
}
}

View File

@@ -223,10 +223,10 @@ public class AutoSkipTrigger : ITaskTrigger
using var mat = new Mat(captureMat, textRect);
// 只提取橙色
using var bMat = OpenCvCommonHelper.Threshold(mat, new Scalar(247, 198, 50), new Scalar(255, 204, 54));
// Cv2.ImWrite("bMat2.png", bMat);
// Cv2.ImWrite("log/每日委托.png", bMat);
var whiteCount = OpenCvCommonHelper.CountGrayMatColor(bMat, 255);
var rate = whiteCount * 1.0 / (bMat.Width * bMat.Height);
if (rate < 0.1)
if (rate < 0.06)
{
Debug.WriteLine($"识别到橙色文字区域占比:{rate}");
return string.Empty;