diff --git a/PoGo.NecroBot.CLI/ConsoleEventListener.cs b/PoGo.NecroBot.CLI/ConsoleEventListener.cs index eddc55f5c..98642183f 100644 --- a/PoGo.NecroBot.CLI/ConsoleEventListener.cs +++ b/PoGo.NecroBot.CLI/ConsoleEventListener.cs @@ -182,7 +182,10 @@ public void HandleEvent(UseBerryEvent evt, ISession session) public void HandleEvent(SnipeScanEvent evt, ISession session) { - Logger.Write(session.Translation.GetTranslation(TranslationString.SnipeScan, $"{evt.Bounds.Latitude},{evt.Bounds.Longitude}")); + if(evt.PokemonId == POGOProtos.Enums.PokemonId.Missingno) + Logger.Write(session.Translation.GetTranslation(TranslationString.SnipeScan, $"{evt.Bounds.Latitude},{evt.Bounds.Longitude}")); + else + Logger.Write(session.Translation.GetTranslation(TranslationString.SnipeScanEx, evt.PokemonId, (evt.iv > 0) ? evt.iv.ToString() : "unknown", $"{evt.Bounds.Latitude},{evt.Bounds.Longitude}")); } public void HandleEvent(DisplayHighestsPokemonEvent evt, ISession session) diff --git a/PoGo.NecroBot.Logic/Common/Translations.cs b/PoGo.NecroBot.Logic/Common/Translations.cs index 633e8e4e1..06b825fb0 100644 --- a/PoGo.NecroBot.Logic/Common/Translations.cs +++ b/PoGo.NecroBot.Logic/Common/Translations.cs @@ -115,6 +115,7 @@ public enum TranslationString MissingCredentialsGoogle, MissingCredentialsPtc, SnipeScan, + SnipeScanEx, NoPokemonToSnipe, } @@ -223,6 +224,7 @@ public class Translation : ITranslation new KeyValuePair(Common.TranslationString.MissingCredentialsGoogle, "You need to fill out GoogleUsername and GooglePassword in auth.json!"), new KeyValuePair(Common.TranslationString.MissingCredentialsPtc, "You need to fill out PtcUsername and PtcPassword in auth.json!"), new KeyValuePair(Common.TranslationString.SnipeScan, "[Sniper] Scanning for Snipeable Pokemon at {0}..."), + new KeyValuePair(Common.TranslationString.SnipeScanEx, "[Sniper] Sniping a {0} with {1} IV at {2}..."), new KeyValuePair(Common.TranslationString.NoPokemonToSnipe, "[Sniper] No Pokemon found to snipe!"), }; diff --git a/PoGo.NecroBot.Logic/Event/SnipeScanEvent.cs b/PoGo.NecroBot.Logic/Event/SnipeScanEvent.cs index 2c7d48d4b..c678c30bd 100644 --- a/PoGo.NecroBot.Logic/Event/SnipeScanEvent.cs +++ b/PoGo.NecroBot.Logic/Event/SnipeScanEvent.cs @@ -9,5 +9,7 @@ namespace PoGo.NecroBot.Logic.Event public class SnipeScanEvent : IEvent { public Location Bounds { get; set; } + public POGOProtos.Enums.PokemonId PokemonId { get; set; } + public double iv { get; set; } } } diff --git a/PoGo.NecroBot.Logic/Inventory.cs b/PoGo.NecroBot.Logic/Inventory.cs index 4ea34336b..54befc02d 100644 --- a/PoGo.NecroBot.Logic/Inventory.cs +++ b/PoGo.NecroBot.Logic/Inventory.cs @@ -217,30 +217,18 @@ public async Task> GetItemsToRecycle(ISettings settings) var pokeballsToRecycle = GetPokeballsToRecycle(settings, myItems); itemsToRecylce.AddRange(pokeballsToRecycle); } - else - { - Logging.Logger.Write("Using ItemRecycleFilter for pokeballs", Logging.LogLevel.Info, ConsoleColor.Yellow); - } if (!_logicSettings.ItemRecycleFilter.Any(s => Potions.Contains(s.Key))) { var potionsToRecycle = GetPotionsToRecycle(settings, myItems); itemsToRecylce.AddRange(potionsToRecycle); } - else - { - Logging.Logger.Write("Using ItemRecycleFilter for potions", Logging.LogLevel.Info, ConsoleColor.Yellow); - } if (!_logicSettings.ItemRecycleFilter.Any(s => Revives.Contains(s.Key))) { var revivesToRecycle = GetRevivesToRecycle(settings, myItems); itemsToRecylce.AddRange(revivesToRecycle); } - else - { - Logging.Logger.Write("Using ItemRecycleFilter for revives", Logging.LogLevel.Info, ConsoleColor.Yellow); - } var otherItemsToRecylce = myItems .Where(x => _logicSettings.ItemRecycleFilter.Any(f => f.Key == x.ItemId && x.Count > f.Value)) diff --git a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs index 67298cb82..9eb941204 100644 --- a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs @@ -110,7 +110,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio await RecycleItemsTask.Execute(session, cancellationToken); - if (session.LogicSettings.SnipeAtPokestops) + if (session.LogicSettings.SnipeAtPokestops || session.LogicSettings.UseSnipeLocationServer) { await SnipePokemonTask.Execute(session, cancellationToken); } diff --git a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs index 071d9e1c8..18326fc63 100644 --- a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs @@ -174,7 +174,7 @@ await session.Navigation.HumanLikeWalking(new GeoCoordinate(pokeStop.Latitude, p } } - if (session.LogicSettings.SnipeAtPokestops) + if (session.LogicSettings.SnipeAtPokestops || session.LogicSettings.UseSnipeLocationServer) { await SnipePokemonTask.Execute(session, cancellationToken); } diff --git a/PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs index 4c4de6c28..7b225b77d 100644 --- a/PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs @@ -222,7 +222,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio var locationsToSnipe = snipeLocations == null ? new List() : snipeLocations.Where(q => (!session.LogicSettings.UseTransferIVForSnipe || ( (q.iv == 0 && !session.LogicSettings.SnipeIgnoreUnknownIV) || - (q.iv > session.Inventory.GetPokemonTransferFilter(q.id).KeepMinIvPercentage) + (q.iv >= session.Inventory.GetPokemonTransferFilter(q.id).KeepMinIvPercentage) )) && !locsVisited.Contains(new PokemonLocation(q.latitude, q.longitude)) && !(q.timeStamp != default(DateTime) && @@ -234,7 +234,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio lastSnipe = DateTime.Now; foreach (var location in locationsToSnipe) { - session.EventDispatcher.Send(new SnipeScanEvent() { Bounds = new Location(location.latitude, location.longitude) }); + session.EventDispatcher.Send(new SnipeScanEvent() { Bounds = new Location(location.latitude, location.longitude), PokemonId = location.id, iv = location.iv }); await snipe(session, pokemonIds, location.latitude, location.longitude, cancellationToken); locsVisited.Add(new PokemonLocation(location.latitude, location.longitude)); @@ -245,7 +245,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio foreach (var location in session.LogicSettings.PokemonToSnipe.Locations) { - session.EventDispatcher.Send(new SnipeScanEvent() { Bounds = location }); + session.EventDispatcher.Send(new SnipeScanEvent() { Bounds = location, PokemonId = PokemonId.Missingno }); var scanResult = SnipeScanForPokemon(location);