Skip to content

Commit

Permalink
Improved default config values / Fixed CatchPokemon Task / Pokemon li…
Browse files Browse the repository at this point in the history
…sts update. (MobBotTeam#538)

* PokemonsTransferFilter v4.1 update.

* CatchPokemonTask fixes.

* PokemonToSnipe list update.

* Inventory recycle values update.

* Merge fix v2.

* Merge fix v3.
  • Loading branch information
DeadElle authored and DurtyFree committed Aug 3, 2016
1 parent 4a109f0 commit 22f1925
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 32 deletions.
86 changes: 69 additions & 17 deletions PoGo.PokeMobBot.Logic/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,25 +197,25 @@ public class GlobalSettings

//recycle
public bool AutomaticInventoryManagement = false;
public int AutomaticMaxAllPokeballs = 180;
public int AutomaticMaxAllPokeballs = 100;
public int AutomaticMaxAllPotions = 60;
public int AutomaticMaxAllRevives = 40;
public int AutomaticMaxAllRevives = 80;
public int AutomaticMaxAllBerries = 50;
public int TotalAmountOfPokeballsToKeep = 75;
public int TotalAmountOfGreatballsToKeep = 50;
public int TotalAmountOfUltraballsToKeep = 50;
public int TotalAmountOfMasterballsToKeep = 50;
public int TotalAmountOfPokeballsToKeep = 0;
public int TotalAmountOfGreatballsToKeep = 40;
public int TotalAmountOfUltraballsToKeep = 60;
public int TotalAmountOfMasterballsToKeep = 100;
public int TotalAmountOfPotionsToKeep = 0;
public int TotalAmountOfSuperPotionsToKeep = 0;
public int TotalAmountOfHyperPotionsToKeep = 0;
public int TotalAmountOfMaxPotionsToKeep = 20;
public int TotalAmountOfHyperPotionsToKeep = 20;
public int TotalAmountOfMaxPotionsToKeep = 40;
public int TotalAmountOfRevivesToKeep = 20;
public int TotalAmountOfMaxRevivesToKeep = 30;
public int TotalAmountOfRazzToKeep = 40;
//public int TotalAmountOfBlukToKeep = 40;
//public int TotalAmountOfNanabToKeep = 40;
//public int TotalAmountOfPinapToKeep = 40;
//public int TotalAmountOfWeparToKeep = 40;
public int TotalAmountOfMaxRevivesToKeep = 60;
public int TotalAmountOfRazzToKeep = 50;
//public int TotalAmountOfBlukToKeep = 50;
//public int TotalAmountOfNanabToKeep = 50;
//public int TotalAmountOfPinapToKeep = 50;
//public int TotalAmountOfWeparToKeep = 50;
public double RecycleInventoryAtUsagePercentage = 0.90;

//snipe
Expand Down Expand Up @@ -314,7 +314,7 @@ public class GlobalSettings
//PokemonId.Eevee,
//PokemonId.Dratini,
/*criteria: 50 candies commons*/
//PokemonId.Spearow
//PokemonId.Spearow,
//PokemonId.Ekans,
PokemonId.Zubat,
//PokemonId.Paras,
Expand Down Expand Up @@ -343,7 +343,7 @@ public class GlobalSettings

public Dictionary<PokemonId, TransferFilter> PokemonsTransferFilter = new Dictionary<PokemonId, TransferFilter>
{
//criteria: based on NY Central Park and Tokyo variety + sniping optimization v4
//criteria: based on NY Central Park and Tokyo variety + sniping optimization v4.1
{PokemonId.Venusaur, new TransferFilter(1750, 80, 1)},
{PokemonId.Charizard, new TransferFilter(1750, 20, 1)},
{PokemonId.Blastoise, new TransferFilter(1750, 50, 1)},
Expand All @@ -369,7 +369,7 @@ public class GlobalSettings
{PokemonId.Jynx, new TransferFilter(1250, 90, 1)},
{PokemonId.Electabuzz, new TransferFilter(1500, 80, 1)},
{PokemonId.Magmar, new TransferFilter(1750, 90, 1)},
{PokemonId.Pinsir, new TransferFilter(1750, 98, 1)},
{PokemonId.Pinsir, new TransferFilter(2000, 98, 1)},
{PokemonId.Tauros, new TransferFilter(500, 90, 1)},
{PokemonId.Gyarados, new TransferFilter(2000, 90, 1)},
{PokemonId.Lapras, new TransferFilter(2250, 90, 1)},
Expand All @@ -394,57 +394,109 @@ public class GlobalSettings
},
Pokemon = new List<PokemonId>
{
PokemonId.Bulbasaur,
PokemonId.Ivysaur,
PokemonId.Venusaur,
PokemonId.Charmander,
PokemonId.Charmeleon,
PokemonId.Charizard,
PokemonId.Squirtle,
PokemonId.Wartortle,
PokemonId.Blastoise,
PokemonId.Butterfree,
PokemonId.Beedrill,
PokemonId.Pidgeot,
PokemonId.Raticate,
PokemonId.Fearow,
PokemonId.Arbok,
PokemonId.Pikachu,
PokemonId.Raichu,
PokemonId.Sandslash,
PokemonId.Nidoqueen,
PokemonId.Nidoking,
PokemonId.Clefable,
PokemonId.Ninetales,
PokemonId.Wigglytuff,
PokemonId.Golbat,
PokemonId.Vileplume,
PokemonId.Parasect,
PokemonId.Venomoth,
PokemonId.Dugtrio,
PokemonId.Persian,
PokemonId.Golduck,
PokemonId.Primeape,
PokemonId.Growlithe,
PokemonId.Arcanine,
PokemonId.Poliwag,
PokemonId.Poliwhirl,
PokemonId.Poliwrath,
PokemonId.Abra,
PokemonId.Kadabra,
PokemonId.Alakazam,
PokemonId.Machop,
PokemonId.Machoke,
PokemonId.Machamp,
PokemonId.Victreebel,
PokemonId.Tentacruel,
PokemonId.Golem,
PokemonId.Rapidash,
PokemonId.Slowbro,
PokemonId.Magneton,
PokemonId.Farfetchd,
PokemonId.Dodrio,
PokemonId.Dewgong,
PokemonId.Grimer,
PokemonId.Muk,
PokemonId.Cloyster,
PokemonId.Gastly,
PokemonId.Haunter,
PokemonId.Gengar,
PokemonId.Onix,
PokemonId.Hypno,
PokemonId.Kingler,
PokemonId.Electrode,
PokemonId.Exeggutor,
PokemonId.Marowak,
PokemonId.Hitmonlee,
PokemonId.Hitmonchan,
PokemonId.Lickitung,
PokemonId.Koffing,
PokemonId.Weezing,
PokemonId.Rhyhorn,
PokemonId.Rhydon,
PokemonId.Chansey,
PokemonId.Tangela,
PokemonId.Kangaskhan,
PokemonId.Seadra,
PokemonId.Seaking,
PokemonId.Starmie,
PokemonId.MrMime,
PokemonId.Scyther,
PokemonId.Jynx,
PokemonId.Electabuzz,
PokemonId.Magmar,
PokemonId.Pinsir,
PokemonId.Tauros,
PokemonId.Magikarp,
PokemonId.Gyarados,
PokemonId.Lapras,
PokemonId.Ditto,
PokemonId.Eevee,
PokemonId.Vaporeon,
PokemonId.Jolteon,
PokemonId.Flareon,
PokemonId.Porygon,
PokemonId.Omanyte,
PokemonId.Omastar,
PokemonId.Kabuto,
PokemonId.Kabutops,
PokemonId.Aerodactyl,
PokemonId.Snorlax,
PokemonId.Articuno,
PokemonId.Zapdos,
PokemonId.Moltres,
PokemonId.Dratini,
PokemonId.Dragonair,
PokemonId.Dragonite,
PokemonId.Mewtwo,
PokemonId.Mew
Expand Down
26 changes: 11 additions & 15 deletions PoGo.PokeMobBot.Logic/Tasks/CatchPokemonTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static async Task Execute(ISession session, dynamic encounter, MapPokemon
{
if (encounter is EncounterResponse && pokemon == null)
throw new ArgumentException("Parameter pokemon must be set, if encounter is of type EncounterResponse",
"pokemon");
nameof(pokemon));

CatchPokemonResponse caughtPokemonResponse;
var attemptCounter = 1;
Expand All @@ -54,7 +54,8 @@ public static async Task Execute(ISession session, dynamic encounter, MapPokemon
}

var useBerryBelowCatchProbability = session.LogicSettings.UseBerryBelowCatchProbability > 1
? session.LogicSettings.UseBerryBelowCatchProbability / 100 : session.LogicSettings.UseBerryBelowCatchProbability;
? session.LogicSettings.UseBerryBelowCatchProbability/100
: session.LogicSettings.UseBerryBelowCatchProbability;
var isLowProbability = probability < useBerryBelowCatchProbability;
var isHighCp = encounter != null &&
(encounter is EncounterResponse
Expand Down Expand Up @@ -212,33 +213,28 @@ private static async Task<ItemId> GetBestBall(ISession session, dynamic encounte
: encounter?.PokemonData));

var useUltraBallBelowCatchProbability = session.LogicSettings.UseUltraBallBelowCatchProbability > 1
? session.LogicSettings.UseUltraBallBelowCatchProbability / 100 : session.LogicSettings.UseUltraBallBelowCatchProbability;
? session.LogicSettings.UseUltraBallBelowCatchProbability/100
: session.LogicSettings.UseUltraBallBelowCatchProbability;
var useGreatBallBelowCatchProbability = session.LogicSettings.UseGreatBallBelowCatchProbability > 1
? session.LogicSettings.UseGreatBallBelowCatchProbability / 100 : session.LogicSettings.UseGreatBallBelowCatchProbability;
? session.LogicSettings.UseGreatBallBelowCatchProbability/100
: session.LogicSettings.UseGreatBallBelowCatchProbability;

await session.Inventory.RefreshCachedInventory();
var pokeBallsCount = await session.Inventory.GetItemAmountByType(ItemId.ItemPokeBall);
var greatBallsCount = await session.Inventory.GetItemAmountByType(ItemId.ItemGreatBall);
var ultraBallsCount = await session.Inventory.GetItemAmountByType(ItemId.ItemUltraBall);
var masterBallsCount = await session.Inventory.GetItemAmountByType(ItemId.ItemMasterBall);

if (masterBallsCount > 0 && !session.LogicSettings.PokemonToUseMasterball.Any() &&
if (masterBallsCount > 0 && !session.LogicSettings.PokemonToUseMasterball.Any() ||
session.LogicSettings.PokemonToUseMasterball.Contains(pokemonId))
return ItemId.ItemMasterBall;
if (ultraBallsCount > 0 && iV >= session.LogicSettings.UseUltraBallAboveIv &&
if (ultraBallsCount > 0 && iV >= session.LogicSettings.UseUltraBallAboveIv ||
probability <= useUltraBallBelowCatchProbability)
return ItemId.ItemUltraBall;
if (greatBallsCount > 0 && iV >= session.LogicSettings.UseGreatBallAboveIv &&
if (greatBallsCount > 0 && iV >= session.LogicSettings.UseGreatBallAboveIv ||
probability <= useGreatBallBelowCatchProbability)
return ItemId.ItemGreatBall;
if (pokeBallsCount > 0)
return ItemId.ItemPokeBall;
if (greatBallsCount > 0)
return ItemId.ItemGreatBall;
if (ultraBallsCount > 0)
return ItemId.ItemUltraBall;

return ItemId.ItemUnknown;
return pokeBallsCount > 0 ? ItemId.ItemPokeBall : ItemId.ItemUnknown;
}

private static async Task UseBerry(ISession session, ulong encounterId, string spawnPointId)
Expand Down

0 comments on commit 22f1925

Please sign in to comment.