NecroBot icon indicating copy to clipboard operation
NecroBot copied to clipboard

Use level / type / moveset to determine gym attackers

Open Axeia opened this issue 7 years ago • 6 comments

How it works

I've noticed that the gym fights are done simply by whatever has the highest CP, which doesn't work out at all for me as I have a strong Gyrados and 5 strong Rhydons.

The gym has this lineup: [14:11:17] (INFO) Start battle with : Vaporeon, Charizard, Vaporeon, Charizard, Charizard, Vaporeon, Vaporeon and after my 2815cp Gyrados loses from a 2008cp Vaporeon (I guess that's related to #551 ) a Rhydon is used as that's my second highest cp attacker (2623cp). And then the battle times out.

Meanwhile my 2227 and 2176 Venusaurs don't even get used.

How it should work

Rather than simply selecting by highest cp it should look at:

  • The type of the Pokémon, e.g. don't use a rock type such as Rhydon vs a Water type such as Vaporeon.
  • Use the level of the pokémon if the cp different isn't ~50%. e.g. a lvl30 Venusaur is a better match for a Vaporeon than a lvl30 Rhydon even if Rhydon has a good 600
  • Ideally but I imagine a lot more complicated it should look at the moveset of the pokémon as well. For example my 2227 Venusaur has the moveset Vine Whip [grass] / Sludge Bomb [grass] while the 2176 one has Vine Whip [grass] / Solar Beam [grass] and thus is the better attacker. -- Even better it calculates the dps of the Pokémon vs a defender and picks an attacker based on that. (that for sure would be a lot of work).

Axeia avatar Jan 22 '17 13:01 Axeia

Hi, i'll code that but first:

  1. i need to know how to swap pomenon in fight. As for now i didn't found any api method for that
  2. i need to make my bot account again because my prev was banned

ziomber avatar Jan 23 '17 07:01 ziomber

Werify list of attacker types against defender type:

                case PokemonType.Bug:
                    return new PokemonType[] { PokemonType.Rock, PokemonType.Fire, PokemonType.Flying };
                case PokemonType.Dark:
                    return new PokemonType[] { PokemonType.Bug, PokemonType.Fairy, PokemonType.Fighting };
                case PokemonType.Dragon:
                    return new PokemonType[] { PokemonType.Dragon, PokemonType.Fire, PokemonType.Ice };
                case PokemonType.Electric:
                    return new PokemonType[] { PokemonType.Ground };
                case PokemonType.Fairy:
                    return new PokemonType[] { PokemonType.Poison, PokemonType.Steel };
                case PokemonType.Fighting:
                    return new PokemonType[] { PokemonType.Fairy, PokemonType.Flying, PokemonType.Psychic };
                case PokemonType.Fire:
                    return new PokemonType[] { PokemonType.Ground, PokemonType.Rock, PokemonType.Water };
                case PokemonType.Flying:
                    return new PokemonType[] { PokemonType.Electric, PokemonType.Ice, PokemonType.Rock };
                case PokemonType.Ghost:
                    return new PokemonType[] { PokemonType.Dark, PokemonType.Ghost };
                case PokemonType.Grass:
                    return new PokemonType[] { PokemonType.Bug, PokemonType.Fire, PokemonType.Flying, PokemonType.Ice, PokemonType.Poison };
                case PokemonType.Ground:
                    return new PokemonType[] { PokemonType.Grass, PokemonType.Ice, PokemonType.Water };
                case PokemonType.Ice:
                    return new PokemonType[] { PokemonType.Fighting, PokemonType.Fire, PokemonType.Rock, PokemonType.Steel };
                case PokemonType.None:
                    return new PokemonType[] { };
                case PokemonType.Normal:
                    return new PokemonType[] { PokemonType.Fighting };
                case PokemonType.Poison:
                    return new PokemonType[] { PokemonType.Ground, PokemonType.Psychic };
                case PokemonType.Psychic:
                    return new PokemonType[] { PokemonType.Bug, PokemonType.Dark, PokemonType.Ghost };
                case PokemonType.Rock:
                    return new PokemonType[] { PokemonType.Fighting, PokemonType.Grass, PokemonType.Ground, PokemonType.Steel, PokemonType.Water };
                case PokemonType.Steel:
                    return new PokemonType[] { PokemonType.Fighting, PokemonType.Fire, PokemonType.Ground };
                case PokemonType.Water:
                    return new PokemonType[] { PokemonType.Electric, PokemonType.Grass };

read it as: if defender is water then use electric or grass

ziomber avatar Jan 23 '17 14:01 ziomber

Hi, new here.. while type is an important factor for gym training.. the most important is using all 6 attackers with less CP than the first defender.. this way you are guaranteed 500 prestige or more per battle, which makes training gyms significantly quicker and less resource intensive.

nhumber avatar Jan 30 '17 19:01 nhumber

y, but if some moron will put lvl1 pokemon to defened gym this rule will always fails. when i'll finish attack module maybe i'll make train profile.

ziomber avatar Jan 30 '17 20:01 ziomber

@ziomber if you already has this metadata, you can put it in the code to use

samuraitruong avatar Jan 30 '17 22:01 samuraitruong

maybe we can use something like if first defender below 1000CP use CP of second defender to choose starting CP of attackers for training.. to further safeguard you could roll right on through to also check the second defender, probably the first scenario is more often to be seen.

hyper beam issues also still seem there, if anything sorting the HB issue should take precedence..

nhumber avatar Jan 31 '17 00:01 nhumber