Exemple #1
0
        /// <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;
                }
            }
        }
Exemple #2
0
        public void DoMainSceneThings(Mat viewportMat, RECT viewportRect)
        {
            logTools.Info("DoMainSceneThings");

            var listItemNewTagThreshold = 0.6;
            var listRectRate            = new Vec4f(0.5378f, 0.1254f, 0.9760f, 0.8834f);
            var matchRes = MatchImage(viewportMat, viewportRect, listRectRate, "reliability_new_tag.png", listItemNewTagThreshold);

            if (matchRes.Success)
            {
                var absoluteRect  = GetMatchedAbsoluteRect(viewportRect, listRectRate, matchRes.MatchedRect);
                var emulatorPoint = MumuState.GetEmulatorPoint(viewportRect, absoluteRect.GetCenterPos());
                MumuState.DoClick(emulatorPoint);
            }
            else
            {
                logTools.Info("DoMainSceneThings Cannot Find New Tag");
                MumuState.DoDrag(viewportRect, new Vec2f(0.7700f, 0.7012f), new Vec2f(0.7700f, 0.2332f), 1200);
            }
        }