From 91a7db6c9435f6c4e8ef568db1ce0f637dcfa3ce Mon Sep 17 00:00:00 2001 From: Executive Dronpes Date: Mon, 27 Mar 2017 16:22:24 +0530 Subject: [PATCH 01/11] Update CatchPokemonTask.cs --- PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs index ce4ec8efa..5e6e7053d 100644 --- a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs @@ -1,4 +1,4 @@ -#region using directives +#region using directives using System; using System.Globalization; @@ -231,7 +231,7 @@ public static async Task Execute(ISession session, { if (session.LogicSettings.UseHumanlikeDelays) { - await DelayingUtils.DelayAsync(session.LogicSettings.BeforeCatchDelay, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); + DelayingUtils.Delay(session.LogicSettings.BeforeCatchDelay, 0); } if ((session.LogicSettings.MaxPokeballsPerPokemon > 0 && @@ -248,7 +248,7 @@ public static async Task Execute(ISession session, }); return false; } - + // Determine whether to use berries or not if (lastThrow != CatchPokemonResponse.Types.CatchStatus.CatchMissed) { @@ -430,7 +430,13 @@ encounter is EncounterResponse || encounter is IncenseEncounterResponse if (caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchSuccess) { evt.Gender = (await session.Inventory.GetPokemons().ConfigureAwait(false)).First(x => x.Id == caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Gender.ToString(); - + if (session.LogicSettings.AutoFavoriteShinyOnCatch = true) + { + if (caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Shiny = true) + { + await FavoritePokemonTask.Excecute (session, encounteredPokemon.Id, true); + } + } var totalExp = 0; var totalStarDust = caughtPokemonResponse.CaptureAward.Stardust.Sum(); if (encounteredPokemon != null) @@ -502,30 +508,30 @@ encounter is EncounterResponse || encounter is IncenseEncounterResponse switch (caughtPokemonResponse.Status) { case CatchPokemonResponse.Types.CatchStatus.CatchError: - await DelayingUtils.DelayAsync(session.LogicSettings.CatchErrorDelay, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); + DelayingUtils.Delay(session.LogicSettings.CatchErrorDelay, 0); break; case CatchPokemonResponse.Types.CatchStatus.CatchSuccess: - await DelayingUtils.DelayAsync(session.LogicSettings.CatchSuccessDelay, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); + DelayingUtils.Delay(session.LogicSettings.CatchSuccessDelay, 0); break; case CatchPokemonResponse.Types.CatchStatus.CatchEscape: - await DelayingUtils.DelayAsync(session.LogicSettings.CatchEscapeDelay, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); + DelayingUtils.Delay(session.LogicSettings.CatchEscapeDelay, 0); break; case CatchPokemonResponse.Types.CatchStatus.CatchFlee: - await DelayingUtils.DelayAsync(session.LogicSettings.CatchFleeDelay, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); + DelayingUtils.Delay(session.LogicSettings.CatchFleeDelay, 0); break; case CatchPokemonResponse.Types.CatchStatus.CatchMissed: - await DelayingUtils.DelayAsync(session.LogicSettings.CatchMissedDelay, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); + DelayingUtils.Delay(session.LogicSettings.CatchMissedDelay, 0); break; default: break; } } - else await DelayingUtils.DelayAsync(session.LogicSettings.DelayBetweenPlayerActions, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); + else DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 0); } while (caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchMissed || caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchEscape); @@ -822,4 +828,4 @@ public static async Task UseBerry(ISession session, } } -} \ No newline at end of file +} From e03eec050606a853450b21ca7d15c9b0277ffe79 Mon Sep 17 00:00:00 2001 From: Executive Dronpes Date: Mon, 27 Mar 2017 16:25:35 +0530 Subject: [PATCH 02/11] Update PokemonConfig.cs --- .../Model/Settings/PokemonConfig.cs | 217 +++++++++--------- 1 file changed, 111 insertions(+), 106 deletions(-) diff --git a/PoGo.NecroBot.Logic/Model/Settings/PokemonConfig.cs b/PoGo.NecroBot.Logic/Model/Settings/PokemonConfig.cs index 9c08270d9..75aa84e33 100644 --- a/PoGo.NecroBot.Logic/Model/Settings/PokemonConfig.cs +++ b/PoGo.NecroBot.Logic/Model/Settings/PokemonConfig.cs @@ -164,311 +164,316 @@ internal enum CpIv [DefaultValue(false)] [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 24)] public bool AutoFavoritePokemon; + + [NecrobotConfig(Description = "Allow bot auto favorite any shiny pokemon on catch", Position = 25)] + [DefaultValue(false)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 25)] + public bool AutoFavoriteShinyOnCatch; /*PokeBalls*/ - [NecrobotConfig(Description = "Number of balls will be use for catch a pokemon", Position = 25)] + [NecrobotConfig(Description = "Number of balls will be use for catch a pokemon", Position = 26)] [DefaultValue(6)] [Range(0, 999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 25)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 26)] public int MaxPokeballsPerPokemon { get; set; } - [NecrobotConfig(Description = "Define min CP for use greate ball instead of PokeBall", Position = 26)] + [NecrobotConfig(Description = "Define min CP for use greate ball instead of PokeBall", Position = 27)] [DefaultValue(1000)] [Range(0, 9999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 26)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 27)] public int UseGreatBallAboveCp { get; set; } - [NecrobotConfig(Description = "Define min CP for use Ultra Ball instead of Great Ball", Position = 27)] + [NecrobotConfig(Description = "Define min CP for use Ultra Ball instead of Great Ball", Position = 28)] [DefaultValue(1250)] [Range(0, 9999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 27)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 28)] public int UseUltraBallAboveCp { get; set; } - [NecrobotConfig(Description = "Define min CP for use master ball instead of Ultra Ball", Position = 28)] + [NecrobotConfig(Description = "Define min CP for use master ball instead of Ultra Ball", Position = 29)] [DefaultValue(1500)] [Range(0, 9999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 28)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 29)] public int UseMasterBallAboveCp { get; set; } - [NecrobotConfig(Description = "Define min IV for use Great Ball instead of PokeBall", Position = 29)] + [NecrobotConfig(Description = "Define min IV for use Great Ball instead of PokeBall", Position = 30)] [DefaultValue(85.0)] [Range(0, 101)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 29)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 30)] public double UseGreatBallAboveIv { get; set; } - [NecrobotConfig(Description = "Define min CP for use ultra ball instead of Great Ball", Position = 30)] + [NecrobotConfig(Description = "Define min CP for use ultra ball instead of Great Ball", Position = 31)] [DefaultValue(95.0)] [Range(0, 101)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 30)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 31)] public double UseUltraBallAboveIv { get; set; } - [NecrobotConfig(Description = "Define min catch probability for use Ultra Ball instead of pokemon ball", Position = 31)] + [NecrobotConfig(Description = "Define min catch probability for use Ultra Ball instead of pokemon ball", Position = 32)] [DefaultValue(0.2)] [Range(0, 1)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 31)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 32)] public double UseGreatBallBelowCatchProbability { get; set; } - [NecrobotConfig(Description = "Define min catch probability for use Ultra Ball instead of greate ball", Position = 32)] + [NecrobotConfig(Description = "Define min catch probability for use Ultra Ball instead of greate ball", Position = 33)] [DefaultValue(0.1)] [Range(0, 1)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 32)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 33)] public double UseUltraBallBelowCatchProbability { get; set; } - [NecrobotConfig(Description = "Define min catch probability for use Master Ball instead of ultra ball", Position = 33)] + [NecrobotConfig(Description = "Define min catch probability for use Master Ball instead of ultra ball", Position = 34)] [DefaultValue(0.05)] [Range(0, 999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 33)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 34)] public double UseMasterBallBelowCatchProbability { get; set; } /*PoweUp*/ - [NecrobotConfig(Description = "Allow bot power up pokemon ", Position = 34)] + [NecrobotConfig(Description = "Allow bot power up pokemon ", Position = 35)] [DefaultValue(false)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 34)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 35)] public bool AutomaticallyLevelUpPokemon; - [NecrobotConfig(Description = "Only allow bot upgrade favorited pokemon", Position = 35)] + [NecrobotConfig(Description = "Only allow bot upgrade favorited pokemon", Position = 36)] [DefaultValue(true)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 35)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 36)] public bool OnlyUpgradeFavorites { get; set; } - [NecrobotConfig(Description = "Use level up list pokemon", Position = 36)] + [NecrobotConfig(Description = "Use level up list pokemon", Position = 37)] [DefaultValue(true)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 36)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 37)] public bool UseLevelUpList { get; set; } - [NecrobotConfig(Description = "Number of time upgrade 1 pokemon", Position = 37)] + [NecrobotConfig(Description = "Number of time upgrade 1 pokemon", Position = 38)] [DefaultValue(5)] [Range(0, 99)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 37)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 38)] public int AmountOfTimesToUpgradeLoop { get; set; } - [NecrobotConfig(Description = "Min startdust keep for auto power up", Position = 38)] + [NecrobotConfig(Description = "Min startdust keep for auto power up", Position = 39)] [DefaultValue(5000)] [Range(0, 999999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 38)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 39)] public int GetMinStarDustForLevelUp { get; set; } - [NecrobotConfig(Description = "Select pokemon to powerup by IV or CP", Position = 39)] + [NecrobotConfig(Description = "Select pokemon to powerup by IV or CP", Position = 40)] [DefaultValue("iv")] [EnumDataType(typeof(CpIv))] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 39)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 40)] public string LevelUpByCPorIv { get; set; } - [NecrobotConfig(Description = "MIn CP for pokemon upgrade", Position = 40)] + [NecrobotConfig(Description = "MIn CP for pokemon upgrade", Position = 41)] [DefaultValue(1000)] [Range(0, 9999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 40)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 41)] public float UpgradePokemonCpMinimum { get; set; } - [NecrobotConfig(Description = "MIn IV for pokemon upgrade", Position = 41)] + [NecrobotConfig(Description = "MIn IV for pokemon upgrade", Position = 42)] [DefaultValue(95)] [Range(0, 100)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 41)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 42)] public float UpgradePokemonIvMinimum { get; set; } - [NecrobotConfig(Description = "Logic operator for select pokemon for upgrade", Position = 42)] + [NecrobotConfig(Description = "Logic operator for select pokemon for upgrade", Position = 43)] [DefaultValue("and")] [EnumDataType(typeof(Operator))] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 42)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 43)] public string UpgradePokemonMinimumStatsOperator { get; set; } /*Evolve*/ - [NecrobotConfig(Description = "Specify min IV for evolve pokemon", Position = 43)] + [NecrobotConfig(Description = "Specify min IV for evolve pokemon", Position = 44)] [DefaultValue(95)] [Range(0, 100)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 43)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 44)] public float EvolveAboveIvValue { get; set; } - [NecrobotConfig(Description = "Allow bot evolve all pokemon above this IV", Position = 44)] + [NecrobotConfig(Description = "Allow bot evolve all pokemon above this IV", Position = 45)] [DefaultValue(false)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 44)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 45)] public bool EvolveAllPokemonAboveIv; - [NecrobotConfig(Description = "When turn on, bot will evolve pokemon when has enought candy", Position = 45)] + [NecrobotConfig(Description = "When turn on, bot will evolve pokemon when has enought candy", Position = 46)] [DefaultValue(true)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 45)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 46)] public bool EvolveAllPokemonWithEnoughCandy { get; set; } - [NecrobotConfig(Description = "Specify the max storage pokemon bag for trigger evolve", Position = 46)] + [NecrobotConfig(Description = "Specify the max storage pokemon bag for trigger evolve", Position = 47)] [DefaultValue(90)] [Range(0, 100)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 46)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 47)] public double EvolveKeptPokemonsAtStorageUsagePercentage { get; set; } - [NecrobotConfig(Description = "Specify the pokemon to keep for mass evolve", Position = 47)] + [NecrobotConfig(Description = "Specify the pokemon to keep for mass evolve", Position = 48)] [DefaultValue(120)] [Range(0, 999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 47)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 48)] public int EvolveKeptPokemonIfBagHasOverThisManyPokemon = 120; /*Keep*/ - [NecrobotConfig(Description = "Allow bot keep low candy pokemon for evolve", Position = 47)] + [NecrobotConfig(Description = "Allow bot keep low candy pokemon for evolve", Position = 49)] [DefaultValue(false)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 48)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 49)] public bool KeepPokemonsThatCanEvolve; - [NecrobotConfig(Description = "Specify min CP to not transfer pokemon", Position = 48)] + [NecrobotConfig(Description = "Specify min CP to not transfer pokemon", Position = 50)] [DefaultValue(1250)] [Range(0, 9999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 49)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 50)] public int KeepMinCp { get; set; } - [NecrobotConfig(Description = "Specify min IV to not transfer pokemon", Position = 49)] + [NecrobotConfig(Description = "Specify min IV to not transfer pokemon", Position = 51)] [DefaultValue(90)] [Range(0, 101)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 50)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 51)] public float KeepMinIvPercentage { get; set; } - [NecrobotConfig(Description = "Specify min LV to not transfer pokemon", Position = 50)] + [NecrobotConfig(Description = "Specify min LV to not transfer pokemon", Position = 52)] [DefaultValue(6)] [Range(0, 100)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 51)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 52)] public int KeepMinLvl { get; set; } - [NecrobotConfig(Description = "Logic operator for keep pokemon check", Position = 51)] + [NecrobotConfig(Description = "Logic operator for keep pokemon check", Position = 53)] [DefaultValue("or")] [EnumDataType(typeof(Operator))] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 52)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 53)] public string KeepMinOperator { get; set; } - [NecrobotConfig(Description = "Tell bot to check level before transfer", Position = 52)] + [NecrobotConfig(Description = "Tell bot to check level before transfer", Position = 54)] [DefaultValue(false)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 53)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 54)] public bool UseKeepMinLvl; - [NecrobotConfig(Description = "Keep pokemon has higher IV then CP to not transfer pokemon", Position = 53)] + [NecrobotConfig(Description = "Keep pokemon has higher IV then CP to not transfer pokemon", Position = 55)] [DefaultValue(true)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 53)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 55)] public bool PrioritizeIvOverCp { get; set; } - [NecrobotConfig(Description = "Number of duplicated pokemon to keep", Position = 54)] + [NecrobotConfig(Description = "Number of duplicated pokemon to keep", Position = 56)] [DefaultValue(1)] [Range(0, 999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 54)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 56)] public int KeepMinDuplicatePokemon { get; set; } /*NotCatch*/ - [NecrobotConfig(Description = "Use list pokemon not catch filter", Position = 55)] + [NecrobotConfig(Description = "Use list pokemon not catch filter", Position = 57)] [DefaultValue(true)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 55)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 57)] public bool UsePokemonToNotCatchFilter { get; set; } - [NecrobotConfig(Description = "UsePokemonToCatchLocallyListOnly", Position = 56)] + [NecrobotConfig(Description = "UsePokemonToCatchLocallyListOnly", Position = 58)] [DefaultValue(false)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 56)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 58)] public bool UsePokemonToCatchLocallyListOnly { get; set; } /*Dump Stats*/ - [NecrobotConfig(Description = "Allow bot dump list pokemon to csv file", Position = 57)] + [NecrobotConfig(Description = "Allow bot dump list pokemon to csv file", Position = 59)] [DefaultValue(false)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 57)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 59)] public bool DumpPokemonStats; [DefaultValue(10000)] - [NecrobotConfig(Description = "Delay time between pokemon upgrade", Position = 58)] + [NecrobotConfig(Description = "Delay time between pokemon upgrade", Position = 60)] [Range(0, 99999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 58)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 60)] public int DelayBetweenPokemonUpgrade { get; set; } [DefaultValue(5)] - [NecrobotConfig(Description = "Temporary disable catch pokemon for certain minutes if bot run out of balls", Position = 59)] + [NecrobotConfig(Description = "Temporary disable catch pokemon for certain minutes if bot run out of balls", Position = 61)] [Range(0, 120)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 59)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 61)] public int OutOfBallCatchBlockTime { get; set; } [DefaultValue(50)] - [NecrobotConfig(Description = "Number of balls you want to save for snipe or manual play - it mean if total ball less than this value, catch pokemon will be deactive", Position = 60)] + [NecrobotConfig(Description = "Number of balls you want to save for snipe or manual play - it mean if total ball less than this value, catch pokemon will be deactive", Position = 62)] [Range(0, 999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 60)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 62)] public int PokeballToKeepForSnipe { get; set; } [DefaultValue(true)] - [NecrobotConfig(Description = "Transfer multiple pokemon at 1 time - that will increase bot speed and reduce api call", Position = 61)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 61)] + [NecrobotConfig(Description = "Transfer multiple pokemon at 1 time - that will increase bot speed and reduce api call", Position = 63)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 63)] public bool UseBulkTransferPokemon { get; set; } [DefaultValue(10)] - [NecrobotConfig(Description = "Bot will transfer pokemons only when MaxStogare < pokemon + buffer", Position = 62)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 62)] + [NecrobotConfig(Description = "Bot will transfer pokemons only when MaxStogare < pokemon + buffer", Position = 64)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 64)] public int BulkTransferStogareBuffer { get; set; } [DefaultValue(100)] - [NecrobotConfig(Description = "Maximun number of pokemon in 1 transfer", Position = 63)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 63)] + [NecrobotConfig(Description = "Maximun number of pokemon in 1 transfer", Position = 65)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 65)] [Range(1,100)] public int BulkTransferSize { get; set; } [DefaultValue(Operator.or)] - [NecrobotConfig(Description = "Use ball operator between IV and CP ", Position = 634)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 63)] + [NecrobotConfig(Description = "Use ball operator between IV and CP ", Position = 66)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 66)] public Operator UseBallOperator { get; set; } /*Favorite CP*/ - [NecrobotConfig(Description = "Set min CP for auto favorite pokemon", Position = 64)] + [NecrobotConfig(Description = "Set min CP for auto favorite pokemon", Position = 67)] [DefaultValue(0)] [Range(0, 9999)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 64)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 67)] public float FavoriteMinCp { get; set; } - [NecrobotConfig(Description = "Set Buddy pokemon", Position = 65)] + [NecrobotConfig(Description = "Set Buddy pokemon", Position = 68)] [DefaultValue("")] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 65)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 68)] public string DefaultBuddyPokemon { get; set; } - [NecrobotConfig(Description = "Min level to favorite", Position = 66)] + [NecrobotConfig(Description = "Min level to favorite", Position = 69)] [DefaultValue(0)] [Range(0,100)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 65)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 70)] public int FavoriteMinLevel { get; set; } - [NecrobotConfig(Description = "The logic operator to check compbo IV, CP, Level to favorite pokemon", Position = 65)] + [NecrobotConfig(Description = "The logic operator to check compbo IV, CP, Level to favorite pokemon", Position = 71)] [DefaultValue(Operator.and)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 65)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 71)] public Operator FavoriteOperator { get; set; } - [NecrobotConfig(Description = "If this option set to true, bot only rename pokemon not meet with transfer settings, otherwise, bot will rename all pokemon in bag", Position = 66)] + [NecrobotConfig(Description = "If this option set to true, bot only rename pokemon not meet with transfer settings, otherwise, bot will rename all pokemon in bag", Position = 72)] [DefaultValue(false)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 65)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 72)] public bool RenamePokemonRespectTransferRule { get; set; } - [NecrobotConfig(Description = "Minium pokemon level to upgrade", Position = 67)] + [NecrobotConfig(Description = "Minium pokemon level to upgrade", Position = 73)] [DefaultValue(30)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 65)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 73)] public double UpgradePokemonLvlMinimum { get; set; } - [NecrobotConfig(Description = "Global settting - Allow bot only evolve favorited pokemons", Position = 66)] + [NecrobotConfig(Description = "Global settting - Allow bot only evolve favorited pokemons", Position = 74)] [DefaultValue(true)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 66)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 74)] public bool EvolveFavoritedOnly { get; set; } - [NecrobotConfig(Description = "The logic check to evolve pokemon", Position = 66)] + [NecrobotConfig(Description = "The logic check to evolve pokemon", Position = 75)] [DefaultValue("and")] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 65)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 75)] public string EvolveOperator { get; set; } - [NecrobotConfig(Description = "Set MinIV for bot to evolve", Position = 68)] + [NecrobotConfig(Description = "Set MinIV for bot to evolve", Position = 76)] [DefaultValue(100)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 68)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 76)] [Range(0,101)] public double EvolveMinIV { get; set; } - [NecrobotConfig(Description = "Set MinCP for bot to evolve", Position = 69)] + [NecrobotConfig(Description = "Set MinCP for bot to evolve", Position = 77)] [DefaultValue(2000)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 69)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 77)] [Range(0,5000)] public double EvolveMinCP { get; set; } - [NecrobotConfig(Description = "Set MinLevel for bot to evolve", Position = 70)] + [NecrobotConfig(Description = "Set MinLevel for bot to evolve", Position = 78)] [DefaultValue(25)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 70)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 78)] [Range(0, 5000)] public double EvolveMinLevel { get; set; } - [NecrobotConfig(Description = "Allow bot bypass catchflee - not recomment use this feature", Position = 71)] + [NecrobotConfig(Description = "Allow bot bypass catchflee - not recomment use this feature", Position = 79)] [DefaultValue(false)] - [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 71)] + [JsonProperty(Required = Required.DisallowNull, DefaultValueHandling = DefaultValueHandling.Populate, Order = 79)] public bool ByPassCatchFlee{ get; set; } } From f89c7d0160bd3486bbce507e6c2df7746d28f07e Mon Sep 17 00:00:00 2001 From: Executive Dronpes Date: Mon, 27 Mar 2017 16:38:20 +0530 Subject: [PATCH 03/11] Update CatchPokemonTask.cs --- PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs index 5e6e7053d..4d20114a2 100644 --- a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs @@ -1,4 +1,4 @@ -#region using directives +#region using directives using System; using System.Globalization; @@ -231,7 +231,7 @@ public static async Task Execute(ISession session, { if (session.LogicSettings.UseHumanlikeDelays) { - DelayingUtils.Delay(session.LogicSettings.BeforeCatchDelay, 0); + await DelayingUtils.DelayAsync(session.LogicSettings.BeforeCatchDelay, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); } if ((session.LogicSettings.MaxPokeballsPerPokemon > 0 && @@ -248,7 +248,7 @@ public static async Task Execute(ISession session, }); return false; } - + // Determine whether to use berries or not if (lastThrow != CatchPokemonResponse.Types.CatchStatus.CatchMissed) { @@ -429,14 +429,15 @@ encounter is EncounterResponse || encounter is IncenseEncounterResponse if (caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchSuccess) { - evt.Gender = (await session.Inventory.GetPokemons().ConfigureAwait(false)).First(x => x.Id == caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Gender.ToString(); if (session.LogicSettings.AutoFavoriteShinyOnCatch = true) { - if (caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Shiny = true) + if ((caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Shiny = true) { await FavoritePokemonTask.Excecute (session, encounteredPokemon.Id, true); } } + evt.Gender = (await session.Inventory.GetPokemons().ConfigureAwait(false)).First(x => x.Id == caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Gender.ToString(); + var totalExp = 0; var totalStarDust = caughtPokemonResponse.CaptureAward.Stardust.Sum(); if (encounteredPokemon != null) @@ -508,30 +509,30 @@ encounter is EncounterResponse || encounter is IncenseEncounterResponse switch (caughtPokemonResponse.Status) { case CatchPokemonResponse.Types.CatchStatus.CatchError: - DelayingUtils.Delay(session.LogicSettings.CatchErrorDelay, 0); + await DelayingUtils.DelayAsync(session.LogicSettings.CatchErrorDelay, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); break; case CatchPokemonResponse.Types.CatchStatus.CatchSuccess: - DelayingUtils.Delay(session.LogicSettings.CatchSuccessDelay, 0); + await DelayingUtils.DelayAsync(session.LogicSettings.CatchSuccessDelay, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); break; case CatchPokemonResponse.Types.CatchStatus.CatchEscape: - DelayingUtils.Delay(session.LogicSettings.CatchEscapeDelay, 0); + await DelayingUtils.DelayAsync(session.LogicSettings.CatchEscapeDelay, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); break; case CatchPokemonResponse.Types.CatchStatus.CatchFlee: - DelayingUtils.Delay(session.LogicSettings.CatchFleeDelay, 0); + await DelayingUtils.DelayAsync(session.LogicSettings.CatchFleeDelay, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); break; case CatchPokemonResponse.Types.CatchStatus.CatchMissed: - DelayingUtils.Delay(session.LogicSettings.CatchMissedDelay, 0); + await DelayingUtils.DelayAsync(session.LogicSettings.CatchMissedDelay, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); break; default: break; } } - else DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 0); + else await DelayingUtils.DelayAsync(session.LogicSettings.DelayBetweenPlayerActions, 0, session.CancellationTokenSource.Token).ConfigureAwait(false); } while (caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchMissed || caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchEscape); From 9f18a9e0ae51af83235bc24bc22c2af61a6d6f35 Mon Sep 17 00:00:00 2001 From: Executive Dronpes Date: Mon, 27 Mar 2017 16:44:54 +0530 Subject: [PATCH 04/11] Update ILogicSettings.cs --- PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs b/PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs index 69b03900e..f3474891b 100644 --- a/PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs +++ b/PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs @@ -107,6 +107,7 @@ public interface ILogicSettings int FavoriteMinLevel { get; } string FavoriteOperator { get; } bool AutoFavoritePokemon { get; } + bool AutoFavoriteShinyOnCatch { get; } string RenameTemplate { get; } int AmountOfPokemonToDisplayOnStart { get; } string TranslationLanguageCode { get; } @@ -250,4 +251,4 @@ public interface ILogicSettings int CatchMissedDelay { get; } int BeforeCatchDelay { get; } } -} \ No newline at end of file +} From 21ab1444a61b2ba33542e21855a05a7def5ce297 Mon Sep 17 00:00:00 2001 From: Executive Dronpes Date: Mon, 27 Mar 2017 16:52:55 +0530 Subject: [PATCH 05/11] Update LogicSettings.cs --- PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs b/PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs index 04daecc4e..ca2f606f3 100644 --- a/PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs +++ b/PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs @@ -171,6 +171,7 @@ public float GenRandom(float val) public string FavoriteOperator => _settings.PokemonConfig.FavoriteOperator.ToString(); public bool AutoFavoritePokemon => _settings.PokemonConfig.AutoFavoritePokemon; + public bool AutoFavoriteShinyOnCatch => _settings.PokemonConfig.AutoFavoriteShinyOnCatch; public string RenameTemplate => _settings.PokemonConfig.RenameTemplate; public int AmountOfPokemonToDisplayOnStart => _settings.ConsoleConfig.AmountOfPokemonToDisplayOnStart; public bool DumpPokemonStats => _settings.PokemonConfig.DumpPokemonStats; @@ -290,4 +291,4 @@ public float GenRandom(float val) public int BeforeCatchDelay => _settings.HumanlikeDelays.BeforeCatchDelay; } -} \ No newline at end of file +} From 060fcae6dfd0d0c6dfd5d0d6c35c487cc26d20e2 Mon Sep 17 00:00:00 2001 From: Executive Dronpes Date: Tue, 28 Mar 2017 11:18:55 +0530 Subject: [PATCH 06/11] Update ILogicSettings.cs --- PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs b/PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs index f3474891b..7a3185327 100644 --- a/PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs +++ b/PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs @@ -107,7 +107,7 @@ public interface ILogicSettings int FavoriteMinLevel { get; } string FavoriteOperator { get; } bool AutoFavoritePokemon { get; } - bool AutoFavoriteShinyOnCatch { get; } + bool AutoFavoriteShinyOnCatch { get; } string RenameTemplate { get; } int AmountOfPokemonToDisplayOnStart { get; } string TranslationLanguageCode { get; } From 748825d75bab982915f968b0d4f05070ca43db2b Mon Sep 17 00:00:00 2001 From: Executive Dronpes Date: Tue, 28 Mar 2017 11:19:16 +0530 Subject: [PATCH 07/11] Update LogicSettings.cs --- PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs b/PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs index ca2f606f3..e303c0d6e 100644 --- a/PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs +++ b/PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs @@ -171,7 +171,7 @@ public float GenRandom(float val) public string FavoriteOperator => _settings.PokemonConfig.FavoriteOperator.ToString(); public bool AutoFavoritePokemon => _settings.PokemonConfig.AutoFavoritePokemon; - public bool AutoFavoriteShinyOnCatch => _settings.PokemonConfig.AutoFavoriteShinyOnCatch; + public bool AutoFavoriteShinyOnCatch => _settings.PokemonConfig.AutoFavoriteShinyOnCatch; public string RenameTemplate => _settings.PokemonConfig.RenameTemplate; public int AmountOfPokemonToDisplayOnStart => _settings.ConsoleConfig.AmountOfPokemonToDisplayOnStart; public bool DumpPokemonStats => _settings.PokemonConfig.DumpPokemonStats; From 7e463628c44ee95b58de7579ba486978af518c54 Mon Sep 17 00:00:00 2001 From: Executive Dronpes Date: Tue, 28 Mar 2017 11:19:50 +0530 Subject: [PATCH 08/11] Update CatchPokemonTask.cs --- PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs index 4d20114a2..6b289e6ef 100644 --- a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs @@ -429,9 +429,9 @@ encounter is EncounterResponse || encounter is IncenseEncounterResponse if (caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchSuccess) { - if (session.LogicSettings.AutoFavoriteShinyOnCatch = true) + if (session.LogicSettings.AutoFavoriteShinyOnCatch) { - if ((caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Shiny = true) + if ((caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Shiny) { await FavoritePokemonTask.Excecute (session, encounteredPokemon.Id, true); } From 006d49408aacdbb2d9e859d3569915c13a67aa55 Mon Sep 17 00:00:00 2001 From: Executive Dronpes Date: Tue, 28 Mar 2017 11:21:40 +0530 Subject: [PATCH 09/11] fix typo --- PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs index 6b289e6ef..7dfee5361 100644 --- a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs @@ -433,7 +433,7 @@ encounter is EncounterResponse || encounter is IncenseEncounterResponse { if ((caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Shiny) { - await FavoritePokemonTask.Excecute (session, encounteredPokemon.Id, true); + await FavoritePokemonTask.Execute (session, encounteredPokemon.Id, true); } } evt.Gender = (await session.Inventory.GetPokemons().ConfigureAwait(false)).First(x => x.Id == caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Gender.ToString(); From 104547fbb5de6e7acecc5d1b1c077e9b8d899039 Mon Sep 17 00:00:00 2001 From: Executive Dronpes Date: Tue, 28 Mar 2017 13:06:32 +0530 Subject: [PATCH 10/11] Update CatchPokemonTask.cs --- PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs index 7dfee5361..4bb72db67 100644 --- a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs @@ -429,9 +429,10 @@ encounter is EncounterResponse || encounter is IncenseEncounterResponse if (caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchSuccess) { + evt.Shiny = (await session.Inventory.GetPokemons().ConfigureAwait(false)).First(x => x.Id == caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Shiny(); if (session.LogicSettings.AutoFavoriteShinyOnCatch) { - if ((caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Shiny) + if (evt.Shiny) { await FavoritePokemonTask.Execute (session, encounteredPokemon.Id, true); } From 5cd3c4e6ac5fd3f47d2dd6f149fee762ac2e3646 Mon Sep 17 00:00:00 2001 From: Executive Dronpes Date: Tue, 28 Mar 2017 13:11:33 +0530 Subject: [PATCH 11/11] Attempt fix --- PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs index 4bb72db67..8c810c646 100644 --- a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs @@ -429,7 +429,7 @@ encounter is EncounterResponse || encounter is IncenseEncounterResponse if (caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchSuccess) { - evt.Shiny = (await session.Inventory.GetPokemons().ConfigureAwait(false)).First(x => x.Id == caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Shiny(); + evt.Shiny = (await session.Inventory.GetPokemons().ConfigureAwait(false)).First(x => x.Id == caughtPokemonResponse.CapturedPokemonId).PokemonDisplay.Shiny; if (session.LogicSettings.AutoFavoriteShinyOnCatch) { if (evt.Shiny)