コード例 #1
0
ファイル: OpenObjects.cs プロジェクト: DanyaalA/TapTapFarmer
        public static void OpenPlanetTrial()
        {
            //No Need to call OpenCastle Since this is at top of castle

            //Get Attention of screen incase its not ontop
            WindowCapture.CaptureApplication("Nox");

            //Opening up Castle
            MouseHandler.MoveCursor(LocationConstants.HOME_BOTTOM_CASTLE_LOCATION, true);
            MouseHandler.MoveCursor(LocationConstants.CASTLE_SCROLL_LOCATION);
            Main.Sleep(2);

            //Scrolling to top of castle
            for (int i = 0; i < 8; i++)
            {
                MouseHandler.MouseWheelUp();
                Main.Sleep(1);
            }


            //Search Pixel Method is better than Specific location Since Expedition is an animation
            if (PixelChecker.SearchPixel(ColorConstants.CASTLE_PLANET_TRIAL_COLOR, out Point Location))
            {
                MouseHandler.MoveCursor(Location, true);
            }
            else
            {
                //TODO: Max 3 Retries before giving up
                OpenPlanetTrial();
            }
        }
コード例 #2
0
ファイル: OpenObjects.cs プロジェクト: DanyaalA/TapTapFarmer
        public static void OpenFortuneWheel()
        {
            OpenCastle();
            MouseHandler.MouseWheelUp();
            Main.Sleep(2);
            MouseHandler.MouseWheelUp();

            //Mouse Wheel Up doesnt always move the same amount upwards so searching for the pixel is used instead of a specific location
            if (PixelChecker.SearchPixel(ColorConstants.CASTLE_FORTUNE_WHEEL_COLOR, out Point Location))
            {
                MouseHandler.MoveCursor(Location, true);
            }
            else
            {
                //TODO: Max 3 Retries before giving up
                OpenFortuneWheel();
            }
        }