예제 #1
0
        private async Task TransferDuplicatePokemon(bool keepPokemonsThatCanEvolve = false)
        {
            var duplicatePokemons = await _inventory.GetDuplicatePokemonToTransfer(keepPokemonsThatCanEvolve, _clientSettings.PokemonsNotToTransfer);

            // Currently not returns the correct value
            //if (duplicatePokemons != null && duplicatePokemons.Any())
            //    Logger.Normal(ConsoleColor.DarkYellow, $"(TRANSFER) {duplicatePokemons.Count()} Pokemon:");

            foreach (var duplicatePokemon in duplicatePokemons)
            {
                if (CalculatePokemonPerfection(duplicatePokemon) >= _clientSettings.KeepMinIVPercentage || duplicatePokemon.Cp > _clientSettings.KeepMinCP)
                {
                    continue;
                }

                var bestPokemonOfType = await _inventory.GetHighestCPofType(duplicatePokemon);

                var transfer = await _client.TransferPokemon(duplicatePokemon.Id);

                _stats.increasePokemonsTransfered();
                _stats.updateConsoleTitle(_inventory);

                Logger.Normal(ConsoleColor.DarkYellow, $"(TRANSFER) {duplicatePokemon.PokemonId} with {duplicatePokemon.Cp} CP (Best: {bestPokemonOfType})");
                await Task.Delay(500);
            }
        }
예제 #2
0
        private async Task TransferDuplicatePokemon(bool keepPokemonsThatCanEvolve = false)
        {
            if (_clientSettings.TransferDoublePokemons)
            {
                var duplicatePokemons = await _inventory.GetDuplicatePokemonToTransfer(keepPokemonsThatCanEvolve);

                foreach (var duplicatePokemon in duplicatePokemons)
                {
                    if (!_clientSettings.pokemonsToHold.Contains(duplicatePokemon.PokemonId))
                    {
                        if (duplicatePokemon.Cp > _clientSettings.DontTransferWithCPOver)
                        {
                            continue;
                        }

                        var bestPokemonOfType = await _inventory.GetHighestCPofType(duplicatePokemon);

                        var transfer = await _client.TransferPokemon(duplicatePokemon.Id);

                        Logger.ColoredConsoleWrite(ConsoleColor.Yellow, $"Transfer {StringUtils.getPokemonNameByLanguage(_clientSettings, duplicatePokemon.PokemonId)} CP {duplicatePokemon.Cp} IV {Math.Round(duplicatePokemon.CalculateIV())}% (Best: {bestPokemonOfType} CP)", LogLevel.Info);
                        await RandomHelper.RandomDelay(500, 700);
                    }
                }
            }
        }
예제 #3
0
        private async Task TransferDuplicatePokemon(bool keepPokemonsThatCanEvolve = false)
        {
            if (_clientSettings.TransferDoublePokemons)
            {
                var duplicatePokemons = await _inventory.GetDuplicatePokemonToTransfer(keepPokemonsThatCanEvolve);

                foreach (var duplicatePokemon in duplicatePokemons)
                {
                    if (!_clientSettings.pokemonsToHold.Contains(duplicatePokemon.PokemonId))
                    {
                        if (duplicatePokemon.Cp > _clientSettings.DontTransferWithCPOver)
                        {
                            continue;
                        }

                        var bestPokemonOfType = await _inventory.GetHighestCPofType(duplicatePokemon);

                        var bestPokemonsCPOfType = await _inventory.GetHighestCPofType2(duplicatePokemon);

                        var bestPokemonsIVOfType = await _inventory.GetHighestIVofType(duplicatePokemon);

                        var transfer = await _client.TransferPokemon(duplicatePokemon.Id);

                        Logger.ColoredConsoleWrite(ConsoleColor.Yellow, $"Transfer {StringUtils.getPokemonNameByLanguage(_clientSettings, duplicatePokemon.PokemonId)} CP {duplicatePokemon.Cp} IV {Math.Round(duplicatePokemon.CalculateIV())}% (Best: {bestPokemonsCPOfType.First().Cp} CP, IV {Math.Round(bestPokemonsIVOfType.First().CalculateIV())}%)", LogLevel.Info);
                        //Logger.ColoredConsoleWrite(ConsoleColor.Yellow, $"Transfer {StringUtils.getPokemonNameByLanguage(_clientSettings, duplicatePokemon.PokemonId)} CP {duplicatePokemon.Cp} IV {Math.Round(duplicatePokemon.CalculateIV())}% (Best: {bestPokemonOfType} CP)", LogLevel.Info);

                        try
                        {
                            TelegramUtil.getInstance().sendInformationText(TelegramUtil.TelegramUtilInformationTopics.Transfer, StringUtils.getPokemonNameByLanguage(_clientSettings, duplicatePokemon.PokemonId), duplicatePokemon.Cp, Math.Round(duplicatePokemon.CalculateIV()), bestPokemonOfType);
                        }
                        catch (Exception)
                        {
                            // ignored
                        }

                        await RandomHelper.RandomDelay(500, 700);
                    }
                }
            }
        }