public static bool checkForLeagueEnd() { // Does anything happen when you get put in a better league? Gonna have to test that. // If not, this should work already. Bitmap league_end_label = BotHelper.getResourceByName("label_league_over"); Point labelPoint = ImageRecognition.getPictureLocation(comparePic, league_end_label); if (labelPoint != pNull) { // League ended. We gotta press "Claim" now and open that chest. :) BotHelper.randomDelay(1000, 100); Bitmap claimButton = BotHelper.getResourceByName("button_claim_onend"); Point claimPoint = ImageRecognition.getPictureLocation(comparePic, claimButton); if (claimPoint != pNull) { ADBHelper.simulateClick(claimPoint); BotHelper.randomDelay(1000, 100); ChestLogic.openChest(); } else { BotHelper.Log("Couldn't find claim button for leagueEnd. Returning to regular duty."); } return(true); } return(false); }
public static bool checkForChestInForeground() { Bitmap regChest = BotHelper.getResourceByName("label_regularbox"); Bitmap supChest = BotHelper.getResourceByName("label_super_box"); Bitmap legChest = BotHelper.getResourceByName("label_legendary_box"); Point pRegChest = ImageRecognition.getPictureLocation(comparePic, regChest); Point pSupChest = ImageRecognition.getPictureLocation(comparePic, supChest); Point pLegChest = ImageRecognition.getPictureLocation(comparePic, legChest); if (pRegChest != pNull || pSupChest != pNull || pLegChest != pNull) { ChestLogic.openChest(); return(true); } return(false); }
public static bool checkForChampionshipEnd() { // This should work as long as you don't get promoted. If you happen to be promoted, the bot will probably be stuck at the sticker selection. Bitmap league_end_label = BotHelper.getResourceByName("label_championship_over"); Point labelPoint = ImageRecognition.getPictureLocation(comparePic, league_end_label); if (labelPoint != pNull) { // Championship ended. We gotta press "Claim" now and open that chest. :) BotHelper.randomDelay(1000, 100); Bitmap claimButton = BotHelper.getResourceByName("button_claim_onend"); Point claimPoint = ImageRecognition.getPictureLocation(comparePic, claimButton); if (claimPoint != pNull) { ADBHelper.simulateClick(claimPoint); BotHelper.randomDelay(1000, 100); ChestLogic.openChest(); BotHelper.randomDelay(2000, 100); Bitmap backButton = BotHelper.getResourceByName("button_champ_back"); Point backPoint = ImageRecognition.getPictureLocation(backButton); ADBHelper.simulateClick(backPoint); BotHelper.randomDelay(1000, 100); ADBHelper.simulateClick(backPoint); BotHelper.randomDelay(1000, 100); } else { BotHelper.Log("Couldn't find claim button for champEnd. Returning to regular duty."); } return(true); } return(false); }