PokemonGoBot icon indicating copy to clipboard operation
PokemonGoBot copied to clipboard

Evolve Pokemon

Open jabbink opened this issue 10 years ago • 10 comments

General gameplay

  • [ ] Sort by Pokemon family
  • [ ] check if player has enough candy to evolve highest available Pokemon family member
  • [ ] if yes, evolve

For special occasions:

  • [ ] farm cheap pokemon
  • [ ] drop lucky egg
  • [ ] mass evolve

jabbink avatar Jul 20 '16 13:07 jabbink

Started working on evolutionary transfers.
Keeps just as many as you need to evolve.

pgo1

class Release : Task {
    override fun run(context: Context?) {
        val groupedPokemon = context!!.api.pokebank.pokemons.groupBy { it.pokemonId }
        groupedPokemon.forEach {
            val sorted = it.value.sortedByDescending { it.cp }
            for ((index, pokemon) in sorted.withIndex()) {
                when (pokemon.pokemonId.name) {
                    "RATTATA" -> if (index > pokemon.candy / 25) {
                        println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} because you currently have ${pokemon.getCandy() / 25} evolutions pending")
                        pokemon.transferPokemon()
                    }
                    "PIDGEY" -> if (index > pokemon.candy / 12) {
                        println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} because you currently have ${pokemon.getCandy() / 12} evolutions pending")
                        pokemon.transferPokemon()
                    }
                    "WEEDLE" -> if (index > pokemon.candy / 12) {
                        println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} because you currently have ${pokemon.getCandy() / 12} evolutions pending")
                        pokemon.transferPokemon()
                    }
                    "CATERPIE" -> if (index > pokemon.candy / 12) {
                        println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} because you currently have ${pokemon.getCandy() / 12} evolutions pending")
                        pokemon.transferPokemon()
                    }
                    else -> {
                        if (index > 0 && pokemon.cp < 50) {
                            println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp}")
                            pokemon.transferPokemon()
                        }
                    }
                }
            }
        }
    }
}

Marrcroger avatar Jul 22 '16 01:07 Marrcroger

Hi mroge009, could you please tell me where do I add your code? I'm a bit noob on code aswell so your help would be grateful. Thanks

bluebabyf1 avatar Jul 22 '16 14:07 bluebabyf1

@bluebabyf1 Replace the code in your releasepokemon.kt with this if you want to use the same functionality. It keeps Rattatas, pidgey, caterpies, and weedles but you can add others.

groupedPokemon.forEach {
            val sorted = it.value.sortedByDescending { it.cp }
            for ((index, pokemon) in sorted.withIndex()) {
                var IV = ((pokemon.individualStamina + pokemon.individualAttack + pokemon.individualDefense) * 100) / 45
                // never transfer highest rated Pokemon
                // never transfer > maxCP, unless set in obligatoryTransfer
                // stop releasing when pokemon is set in ignoredPokemon
                when (pokemon.pokemonId.name) {
                    "RATTATA" -> if (index > pokemon.candy / 25) {
                        println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} because you currently have ${pokemon.getCandy() / 25} evolutions pending")
                        pokemon.transferPokemon()
                    }
                    "PIDGEY", "WEEDLE", "CATERPIE" -> if (index > pokemon.candy / 12) {
                        println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} because you currently have ${pokemon.getCandy() / 12} evolutions pending")
                        pokemon.transferPokemon()
                    }
                    else -> {
                        if (index > 0 && (pokemon.cp < maxCP || obligatoryTransfer.contains(pokemon.pokemonId.name)) &&
                                (!ignoredPokemon.contains(pokemon.pokemonId.name)) && IV < 80) {
                            println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} and IV ${IV}")
                            pokemon.transferPokemon()
                        }
                    }
                }
            }
        }

In terms of an IDE I am using InteliJ IDEA and just pulled from the GIT repo

Marrcroger avatar Jul 22 '16 17:07 Marrcroger

I think now is a good time to implement this, because the bot is kind of good now, and you get to level 20 easily. But from that onwards, progress is rather slow. So a mode to fram 12 candy evolution pkmn & mass evolving in combination with a lucky egg would be really nice.

pascalpfeil avatar Jul 22 '16 20:07 pascalpfeil

I wrote an "auto evolve" feature in PR #163

Orabig avatar Jul 23 '16 23:07 Orabig

I might suggest the following parameters for "evolve_mode" if you would..

  • On connection, loop through inventory to determine possible / current evolutions.
    • Establish current_evolutions via:
    •   (((pokemon_candy / required_candy) + pokemon_candy) / required_candy) / pokemon_type_quantity
      
    • possible_evolutions are for each pokemon that has an excess of candy over quantity of pokemon.
  • Provide configuration for the following:
    • require_luckyEgg : Only evolve if lucky egg is active.
    • required_evolutions : Evolutions needed to begin evolving if require_luckyEgg is active.
      • This number should not exceed 60 to represent non-bot capabilities (avoid ban).
    • pokemon_to_evolve : Only these pokemon will be evolved.
    • build_pokedex : Evolve to higher tiers to add new pokedex registries as needed.
    • Evolved Pokemon should follow prior configuration requirements for IV/CP.

Agronis avatar Jul 24 '16 20:07 Agronis

Mixed with the evolution multipliers could calculate if it is at best moment to evolve no? Any progress on this yet? I'd help but I'm not good enough with java 😢

Mixone-FinallyHere avatar Aug 11 '16 20:08 Mixone-FinallyHere

Well, @Miguel, you can help by giving the formula for the computation and explain the criteria. Someone will then use this to implement the fonctionality...

2016-08-11 22:34 GMT+02:00 Miguel [email protected]:

Mixed with the evolution multipliers could calculate if it is at best moment to evolve no? Any progress on this yet? I'd help but I'm not good enough with java 😢

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jabbink/PokemonGoBot/issues/5#issuecomment-239283663, or mute the thread https://github.com/notifications/unsubscribe-auth/ACFENxkZIavRT64Ekns1HeHl8TTKDwZLks5qe4dwgaJpZM4JQzeC .

Orabig avatar Aug 12 '16 09:08 Orabig

We would need an array then that contains floats with the multiplication value it would be an expected value, the actual could be higher or lower but still

Then we have a table that contains the max cp of a certain pokemon at your level

If pokemons CP is at least 75% of its maximum possible (so if say Pikachu could have 1000 CP minimum CP to evolve will be 750) this can be set by user though

We then calculate what its expected CP will be from that array using the pokemons ID as an index in both tables, if that CP is higher than amount set up by user for auto transfer, and all limits existing like max amount etc... proceed to evolve if its IV was a desirable one

Also in the table having final evolutions with a value of 0 (not NULL) so that even if there is a bug trying to evolve them it wont since 0 CP is always unwanted

Mixone-FinallyHere avatar Aug 12 '16 09:08 Mixone-FinallyHere

I only mention IV at the end because people might want to evolve pokemon even if they have low IV so IV check here will be in theory unrelated to unwanted IV check from captures for auto transfer

Another extra implement might be actually checking in the pokedex if they have the pokemon or not also so as to give it a certain priority

Mixone-FinallyHere avatar Aug 12 '16 09:08 Mixone-FinallyHere