Esempio n. 1
0
        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);
            }
        }