Code Monkey home page Code Monkey logo

Comments (10)

mroge009 avatar mroge009 commented on May 29, 2024 5

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()
                        }
                    }
                }
            }
        }
    }
}

from pokemongobot.

bluebabyf1 avatar bluebabyf1 commented on May 29, 2024 2

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

from pokemongobot.

mroge009 avatar mroge009 commented on May 29, 2024

@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

from pokemongobot.

pascalpfeil avatar pascalpfeil commented on May 29, 2024

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.

from pokemongobot.

Orabig avatar Orabig commented on May 29, 2024

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

from pokemongobot.

Agronis avatar Agronis commented on May 29, 2024

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.

from pokemongobot.

Mixone-FinallyHere avatar Mixone-FinallyHere commented on May 29, 2024

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 😢

from pokemongobot.

Orabig avatar Orabig commented on May 29, 2024

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
#5 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACFENxkZIavRT64Ekns1HeHl8TTKDwZLks5qe4dwgaJpZM4JQzeC
.

from pokemongobot.

Mixone-FinallyHere avatar Mixone-FinallyHere commented on May 29, 2024

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

from pokemongobot.

Mixone-FinallyHere avatar Mixone-FinallyHere commented on May 29, 2024

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

from pokemongobot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.