RocketBot icon indicating copy to clipboard operation
RocketBot copied to clipboard

Feature Request: Favoriting a pokemon stops it from being transfered

Open Zeromark30 opened this issue 10 years ago • 1 comments

I don't know if favoriting a pokemon is transmitted to and from the server or not but if we did favorite a pokemon(the star icon) make it not transfer regardless of the other criteria it may fit.

That or don't transfer pokemon with a combined IV score above 90% (tech 91% for 41/45) IV is calculated from adding individual_attack, individual_defense and individual_stamina. so the pokemon below would have an IV of 16 and should be transferred because he is only 35.5% perfect and has less potential than other pokemons.

{   'inventory_item_data': {   'pokemon_data': {   
'captured_cell_id':### ,
 'cp': 42,
'creation_time_ms': 1467896285015L,
'height_m': 0.27494046092033386,
'id': 2609019257151675480L,
'individual_attack': 11,
'individual_defense': 4,
'individual_stamina': 1,
'move_1': 211,
'move_2': 45,
'pokeball': 1,
'pokemon_id': 21,
'stamina': 17,
'stamina_max': 17,
'weight_kg': 1.6279398202896118}}},

Zeromark30 avatar Jul 22 '16 00:07 Zeromark30

think this works

   public static float Perfect(PokemonData poke)
        {
                return ((float)(poke.IndividualAttack + poke.IndividualDefense + poke.IndividualStamina) / (3.0f * 15.0f)) * 100.0f;
        }`

    private static async Task TransferAllGivenPokemons(Client client, IEnumerable<PokemonData> unwantedPokemons, float keepPerfectPokemonLimit = 80.0f)
        {
            foreach (var pokemon in unwantedPokemons)
            {
                if (Perfect(pokemon) >= keepPerfectPokemonLimit) continue;
                if (pokemon.Favorite > 0) continue;
                var transferPokemonResponse = await client.TransferPokemon(pokemon.Id);

                /*
                ReleasePokemonOutProto.Status {
                    UNSET = 0;
                    SUCCESS = 1;
                    POKEMON_DEPLOYED = 2;
                    FAILED = 3;
                    ERROR_POKEMON_IS_EGG = 4;
                }*/

                if (transferPokemonResponse.Status == 1)
                {
                    ColoredConsoleWrite(ConsoleColor.Magenta, $"[{DateTime.Now.ToString("HH:mm:ss")}] Transferred {pokemon.PokemonId} with {pokemon.Cp} CP");
                }
                else
                {
                    var status = transferPokemonResponse.Status;

                    ColoredConsoleWrite(ConsoleColor.Red, $"[{DateTime.Now.ToString("HH:mm:ss")}] Somehow failed to transfer {pokemon.PokemonId} with {pokemon.Cp} CP. " +
                                             $"ReleasePokemonOutProto.Status was {status}");
                }

                await Task.Delay(3000);
            }
        }

Zeromark30 avatar Jul 22 '16 02:07 Zeromark30