Skip to content

Commit

Permalink
fix trigger point
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyadanli committed Nov 20, 2023
1 parent 6a7123f commit 70c1339
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,18 @@ public void Init()

private Rect _fishBoxRect = Rect.Empty;

private DateTime _prevExecute = DateTime.MinValue;

public void OnCapture(CaptureContent content)
{
// 进入独占的判定
if (!IsExclusive)
{
if (!content.IsReachInterval(TimeSpan.FromMilliseconds(300)))
if ((DateTime.Now - _prevExecute).TotalMilliseconds <= 200)
{
return;
}
_prevExecute = DateTime.Now;

// 进入独占模式判断
CheckFishingUserInterface(content);
Expand All @@ -96,10 +99,11 @@ public void OnCapture(CaptureContent content)
// 进入钓鱼界面先尝试获取钓鱼框的位置
if (_fishBoxRect.Width == 0)
{
if (!content.IsReachInterval(TimeSpan.FromMilliseconds(200)))
if ((DateTime.Now - _prevExecute).TotalMilliseconds <= 200)
{
return;
}
_prevExecute = DateTime.Now;

_fishBoxRect = GetFishBoxArea(content.CaptureRectArea.SrcMat);
CheckFishingUserInterface(content);
Expand Down
5 changes: 4 additions & 1 deletion BetterGenshinImpact/GameTask/AutoSkip/AutoSkipTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ public void Init()
/// </summary>
private DateTime _prevPlayingTime = DateTime.MinValue;

private DateTime _prevExecute = DateTime.MinValue;

public void OnCapture(CaptureContent content)
{
if (content.IsReachInterval(TimeSpan.FromMilliseconds(200)))
if ((DateTime.Now - _prevExecute).TotalMilliseconds <= 200)
{
return;
}
_prevExecute = DateTime.Now;

var config = TaskContext.Instance().Config.AutoSkipConfig;
var assetScale = TaskContext.Instance().SystemInfo.AssetScale;
Expand Down
7 changes: 7 additions & 0 deletions BetterGenshinImpact/GameTask/CaptureContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,16 @@ public CaptureContent(Bitmap srcBitmap, int frameIndex, double interval, TaskTri
/// <summary>
/// 达到了什么时间间隔
/// 最大MaxFrameIndexSecond秒
///
/// 这代码有bug
/// 这代码有bug
/// 这代码有bug
///
/// 不用了
/// </summary>
/// <param name="interval"></param>
/// <returns></returns>
[Obsolete]
public bool IsReachInterval(TimeSpan interval)
{
if (interval.TotalSeconds > MaxFrameIndexSecond)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static void Done()
Thread.Sleep(100);
// 强化菜单 150x220
clickOffset.Click(150, 220);
Thread.Sleep(100);
// 移动回快捷放入 #30
clickOffset.Move(1760, 770);
}
Expand Down
1 change: 1 addition & 0 deletions BetterGenshinImpact/User/pick_black_lists.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[
"钓莓",
"钓查",
"调蟹",
"",
"",
Expand Down

0 comments on commit 70c1339

Please sign in to comment.