Code Monkey home page Code Monkey logo

Comments (9)

mroge009 avatar mroge009 commented on May 29, 2024 1

I added IV calculation with options in the properties to set minIV.

config.properties

#Minimum IV to keep a pokemon
transfer_IV_threshold=90

Bot.kt
EDIT: This is not required. Just added to show current IV of pokebank.

api.pokebank.pokemons.map {
            var IV = ((it.individualStamina + it.individualAttack + it.individualDefense) * 100) / 45
            "Have ${it.pokemonId.name} (${it.nickname}) with ${it.cp} CP and IV ${IV}"
        }.forEach { println(it) }

Settings.kt
val transferIVThreshold = getPropertyIfSet("Minimum IV to keep a pokemon", "transfer_IV_threshold", 80, String::toInt)

Releasepokemon.kt
EDIT: Removed unfinished evolution transfer limits

val minIV = settings.transferIVThreshold

        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
                        if (index > 0 && (pokemon.cp < maxCP || obligatoryTransfer.contains(pokemon.pokemonId.name)) &&
                                (!ignoredPokemon.contains(pokemon.pokemonId.name)) && IV < minIV) {
                            println("Going to transfer ${pokemon.pokemonId.name} with CP ${pokemon.cp} and IV ${IV}")
                            pokemon.transferPokemon()
                        }
                }
            }
        }

from pokemongobot.

mroge009 avatar mroge009 commented on May 29, 2024 1

Yes, I forgot to remove that.
That's for me, and I am going to add a evolution switch which will use lucky eggs and do as many evolution as possible

EDIT: The bot.kt is not required. It is only so you can see the IV of current pokebank

from pokemongobot.

tonysguo avatar tonysguo commented on May 29, 2024 1

@mroge009 yes sorry you are right, I went back to look at the formula, it is only atk/def/sta.

var IV = ((it.individualStamina + it.individualAttack + it.individualDefense) * 100) / 45

is correct :)

TY for adding this!

from pokemongobot.

mluigi avatar mluigi commented on May 29, 2024

I did something similar in #39 but I just used the CP.
The dust price is the dust needed to level the pokemon up?
Anyway all the characteristics of a pokemon that we can use are defined here https://github.com/AeonLucid/POGOProtos/blob/master/src/POGOProtos/Data/PokemonData.proto where stamina and stamina_max should be the HP, but i don't see the dust price.

from pokemongobot.

jabbink avatar jabbink commented on May 29, 2024

What does IV stand for?

Also stuff like the Dust price is available in the GAME_MASTER protobuf, which will be incorporated in the Java API soon'ish, so it would be futile to store them in this repo as well then.

from pokemongobot.

mluigi avatar mluigi commented on May 29, 2024

I'm implementig this right now @mroge009. But i have to remove this part

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

you have to let the user choose which pokemon to transfer directly, even if everyone is going to transfer those

from pokemongobot.

tonysguo avatar tonysguo commented on May 29, 2024

Awesome that was fast! @jabbink if you haven't looked it up, IV stood for individual value in the original games and is also in Go. Each Pokemon has a random +0 - 15 range to each stat, a perfect (100%) pokemon would have 15/15/15/15 to each of attack, defense, stamina, hp. So due to RNG a 0/0/0/0 vs. a 15/15/15/15 pokemon could vary by about 10% in CP.

TL;DR - don't just throw low CP pokemon away, one of these could be perfect and is really rare / worth spending the extra dust on leveling up.

from pokemongobot.

mroge009 avatar mroge009 commented on May 29, 2024

@Xenxes I think IV is only atk, def, and sta where hp is a function of sta. I only used the first 3 in my calculations and they seem to work fine with my highest being a 93% Flareon

from pokemongobot.

jabbink avatar jabbink commented on May 29, 2024

Merged with a slight modification, instead of having this formula in the code twice, I added it as extension function to the Pokemon-class.

<3 Kotlin

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.