public static int findShiki(int swipeCount) { int start_y = 441; int start_x = 136; int end_x = 917; int width = 113; int height = 161; var current_x = start_x; Bitmap[] imagesFind = { shikiMaxImage, shikiFightImage }; List <int> searchResult = null; while (!Global.isStop && current_x < end_x) { searchResult = GameImage.findMultiGameImage(imagesFind, true, current_x, start_y, width, height); if (searchResult.Count < 1) { return(current_x); } else { GameHelper.Log("Khong hop le"); current_x += width; } } return(-1); }
public static bool waitBattleEnd() { Bitmap[] images = { loseImage, goldImage }; List <int> imageResult = new List <int>(); int i = 0; while (i < 20) { GameHelper.Delay(3000); imageResult = GameImage.findMultiGameImage(images); if (imageResult.Count() > 0) { break; } i++; } if (imageResult.Count() < 1) { GameHelper.Log("Battle Error"); return(false); } if (imageResult[0] == 1) { GameHelper.Log("Win Battle"); return(true); } if (imageResult[0] == 0) { GameHelper.Log("Lose Battle"); return(true); } /*bool result = GameImage.waitGameImage(goldImage, 100000, 5000); * if (result == true) * { * GameHelper.Log("End Battle"); * return true; * }*/ return(false); }