public BattleAlgorithm() { ocr = new UtilsOcr(); nav = new Navigation(); WriteHelper = new WriteHelper(); config = new ConfigurationFile(); }
public HustleCastleBot() { navigation = new Navigation(); ocr = new UtilsOcr(); config = new ConfigurationFile(); adb = new UtilsAdb(); writer = new WriteHelper(); }
/// <summary> /// Muestra el poder de los jugadores /// </summary> public void ShowPlayersPower() { if (ActualLocation == Places.BattlePopUp) { UtilsOcr ocr = new UtilsOcr(); var powers = ocr.GetPlayersPower(); string myPower = powers.Item1.ToString("N0", System.Globalization.CultureInfo.GetCultureInfo("de")); string enemyPower = powers.Item2.ToString("N0", System.Globalization.CultureInfo.GetCultureInfo("de")); WriteHelper.WriteInfo($"Poder de mi equipo: {myPower}, poder enemigo: {enemyPower}"); } }
/// <summary> /// Muestra las almas oscuras actuales /// </summary> /// <returns></returns> public int ShowActualDarkSouls() { if (ActualLocation == Places.Portal) { UtilsOcr ocr = new UtilsOcr(); var ds = ocr.GetDarkSouls(); WriteHelper.WriteInfo($"Almas oscuras actuales: {ds.ToString("N0", System.Globalization.CultureInfo.GetCultureInfo("de"))}"); return(ds); } return(0); }
/// <summary> /// Obtiene el estado de la posición en la arena /// </summary> /// <param name="image"></param> /// <param name="place"></param> /// <returns></returns> public PositionState GetPositionState(Image image, Places place) { UtilsOcr ocr = new UtilsOcr(); Navigation nav = new Navigation(); DustPosition position = new DustPosition(place); image = ocr.CropImage(image, new Rectangle(position.x, position.y, position.xRange, position.yRange)); if (nav.AreColorsSimilar(nav.GetPixelColor(image, 0, 0), Color.FromArgb(255, 243, 89))) { return(PositionState.MyPosition); } if (nav.AreColorsSimilar(nav.GetPixelColor(image, 6, 2), Color.FromArgb(188, 188, 188))) { return(PositionState.Played); } else { return(PositionState.UnPlayed); } }
/// <summary> /// Obtiene si ya se ha efectuado la pelea en la arena /// </summary> /// <param name="image"></param> /// <param name="place"></param> /// <returns></returns> public bool IsPositionBattleFinished(Image image, Places place) { UtilsOcr ocr = new UtilsOcr(); Navigation nav = new Navigation(); DustPosition position = new DustPosition(place); var matriz = new Rectangle(position.x, position.y, position.xRange, position.yRange); image = ocr.CropImage(image, matriz); for (int x = 0; x < position.xRange; x++) { for (int y = 0; y < position.yRange; y++) { if (AreColorsSimilar(GetPixelColor(image, x, y), Color.FromArgb(113, 215, 48))) { return(true); } } } return(false); }
public Navigation() { WriteHelper = new WriteHelper(); adb = new UtilsAdb(); ocr = new UtilsOcr(); }