diff --git a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs index 8702d4575..a21dfd8b3 100644 --- a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs @@ -22,7 +22,7 @@ namespace PoGo.NecroBot.Logic.Tasks public static class FarmPokestopsTask { public static int TimesZeroXPawarded; - + private static int storeRI; public static async Task Execute(ISession session, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); @@ -48,6 +48,8 @@ await session.Navigation.Move( var pokestopList = await GetPokeStops(session); var stopsHit = 0; + var rc = new Random(); //initialize pokestop random cleanup counter first time + storeRI = rc.Next(3, 9); var eggWalker = new EggWalker(1000, session); if (pokestopList.Count <= 0) @@ -155,8 +157,9 @@ await session.Navigation.Move(new GeoCoordinate(pokeStop.Latitude, pokeStop.Long await eggWalker.ApplyDistance(distance, cancellationToken); - if (++stopsHit%5 == 0) //TODO: OR item/pokemon bag is full + if (++stopsHit >= storeRI) //TODO: OR item/pokemon bag is full //check stopsHit against storeRI random without dividing. { + storeRI = rc.Next(2, 8); //set new storeRI for new random value stopsHit = 0; if (fortSearch.ItemsAwarded.Count > 0) { @@ -220,4 +223,4 @@ private static async Task> GetPokeStops(ISession session) return pokeStops.ToList(); } } -} \ No newline at end of file +}