From 06d08f3f6d5a9d21b9f6ca84297fa669e3877745 Mon Sep 17 00:00:00 2001 From: Valmere Date: Tue, 2 Aug 2016 02:52:21 -0400 Subject: [PATCH 1/5] Added TransferLowStatPokemon Alternative to TransferDuplicatePokemon, if you don't mind having 20 vaporeon or gyarados as long as they're strong. Will transfer pokemon that are below the KeepMinCp threshold or below the KeepMinIvPercentage threshold with PrioritizeIvOverCp set to true. --- PoGo.PokeMobBot.Logic/ILogicSettings.cs | 1 + .../PoGo.PokeMobBot.Logic.csproj | 1 + PoGo.PokeMobBot.Logic/Settings.cs | 2 + PoGo.PokeMobBot.Logic/State/FarmState.cs | 4 ++ .../Tasks/CatchIncensePokemonsTask.cs | 8 +++ .../Tasks/CatchLurePokemonsTask.cs | 8 +++ .../Tasks/CatchNearbyPokemonsTask.cs | 8 +++ PoGo.PokeMobBot.Logic/Tasks/Farm.cs | 4 ++ .../Tasks/FarmPokestopsGPXTask.cs | 4 ++ .../Tasks/FarmPokestopsTask.cs | 4 ++ .../Tasks/TransferLowStatPokemon.cs | 67 +++++++++++++++++++ .../Tasks/UseNearbyPokestopsTask.cs | 4 ++ 12 files changed, 115 insertions(+) create mode 100644 PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs diff --git a/PoGo.PokeMobBot.Logic/ILogicSettings.cs b/PoGo.PokeMobBot.Logic/ILogicSettings.cs index 7ee8e4d..3bb4712 100644 --- a/PoGo.PokeMobBot.Logic/ILogicSettings.cs +++ b/PoGo.PokeMobBot.Logic/ILogicSettings.cs @@ -103,6 +103,7 @@ public interface ILogicSettings //transfer bool TransferDuplicatePokemon { get; } + bool TransferLowStatPokemon { get; } bool PrioritizeIvOverCp { get; } int KeepMinCp { get; } float KeepMinIvPercentage { get; } diff --git a/PoGo.PokeMobBot.Logic/PoGo.PokeMobBot.Logic.csproj b/PoGo.PokeMobBot.Logic/PoGo.PokeMobBot.Logic.csproj index 5efa695..bb1cfe3 100644 --- a/PoGo.PokeMobBot.Logic/PoGo.PokeMobBot.Logic.csproj +++ b/PoGo.PokeMobBot.Logic/PoGo.PokeMobBot.Logic.csproj @@ -132,6 +132,7 @@ + diff --git a/PoGo.PokeMobBot.Logic/Settings.cs b/PoGo.PokeMobBot.Logic/Settings.cs index 1a930a5..7aae05a 100644 --- a/PoGo.PokeMobBot.Logic/Settings.cs +++ b/PoGo.PokeMobBot.Logic/Settings.cs @@ -151,6 +151,7 @@ public class GlobalSettings //transfer public bool TransferDuplicatePokemon = true; + public bool TransferLowStatPokemon = false; public bool PrioritizeIvOverCp = true; public int KeepMinCp = 1250; public float KeepMinIvPercentage = 95; @@ -646,6 +647,7 @@ public LogicSettings(GlobalSettings settings) public bool EvolveAllPokemonWithEnoughCandy => _settings.EvolveAllPokemonWithEnoughCandy; public bool KeepPokemonsThatCanEvolve => _settings.KeepPokemonsThatCanEvolve; public bool TransferDuplicatePokemon => _settings.TransferDuplicatePokemon; + public bool TransferLowStatPokemon => _settings.TransferLowStatPokemon; public bool UseEggIncubators => _settings.UseEggIncubators; public int UseGreatBallAboveIv => _settings.UseGreatBallAboveIv; public int UseUltraBallAboveIv => _settings.UseUltraBallAboveIv; diff --git a/PoGo.PokeMobBot.Logic/State/FarmState.cs b/PoGo.PokeMobBot.Logic/State/FarmState.cs index 2cefe4d..8f4c02b 100644 --- a/PoGo.PokeMobBot.Logic/State/FarmState.cs +++ b/PoGo.PokeMobBot.Logic/State/FarmState.cs @@ -28,6 +28,10 @@ public async Task Execute(ISession session, CancellationToken cancellati { await TransferDuplicatePokemonTask.Execute(session, cancellationToken); } + if (session.LogicSettings.TransferLowStatPokemon) + { + await TransferLowStatPokemonTask.Execute(session, cancellationToken); + } if (session.LogicSettings.AutomaticallyLevelUpPokemon) { await LevelUpPokemonTask.Execute(session, cancellationToken); diff --git a/PoGo.PokeMobBot.Logic/Tasks/CatchIncensePokemonsTask.cs b/PoGo.PokeMobBot.Logic/Tasks/CatchIncensePokemonsTask.cs index 9f892f2..667e185 100644 --- a/PoGo.PokeMobBot.Logic/Tasks/CatchIncensePokemonsTask.cs +++ b/PoGo.PokeMobBot.Logic/Tasks/CatchIncensePokemonsTask.cs @@ -77,6 +77,14 @@ public static async Task Execute(ISession session, CancellationToken cancellatio }); await TransferDuplicatePokemonTask.Execute(session, cancellationToken); } + if (session.LogicSettings.TransferLowStatPokemon) + { + session.EventDispatcher.Send(new WarnEvent + { + Message = session.Translation.GetTranslation(TranslationString.InvFullTransferring) + }); + await TransferLowStatPokemonTask.Execute(session, cancellationToken); + } else session.EventDispatcher.Send(new WarnEvent { diff --git a/PoGo.PokeMobBot.Logic/Tasks/CatchLurePokemonsTask.cs b/PoGo.PokeMobBot.Logic/Tasks/CatchLurePokemonsTask.cs index 40ab8b1..3b2b668 100644 --- a/PoGo.PokeMobBot.Logic/Tasks/CatchLurePokemonsTask.cs +++ b/PoGo.PokeMobBot.Logic/Tasks/CatchLurePokemonsTask.cs @@ -58,6 +58,14 @@ public static async Task Execute(ISession session, FortData currentFortData, Can }); await TransferDuplicatePokemonTask.Execute(session, cancellationToken); } + if (session.LogicSettings.TransferLowStatPokemon) + { + session.EventDispatcher.Send(new WarnEvent + { + Message = session.Translation.GetTranslation(TranslationString.InvFullTransferring) + }); + await TransferLowStatPokemonTask.Execute(session, cancellationToken); + } else session.EventDispatcher.Send(new WarnEvent { diff --git a/PoGo.PokeMobBot.Logic/Tasks/CatchNearbyPokemonsTask.cs b/PoGo.PokeMobBot.Logic/Tasks/CatchNearbyPokemonsTask.cs index b57064a..dbb3782 100644 --- a/PoGo.PokeMobBot.Logic/Tasks/CatchNearbyPokemonsTask.cs +++ b/PoGo.PokeMobBot.Logic/Tasks/CatchNearbyPokemonsTask.cs @@ -80,6 +80,14 @@ public static async Task Execute(ISession session, CancellationToken cancellatio }); await TransferDuplicatePokemonTask.Execute(session, cancellationToken); } + if (session.LogicSettings.TransferLowStatPokemon) + { + session.EventDispatcher.Send(new WarnEvent + { + Message = session.Translation.GetTranslation(TranslationString.InvFullTransferring) + }); + await TransferLowStatPokemonTask.Execute(session, cancellationToken); + } else session.EventDispatcher.Send(new WarnEvent { diff --git a/PoGo.PokeMobBot.Logic/Tasks/Farm.cs b/PoGo.PokeMobBot.Logic/Tasks/Farm.cs index 7c1f41a..eff90c0 100644 --- a/PoGo.PokeMobBot.Logic/Tasks/Farm.cs +++ b/PoGo.PokeMobBot.Logic/Tasks/Farm.cs @@ -35,6 +35,10 @@ public void Run(CancellationToken cancellationToken) { TransferDuplicatePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken); } + if (_session.LogicSettings.TransferLowStatPokemon) + { + TransferLowStatPokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken); + } if (_session.LogicSettings.RenamePokemon) { diff --git a/PoGo.PokeMobBot.Logic/Tasks/FarmPokestopsGPXTask.cs b/PoGo.PokeMobBot.Logic/Tasks/FarmPokestopsGPXTask.cs index 651a2e1..436c0b0 100644 --- a/PoGo.PokeMobBot.Logic/Tasks/FarmPokestopsGPXTask.cs +++ b/PoGo.PokeMobBot.Logic/Tasks/FarmPokestopsGPXTask.cs @@ -129,6 +129,10 @@ public static async Task Execute(ISession session, CancellationToken cancellatio { await TransferDuplicatePokemonTask.Execute(session, cancellationToken); } + if (session.LogicSettings.TransferLowStatPokemon) + { + await TransferLowStatPokemonTask.Execute(session, cancellationToken); + } if (session.LogicSettings.RenamePokemon) { diff --git a/PoGo.PokeMobBot.Logic/Tasks/FarmPokestopsTask.cs b/PoGo.PokeMobBot.Logic/Tasks/FarmPokestopsTask.cs index 86860ae..3d5c6ed 100644 --- a/PoGo.PokeMobBot.Logic/Tasks/FarmPokestopsTask.cs +++ b/PoGo.PokeMobBot.Logic/Tasks/FarmPokestopsTask.cs @@ -412,6 +412,10 @@ await session.Navigation.HumanLikeWalking(new GeoCoordinate(pokeStop.Latitude, p { await TransferDuplicatePokemonTask.Execute(session, cancellationToken); } + if (session.LogicSettings.TransferLowStatPokemon) + { + await TransferLowStatPokemonTask.Execute(session, cancellationToken); + } if (session.LogicSettings.RenamePokemon) { await RenamePokemonTask.Execute(session, cancellationToken); diff --git a/PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs b/PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs new file mode 100644 index 0000000..b04d05a --- /dev/null +++ b/PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs @@ -0,0 +1,67 @@ +#region using directives + +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using PoGo.PokeMobBot.Logic.Event; +using PoGo.PokeMobBot.Logic.PoGoUtils; +using PoGo.PokeMobBot.Logic.State; +using PoGo.PokeMobBot.Logic.Utils; + +#endregion + +namespace PoGo.PokeMobBot.Logic.Tasks +{ + public class TransferLowStatPokemonTask + { + public static async Task Execute(ISession session, CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + + // Refresh inventory so that the player stats are fresh + await session.Inventory.RefreshCachedInventory(); + + var pokemons = await session.Inventory.GetPokemons(); + + var pokemonSettings = await session.Inventory.GetPokemonSettings(); + var pokemonFamilies = await session.Inventory.GetPokemonFamilies(); + + foreach (var pokemon in pokemons) + { + cancellationToken.ThrowIfCancellationRequested(); + + if ((pokemon.Cp >= session.LogicSettings.KeepMinCp) || + (PokemonInfo.CalculatePokemonPerfection(pokemon) >= session.LogicSettings.KeepMinIvPercentage && session.LogicSettings.PrioritizeIvOverCp)) + { + continue; + } + + await session.Client.Inventory.TransferPokemon(pokemon.Id); + await session.Inventory.DeletePokemonFromInvById(pokemon.Id); + + var bestPokemonOfType = (session.LogicSettings.PrioritizeIvOverCp + ? await session.Inventory.GetHighestPokemonOfTypeByIv(pokemon) + : await session.Inventory.GetHighestPokemonOfTypeByCp(pokemon)) ?? pokemon; + + var setting = pokemonSettings.Single(q => q.PokemonId == pokemon.PokemonId); + var family = pokemonFamilies.First(q => q.FamilyId == setting.FamilyId); + + family.Candy_++; + + session.EventDispatcher.Send(new TransferPokemonEvent + { + Id = pokemon.PokemonId, + Perfection = PokemonInfo.CalculatePokemonPerfection(pokemon), + Cp = pokemon.Cp, + BestCp = bestPokemonOfType.Cp, + BestPerfection = PokemonInfo.CalculatePokemonPerfection(bestPokemonOfType), + FamilyCandies = family.Candy_ + }); + if (session.LogicSettings.Teleport) + await Task.Delay(session.LogicSettings.DelayTransferPokemon); + else + await DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 0); + } + } + } +} \ No newline at end of file diff --git a/PoGo.PokeMobBot.Logic/Tasks/UseNearbyPokestopsTask.cs b/PoGo.PokeMobBot.Logic/Tasks/UseNearbyPokestopsTask.cs index 256764e..67b6627 100644 --- a/PoGo.PokeMobBot.Logic/Tasks/UseNearbyPokestopsTask.cs +++ b/PoGo.PokeMobBot.Logic/Tasks/UseNearbyPokestopsTask.cs @@ -64,6 +64,10 @@ public static async Task Execute(ISession session, CancellationToken cancellatio { await TransferDuplicatePokemonTask.Execute(session, cancellationToken); } + if (session.LogicSettings.TransferLowStatPokemon) + { + await TransferLowStatPokemonTask.Execute(session, cancellationToken); + } } } From 4617989f7ef3dc20f1fe7fed7d0e033379c066c1 Mon Sep 17 00:00:00 2001 From: Valmere Date: Tue, 2 Aug 2016 04:06:21 -0400 Subject: [PATCH 2/5] added TransferLowStatPokemon To be used instead of TransferDuplicatePokemon for people that don't mind having 20 vaporeon or gyarados as their strongest. Will not transfer pokemon in the DoNotTransfer list or the PokemonToEvolve list if KeepPokemonsThatCanEvolve is set to true. --- .../Tasks/TransferLowStatPokemon.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs b/PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs index b04d05a..bac4f0c 100644 --- a/PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs +++ b/PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs @@ -23,15 +23,23 @@ public static async Task Execute(ISession session, CancellationToken cancellatio var pokemons = await session.Inventory.GetPokemons(); + var pokemonList = pokemons.Where(p => !session.LogicSettings.PokemonsNotToTransfer.Contains(p.PokemonId)).ToList(); //filter out the do not transfers + + if (session.LogicSettings.KeepPokemonsThatCanEvolve) + { + pokemonList = pokemonList.Where(p => !session.LogicSettings.PokemonsToEvolve.Contains(p.PokemonId)).ToList(); //filter out the evolve list if evolve is true + } + var pokemonSettings = await session.Inventory.GetPokemonSettings(); var pokemonFamilies = await session.Inventory.GetPokemonFamilies(); - foreach (var pokemon in pokemons) + foreach (var pokemon in pokemonList) { cancellationToken.ThrowIfCancellationRequested(); - if ((pokemon.Cp >= session.LogicSettings.KeepMinCp) || - (PokemonInfo.CalculatePokemonPerfection(pokemon) >= session.LogicSettings.KeepMinIvPercentage && session.LogicSettings.PrioritizeIvOverCp)) + if ((pokemon.Cp >= session.LogicSettings.KeepMinCp) || //dont toss if its over min CP + (PokemonInfo.CalculatePokemonPerfection(pokemon) >= session.LogicSettings.KeepMinIvPercentage && session.LogicSettings.PrioritizeIvOverCp) || //dont toss if its over min IV + pokemon.Favorite == 1) //dont toss if its a favorite { continue; } From 29cb7735e5a2f44976df37eca8ebce3c932e643d Mon Sep 17 00:00:00 2001 From: Valmere Date: Tue, 2 Aug 2016 05:25:01 -0400 Subject: [PATCH 3/5] Fixed throwing out razzberrys. It's now a config value just like balls/potions/revives. Also added in the rest of the berries but commented it out due to the berries not being implemented yet, but the code's ready for when they are. --- PoGo.PokeMobBot.Logic/ILogicSettings.cs | 6 +- PoGo.PokeMobBot.Logic/Settings.cs | 12 +++- .../Tasks/RecycleItemsTask.cs | 70 ++++++++++--------- 3 files changed, 52 insertions(+), 36 deletions(-) diff --git a/PoGo.PokeMobBot.Logic/ILogicSettings.cs b/PoGo.PokeMobBot.Logic/ILogicSettings.cs index 3bb4712..1587f92 100644 --- a/PoGo.PokeMobBot.Logic/ILogicSettings.cs +++ b/PoGo.PokeMobBot.Logic/ILogicSettings.cs @@ -156,7 +156,11 @@ public interface ILogicSettings int TotalAmountOfMaxPotionsToKeep { get; } int TotalAmountOfRevivesToKeep { get; } int TotalAmountOfMaxRevivesToKeep { get; } - int TotalAmountOfBerriesToKeep { get; } + int TotalAmountOfRazzToKeep { get; } + //int TotalAmountOfBerriesToKeep { get; } + //int TotalAmountOfBlukToKeep { get; } + //int TotalAmountOfNanabToKeep { get; } + //int TotalAmountOfPinapToKeep { get; } double RecycleInventoryAtUsagePercentage { get; } //snipe diff --git a/PoGo.PokeMobBot.Logic/Settings.cs b/PoGo.PokeMobBot.Logic/Settings.cs index 7aae05a..a0b2144 100644 --- a/PoGo.PokeMobBot.Logic/Settings.cs +++ b/PoGo.PokeMobBot.Logic/Settings.cs @@ -204,7 +204,11 @@ public class GlobalSettings public int TotalAmountOfMaxPotionsToKeep = 20; public int TotalAmountOfRevivesToKeep = 20; public int TotalAmountOfMaxRevivesToKeep = 30; - public int TotalAmountOfBerriesToKeep = 40; + public int TotalAmountOfRazzToKeep = 40; + //public int TotalAmountOfBlukToKeep = 40; + //public int TotalAmountOfNanabToKeep = 40; + //public int TotalAmountOfPinapToKeep = 40; + //public int TotalAmountOfWeparToKeep = 40; public double RecycleInventoryAtUsagePercentage = 0.90; //snipe @@ -698,7 +702,11 @@ public LogicSettings(GlobalSettings settings) public int TotalAmountOfGreatballsToKeep => _settings.TotalAmountOfGreatballsToKeep; public int TotalAmountOfUltraballsToKeep => _settings.TotalAmountOfUltraballsToKeep; public int TotalAmountOfMasterballsToKeep => _settings.TotalAmountOfMasterballsToKeep; - public int TotalAmountOfBerriesToKeep => _settings.TotalAmountOfBerriesToKeep; + public int TotalAmountOfRazzToKeep => _settings.TotalAmountOfRazzToKeep; + //public int TotalAmountOfBlukToKeep => _settings.TotalAmountOfBlukToKeep; + //public int TotalAmountOfNanabToKeep => _settings.TotalAmountOfNanabToKeep; + //public int TotalAmountOfPinapToKeep => _settings.TotalAmountOfPinapToKeep; + //public int TotalAmountOfWeparToKeep => _settings.TotalAmountOfWeparToKeep; public int TotalAmountOfPotionsToKeep => _settings.TotalAmountOfPotionsToKeep; public int TotalAmountOfSuperPotionsToKeep => _settings.TotalAmountOfSuperPotionsToKeep; public int TotalAmountOfHyperPotionsToKeep => _settings.TotalAmountOfHyperPotionsToKeep; diff --git a/PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs b/PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs index c5710b5..a7105be 100644 --- a/PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs +++ b/PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs @@ -109,41 +109,45 @@ private static async Task OptimizedRecyclePotions(ISession session, Cancellation private static async Task OptimizedRecycleBerries(ISession session, CancellationToken cancellationToken) { - var razz = await session.Inventory.GetItemAmountByType(ItemId.ItemRazzBerry); - var bluk = await session.Inventory.GetItemAmountByType(ItemId.ItemBlukBerry); - var nanab = await session.Inventory.GetItemAmountByType(ItemId.ItemNanabBerry); - var pinap = await session.Inventory.GetItemAmountByType(ItemId.ItemPinapBerry); - var wepar = await session.Inventory.GetItemAmountByType(ItemId.ItemWeparBerry); - - int totalBerryCount = razz + bluk + nanab + pinap + wepar; - if (totalBerryCount > session.LogicSettings.TotalAmountOfBerriesToKeep) + var razzCount = await session.Inventory.GetItemAmountByType(ItemId.ItemRazzBerry); + //var blukCount = await session.Inventory.GetItemAmountByType(ItemId.ItemBlukBerry); + //var nanabCount = await session.Inventory.GetItemAmountByType(ItemId.ItemNanabBerry); + //var pinapCount = await session.Inventory.GetItemAmountByType(ItemId.ItemPinapBerry); + //var weparCount = await session.Inventory.GetItemAmountByType(ItemId.ItemWeparBerry); + int razzToKeep = session.LogicSettings.TotalAmountOfRazzToKeep; + //int blukToKeep = session.LogicSettings.TotalAmountOfBlukToKeep; + //int nanabToKeep = session.LogicSettings.TotalAmountOfNanabToKeep; + //int pinapToKeep = session.LogicSettings.TotalAmountOfPinapToKeep; + //int weparToKeep = session.LogicSettings.TotalAmountOfWeparToKeep; + int razzToRecycle = razzCount - razzToKeep; + //int blukToRecycle = blukCount - blukToKeep; + //int nanabToRecycle = nanabCount - nanabToKeep; + //int pinapToRecycle = pinapCount - pinapToKeep; + //int weparToRecycle = weparCount - weparToKeep; + if (razzCount > razzToKeep) { - diff = totalBerryCount - session.LogicSettings.TotalAmountOfBerriesToKeep; - if (diff > 0) - { - await RemoveItems(razz, ItemId.ItemRazzBerry, cancellationToken, session); - } - - if (diff > 0) - { - await RemoveItems(bluk, ItemId.ItemBlukBerry, cancellationToken, session); - } - - if (diff > 0) - { - await RemoveItems(nanab, ItemId.ItemNanabBerry, cancellationToken, session); - } - - if (diff > 0) - { - await RemoveItems(pinap, ItemId.ItemPinapBerry, cancellationToken, session); - } - - if (diff > 0) - { - await RemoveItems(wepar, ItemId.ItemWeparBerry, cancellationToken, session); - } + await RemoveItems(razzCount, ItemId.ItemRazzBerry, cancellationToken, session); } + + //if (blukCount > blukToKeep) + //{ + // await RemoveItems(blukCount, ItemId.ItemBlukBerry, cancellationToken, session); + //} + + //if nanabCount > nanabToKeep) + //{ + // await RemoveItems(nanabCount, ItemId.ItemNanabBerry, cancellationToken, session); + //} + + //if (pinapCount > pinapToKeep) + //{ + // await RemoveItems(pinapCount, ItemId.ItemPinapBerry, cancellationToken, session); + //} + + //if (weparCount > weparToKeep) + //{ + // await RemoveItems(weparCount, ItemId.ItemWeparBerry, cancellationToken, session); + //} } private static async Task OptimizedRecycleRevives(ISession session, CancellationToken cancellationToken) From d6c219b2d6c25e3ffc3812c77b09100eb213e974 Mon Sep 17 00:00:00 2001 From: Valmere Date: Tue, 2 Aug 2016 05:47:24 -0400 Subject: [PATCH 4/5] typo fix - berries now toss as planned --- PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs b/PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs index a7105be..b3e7b1b 100644 --- a/PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs +++ b/PoGo.PokeMobBot.Logic/Tasks/RecycleItemsTask.cs @@ -13,7 +13,6 @@ namespace PoGo.PokeMobBot.Logic.Tasks { public class RecycleItemsTask { - private static int diff; public static async Task Execute(ISession session, CancellationToken cancellationToken) { @@ -126,27 +125,27 @@ private static async Task OptimizedRecycleBerries(ISession session, Cancellation //int weparToRecycle = weparCount - weparToKeep; if (razzCount > razzToKeep) { - await RemoveItems(razzCount, ItemId.ItemRazzBerry, cancellationToken, session); + await RemoveItems(razzToRecycle, ItemId.ItemRazzBerry, cancellationToken, session); } //if (blukCount > blukToKeep) //{ - // await RemoveItems(blukCount, ItemId.ItemBlukBerry, cancellationToken, session); + // await RemoveItems(blukToRecycle, ItemId.ItemBlukBerry, cancellationToken, session); //} //if nanabCount > nanabToKeep) //{ - // await RemoveItems(nanabCount, ItemId.ItemNanabBerry, cancellationToken, session); + // await RemoveItems(nanabToRecycle, ItemId.ItemNanabBerry, cancellationToken, session); //} //if (pinapCount > pinapToKeep) //{ - // await RemoveItems(pinapCount, ItemId.ItemPinapBerry, cancellationToken, session); + // await RemoveItems(pinapToRecycle, ItemId.ItemPinapBerry, cancellationToken, session); //} //if (weparCount > weparToKeep) //{ - // await RemoveItems(weparCount, ItemId.ItemWeparBerry, cancellationToken, session); + // await RemoveItems(weparToRecycle, ItemId.ItemWeparBerry, cancellationToken, session); //} } From 16343f8b8b63cc24c3fead072417934b480e877b Mon Sep 17 00:00:00 2001 From: Valmere Date: Tue, 2 Aug 2016 13:52:34 -0400 Subject: [PATCH 5/5] fixup --- PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs b/PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs index bac4f0c..15b1884 100644 --- a/PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs +++ b/PoGo.PokeMobBot.Logic/Tasks/TransferLowStatPokemon.cs @@ -37,9 +37,11 @@ public static async Task Execute(ISession session, CancellationToken cancellatio { cancellationToken.ThrowIfCancellationRequested(); - if ((pokemon.Cp >= session.LogicSettings.KeepMinCp) || //dont toss if its over min CP - (PokemonInfo.CalculatePokemonPerfection(pokemon) >= session.LogicSettings.KeepMinIvPercentage && session.LogicSettings.PrioritizeIvOverCp) || //dont toss if its over min IV - pokemon.Favorite == 1) //dont toss if its a favorite + if (pokemon.Cp >= session.LogicSettings.KeepMinCp || pokemon.Favorite == 1) //dont toss if above minimum CP or if its a favorite + { + continue; + } + if (PokemonInfo.CalculatePokemonPerfection(pokemon) >= session.LogicSettings.KeepMinIvPercentage && session.LogicSettings.PrioritizeIvOverCp) //dont toss if its over min IV { continue; }