Example #1
0
        public static bool FindAndClickButton(CATSimage button, int tries = 1, double tolerance = 0.2)
        {
            if (ImageRecognition.FindButton(button, tries) == 0)
            {
                return(false);
            }

            ADB.ClickButton(button, tolerance);

            return(true);
        }
Example #2
0
        public static bool FindAndClickButtonWithSleep(CATSimage button, int seconds = 2, double tolerance = 0.2)
        {
            for (int i = 0; i < seconds; i++)
            {
                if (ImageRecognition.FindButton(button, 2) > 0)
                {
                    ADB.ClickButton(button, tolerance);
                    return(true);
                }

                Thread.Sleep(1000);
            }

            return(false);
        }
Example #3
0
        public static bool RepeatFindButton(CATSimage button, int seconds = 2, int sleep = 0)
        {
            if (ImageRecognition.FindButton(button, SettingsManager.settings.GetLatency()) > 0)
            {
                return(true);
            }

            for (int i = 0; i < seconds; i++)
            {
                if (ImageRecognition.FindButton(button, 2) > 0)
                {
                    return(true);
                }

                ADB.ClickBack();

                if (sleep > 0)
                {
                    Thread.Sleep(sleep);
                }
            }

            return(false);
        }
Example #4
0
 public static int FindAllButtons(CATSimage button, int tries = 1)
 {
     return(ImageRecognition.FindButton(button, tries));
 }
Example #5
0
 public static bool FindButton(CATSimage button, int tries = 1)
 {
     return(ImageRecognition.FindButton(button, tries) > 0);
 }