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); } }