public static int AllyCreepHealth() { //Get matching x pixels of the health bar int value = ImageRecognition.MatchingXPixels("Game/allycreephealth.png", 3); //Get total pixels of health bar int total = PixelCache.GetWidth("Game/allycreephealth.png"); //Get percentage of 100 return((int)Math.Round(100d * value / total)); }
//Return health value percentage public static int Mana() { //Get matching x pixels of the health bar int value = ImageRecognition.MatchingXPixels("Game/mana.png", 40); //Get total pixels of health bar int total = PixelCache.GetWidth("Game/mana.png"); //Get percentage of 100 return((int)Math.Round((double)(100 * value) / total)); }