Ejemplo n.º 1
0
        public void Run(CancellationToken cancellationToken)
        {
            if (_session.LogicSettings.UseNearActionRandom)
            {
                HumanRandomActionTask.Execute(_session, cancellationToken).Wait(cancellationToken);
            }
            else
            {
                if (_session.LogicSettings.EvolveAllPokemonAboveIv || _session.LogicSettings.EvolveAllPokemonWithEnoughCandy ||
                    _session.LogicSettings.UseLuckyEggsWhileEvolving || _session.LogicSettings.KeepPokemonsThatCanEvolve)
                {
                    EvolvePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
                }
                if (_session.LogicSettings.AutomaticallyLevelUpPokemon)
                {
                    LevelUpPokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
                }
                if (_session.LogicSettings.UseLuckyEggConstantly)
                {
                    UseLuckyEggConstantlyTask.Execute(_session, cancellationToken).Wait(cancellationToken);
                }
                if (_session.LogicSettings.UseIncenseConstantly)
                {
                    UseIncenseConstantlyTask.Execute(_session, cancellationToken).Wait(cancellationToken);
                }
                if (_session.LogicSettings.TransferDuplicatePokemon)
                {
                    TransferDuplicatePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
                }
                if (_session.LogicSettings.TransferWeakPokemon)
                {
                    TransferWeakPokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
                }
                if (_session.LogicSettings.RenamePokemon)
                {
                    RenamePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
                }
                if (_session.LogicSettings.AutoFavoritePokemon)
                {
                    FavoritePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
                }

                RecycleItemsTask.Execute(_session, cancellationToken).Wait(cancellationToken);
                GetPokeDexCount.Execute(_session, cancellationToken).Wait(cancellationToken);

                if (_session.LogicSettings.UseEggIncubators)
                {
                    UseIncubatorsTask.Execute(_session, cancellationToken).Wait(cancellationToken);
                }
            }

            if (_session.LogicSettings.UseGpxPathing)
            {
                FarmPokestopsGpxTask.Execute(_session, cancellationToken).Wait(cancellationToken);
            }
            else
            {
                FarmPokestopsTask.Execute(_session, cancellationToken).Wait(cancellationToken);
            }
        }
Ejemplo n.º 2
0
        public async Task <IState> Execute(ISession session, CancellationToken cancellationToken)
        {
            if (session.LogicSettings.UseNearActionRandom)
            {
                await HumanRandomActionTask.Execute(session, cancellationToken).ConfigureAwait(false);
            }
            else
            {
                if (session.LogicSettings.UseEggIncubators)
                {
                    await UseIncubatorsTask.Execute(session, cancellationToken).ConfigureAwait(false);
                }
                if (session.LogicSettings.TransferDuplicatePokemon)
                {
                    await TransferDuplicatePokemonTask.Execute(session, cancellationToken).ConfigureAwait(false);
                }
                if (session.LogicSettings.TransferWeakPokemon)
                {
                    await TransferWeakPokemonTask.Execute(session, cancellationToken).ConfigureAwait(false);
                }
                if (session.LogicSettings.EvolveAllPokemonAboveIv ||
                    session.LogicSettings.EvolveAllPokemonWithEnoughCandy ||
                    session.LogicSettings.UseLuckyEggsWhileEvolving ||
                    session.LogicSettings.KeepPokemonsThatCanEvolve)
                {
                    await EvolvePokemonTask.Execute(session, cancellationToken).ConfigureAwait(false);
                }
                if (session.LogicSettings.UseLuckyEggConstantly)
                {
                    await UseLuckyEggConstantlyTask.Execute(session, cancellationToken).ConfigureAwait(false);
                }
                if (session.LogicSettings.UseIncenseConstantly)
                {
                    await UseIncenseConstantlyTask.Execute(session, cancellationToken).ConfigureAwait(false);
                }

                await GetPokeDexCount.Execute(session, cancellationToken).ConfigureAwait(false);

                if (session.LogicSettings.RenamePokemon)
                {
                    await RenamePokemonTask.Execute(session, cancellationToken).ConfigureAwait(false);
                }

                await RecycleItemsTask.Execute(session, cancellationToken).ConfigureAwait(false);

                if (session.LogicSettings.AutomaticallyLevelUpPokemon)
                {
                    await LevelUpPokemonTask.Execute(session, cancellationToken).ConfigureAwait(false);
                }
            }

            await SelectBuddyPokemonTask.Execute(session, cancellationToken).ConfigureAwait(false);


            if (session.LogicSettings.UseGpxPathing)
            {
                await FarmPokestopsGpxTask.Execute(session, cancellationToken).ConfigureAwait(false);
            }
            else
            {
                await FarmPokestopsTask.Execute(session, cancellationToken).ConfigureAwait(false);
            }

            return(this);
        }