brianzhouzc / RocketBot

An automated Pokémon Go Bot
GNU General Public License v3.0
564 stars 315 forks source link

Evolve above IV #560

Open Gateway753 opened 8 years ago

Gateway753 commented 8 years ago

For exemple, evolve pokémon only above 90% IV Can someone make this?

MatthewHudnall commented 8 years ago

In mainform.cs, something like this should work:

private async Task EvolveAllGivenPokemons(Client client, IEnumerable pokemonToEvolve) { foreach (var pokemon in pokemonToEvolve) { if(Math.Round(Perfect(pokemon))>=90) {

Solrian commented 8 years ago

I wrote a similar evolveroutine for myself. This would generate a List of Pokemon above a certain IV and then try to evolve them all.

replace if (ClientSettings.EvolveAllGivenPokemons) await EvolveAllGivenPokemons(client, pokemons); with if (ClientSettings.EvolveAllGivenPokemons) await evolvemaxIV(client, 90);

put in mainform.cs

private async Task evolvemaxIV(Client client, int minIV) { var pokemonstoevolve = new List { }; var inventory = await client.GetInventory(); var pokemons = inventory.InventoryDelta.InventoryItems .Select(i => i.InventoryItemData?.Pokemon) .Where(p => p != null && p?.PokemonId > 0) .OrderByDescending(key => key.Cp); foreach (var pokemon in pokemons) { if (((float)(pokemon.IndividualAttack + pokemon.IndividualDefense + pokemon.IndividualStamina) / (3.0f * 15.0f)) * 100.0f >= minIV) { pokemonstoevolve.Add(Convert.ToString(pokemon.PokemonId)); } } var toevolve = inventory.InventoryDelta.InventoryItems .Select(i => i.InventoryItemData?.Pokemon) .Where(p => p != null && pokemonstoevolve.Contains(Convert.ToString(p?.PokemonId))); await EvolveAllGivenPokemons(client, toevolve); }

maddhadder90 commented 8 years ago

@Solrian what mode do you have the transfer on while using your code? I currently use the duplicateIV transfer option.

Solrian commented 8 years ago

my personal code is a little more complex than this example, but i use it on duplicateIV also.