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); }
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); }
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); }
public static int FindAllButtons(CATSimage button, int tries = 1) { return(ImageRecognition.FindButton(button, tries)); }
public static bool FindButton(CATSimage button, int tries = 1) { return(ImageRecognition.FindButton(button, tries) > 0); }