/// <summary> /// /// </summary> /// <param name="viewportMat"></param> /// <param name="viewportRect"></param> /// <param name="depth">主线剧情界面这种算第一层</param> public void DoListSceneThings(Mat viewportMat, RECT viewportRect, int depth) { if (depth >= 3) { return; } logTools.Info($"DoListSceneThings; CurStory: {CurStory}; Depth: {depth}"); var listRectRate = new Vec4f(0.5342f, 0.1210f, 0.9789f, 0.8790f); var matchRes = MatchImage(viewportMat, viewportRect, listRectRate, "story_new_tag_inner.png", listItemNewTagThreshold); if (matchRes.Success) { ClickListItem(viewportRect, listRectRate, matchRes.MatchedRect); Thread.Sleep(2000); var newViewportRect = MumuState.ViewportRect; var newViewportCapture = MumuState.DoCapture(newViewportRect); DoListSceneThings(newViewportCapture.ToOpenCvMat(), viewportRect, depth + 1); } else { if (DragListTimes > 10) { MumuState.ClickBack(viewportRect); } else { MumuState.DoDrag(viewportRect, new Vec2f(0.7700f, 0.7012f), new Vec2f(0.7700f, 0.2332f), 1200); DragListTimes += 1; } } }
public override void Tick(Bitmap viewportCapture, RECT viewportRect) { var viewportMat = viewportCapture.ToOpenCvMat(); if (IsDataDownloadWin(viewportMat, viewportRect)) { logTools.Info("DataDownloadWin"); MumuState.ClickDataDownloadButton(viewportRect, false); } else if (TryClickChoiceOne(viewportMat, viewportRect)) { logTools.Info("TryClickChoiceOne"); } else if (IsReliabilityMainScene(viewportMat, viewportRect)) { DoMainSceneThings(viewportMat, viewportRect); } else if (IsReliabilityEpisodeScene(viewportMat, viewportRect)) { DoEpisodeSceneThings(viewportMat, viewportRect); } else { logTools.Info("ClickBack"); MumuState.ClickBack(viewportRect); } }
public override void Tick(Bitmap viewportCapture, RECT viewportRect) { if (viewportCapture.Width < 10 || viewportCapture.Height < 10) { logTools.Info("Capture Size Sucks, Special Process, Click Skip"); MumuState.ClickSkipConfirmButton(viewportRect); return; } var viewportMat = viewportCapture.ToOpenCvMat(); if (IsStoryMainScene(viewportMat, viewportRect)) { DoMainSceneThings(viewportMat, viewportRect); DragListTimes = 0; } else if (IsStoryListScene(viewportMat, viewportRect)) { DoListSceneThings(viewportMat, viewportRect, 1); } else if (IsDataDownloadWin(viewportMat, viewportRect)) { MumuState.ClickDataDownloadButton(viewportRect, false); ClickMenuButtonTimes = 0; DragListTimes = 0; } else if (HasSkipConfirmButton(viewportMat, viewportRect)) { MumuState.ClickSkipConfirmButton(viewportRect); } else if (HasSkipButton(viewportMat, viewportRect)) { MumuState.ClickSkipButton(viewportRect); } else if (HasMenuButton(viewportMat, viewportRect)) { MumuState.ClickMenuButton(viewportRect); ClickMenuButtonTimes += 1; if (ClickMenuButtonTimes > 5) { MumuState.ClickBack(viewportRect); } } else { logTools.Info("Found Nothing, Click Back"); MumuState.ClickBack(viewportRect); } }
public override void Tick(Bitmap viewportCapture, RECT viewportRect) { var viewportMat = viewportCapture.ToOpenCvMat(); var f = true; if (TryClickChallengeButton(viewportMat, viewportRect)) { logTools.Info("TryClickChallengeButton"); } else if (TryClickStartFightButton(viewportMat, viewportRect)) { logTools.Info("TryClickStartFightButton"); } else if (TryClickAutoOffButton(viewportMat, viewportRect)) { logTools.Info("TryClickAutoOffButton"); } else if (TryClickNextStepButton(viewportMat, viewportRect)) { logTools.Info("TryClickNextStepButton"); } else if (TryClickGobackUnderGroundButton(viewportMat, viewportRect)) { logTools.Info("TryClickGobackUnderGroundButton"); } else { f = false; } if (!f) { var b1 = TryClickNormalBox(viewportMat, viewportRect); var b2 = TryClickSpecailBox(viewportMat, viewportRect); if (!b1 && !b2) { logTools.Info("Click Back"); MumuState.ClickBack(viewportRect); } } TryClickNormalBox(viewportMat, viewportRect); }
public void DoEpisodeSceneThings(Mat viewportMat, RECT viewportRect) { logTools.Info("DoEpisodeSceneThings"); var threshold = 0.6; var rectRate = new Vec4f(0.0408f, 0.0350f, 0.9651f, 0.8499f); var matchRes = MatchImage(viewportMat, viewportRect, rectRate, "reliability_episode_new_tag.png", threshold); if (matchRes.Success) { var absoluteRect = GetMatchedAbsoluteRect(viewportRect, rectRate, matchRes.MatchedRect); var emulatorPoint = MumuState.GetEmulatorPoint(viewportRect, absoluteRect.GetCenterPos()); MumuState.DoClick(emulatorPoint); } else { logTools.Info("DoEpisodeSceneThings Cannot Find New Tag"); MumuState.ClickBack(viewportRect); } }