diff --git a/PoGo.NecroBot.Logic/Strategies/Walk/BaseWalkStrategy.cs b/PoGo.NecroBot.Logic/Strategies/Walk/BaseWalkStrategy.cs index 1821ec7a1..cfa8d504d 100644 --- a/PoGo.NecroBot.Logic/Strategies/Walk/BaseWalkStrategy.cs +++ b/PoGo.NecroBot.Logic/Strategies/Walk/BaseWalkStrategy.cs @@ -116,7 +116,7 @@ public async Task DoWalk(List points, ISess result = await LocationUtils.UpdatePlayerLocationWithAltitude(session, waypoint); var realDistanceToTarget = LocationUtils.CalculateDistanceInMeters(currentLocation, targetLocation); - if (realDistanceToTarget < 10) + if (realDistanceToTarget < 30) break; do diff --git a/PoGo.NecroBot.Logic/Tasks/TransferDuplicatePokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/TransferDuplicatePokemonTask.cs index 9686fde5a..d37690839 100644 --- a/PoGo.NecroBot.Logic/Tasks/TransferDuplicatePokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/TransferDuplicatePokemonTask.cs @@ -48,6 +48,12 @@ public static async Task Execute(ISession session, CancellationToken cancellatio family.Candy_++; + // Padding the TransferEvent with player-choosen delay before instead of after. + // This is to remedy too quick transfers, often happening within a second of the + // previous action otherwise + + DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 0); + session.EventDispatcher.Send(new TransferPokemonEvent { Id = duplicatePokemon.PokemonId, @@ -58,7 +64,6 @@ public static async Task Execute(ISession session, CancellationToken cancellatio FamilyCandies = family.Candy_ }); - DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 0); } } } diff --git a/PoGo.NecroBot.Logic/Tasks/UseIncubatorsTask.cs b/PoGo.NecroBot.Logic/Tasks/UseIncubatorsTask.cs index e59a08fa0..244b5767b 100644 --- a/PoGo.NecroBot.Logic/Tasks/UseIncubatorsTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/UseIncubatorsTask.cs @@ -9,11 +9,9 @@ using System.Threading.Tasks; using Newtonsoft.Json; using PoGo.NecroBot.Logic.Event; -using PoGo.NecroBot.Logic.Logging; using PoGo.NecroBot.Logic.PoGoUtils; using PoGo.NecroBot.Logic.State; using POGOProtos.Inventory.Item; -using PoGo.NecroBot.Logic.Common; #endregion @@ -68,12 +66,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio var newRememberedIncubators = new List(); - // Find out if there are only 10km-eggs (special case) - var only10kmEggs = false; - var testIfOnly10kmEggs = unusedEggs.FirstOrDefault(x => x.EggKmWalkedTarget < 10); - if (testIfOnly10kmEggs == null) only10kmEggs = true; - - foreach (var incubator in incubators) + foreach (var incubator in incubators) { cancellationToken.ThrowIfCancellationRequested(); @@ -88,23 +81,14 @@ public static async Task Execute(ISession session, CancellationToken cancellatio if (egg == null) continue; - // Avoid using 10 km egg until you are level 20 in order to get higher - // initial CP on the high IV 10 km Pokémons (unless you ONLY have 10km-eggs) - if (egg.EggKmWalkedTarget == 10 && playerStats.Level < 20 && !only10kmEggs) - { - Logger.Write(session.Translation.GetTranslation(TranslationString.Only10kmEggs), LogLevel.Egg); - continue; - } - - // Avoid using 2/5 km eggs with limited incubator - IF setting is 10! - if (egg.EggKmWalkedTarget < session.LogicSettings.UseEggIncubatorMinKm - && incubator.ItemId != ItemId.ItemIncubatorBasicUnlimited) + //avoid using 2/5 km eggs with limited incubator + if (egg.EggKmWalkedTarget < session.LogicSettings.UseEggIncubatorMinKm && incubator.ItemId != ItemId.ItemIncubatorBasicUnlimited) continue; var response = await session.Client.Inventory.UseItemEggIncubator(incubator.Id, egg.Id); unusedEggs.Remove(egg); - newRememberedIncubators.Add(new IncubatorUsage {IncubatorId = incubator.Id, PokemonId = egg.Id}); + newRememberedIncubators.Add(new IncubatorUsage { IncubatorId = incubator.Id, PokemonId = egg.Id }); session.EventDispatcher.Send(new EggIncubatorStatusEvent { diff --git a/PoGo.NecroBot.Logic/Tasks/UseNearbyPokestopsTask.cs b/PoGo.NecroBot.Logic/Tasks/UseNearbyPokestopsTask.cs index 15ab610cd..fdd612be2 100644 --- a/PoGo.NecroBot.Logic/Tasks/UseNearbyPokestopsTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/UseNearbyPokestopsTask.cs @@ -78,15 +78,12 @@ public static async Task Execute(ISession session, CancellationToken cancellatio session.Client.CurrentLongitude, i.Latitude, i.Longitude)).ToList(); // randomize next pokestop between first and second by distance - //var pokestopListNum = 0; - //if (pokestopList.Count > 1) - // pokestopListNum = rc.Next(0, 2); + var pokestopListNum = 0; + if (pokestopList.Count > 1) + pokestopListNum = rc.Next(0, 2); - //var pokeStop = pokestopList[pokestopListNum]; - //pokestopList.RemoveAt(pokestopListNum); - - var pokeStop = pokestopList[0]; - pokestopList.RemoveAt(0); + var pokeStop = pokestopList[pokestopListNum]; + pokestopList.RemoveAt(pokestopListNum); // this logic should only be called when we reach a pokestop either via GPX path or normal walking // as when walk-sniping, we want to get to the snipe ASAP rather than stop for lured pokemon upon