Skip to content

Commit

Permalink
Merge pull request NecronomiconCoding#1627 from simplyphp/master
Browse files Browse the repository at this point in the history
Fixed full inventory to kick off recycling
  • Loading branch information
NecronomiconCoding authored Aug 1, 2016
2 parents b7f035e + dec2b70 commit 5123f42
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 26 deletions.
2 changes: 1 addition & 1 deletion PoGo.NecroBot.Logic/Common/Translations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public class Translation : ITranslation
new KeyValuePair<TranslationString, string>(TranslationString.NoIncenseAvailable, "No Incense Available"),
new KeyValuePair<TranslationString, string>(TranslationString.UseIncenseActive, "Incense Already Active"),
new KeyValuePair<TranslationString, string>(TranslationString.AmountPkmSeenCaught,
"Amount of Pokemon Seen:{}:151, Amount of Pokemon Caught:{}:151"),
"Amount of Pokemon Seen: {0}/151, Amount of Pokemon Caught: {1}/151"),
new KeyValuePair<TranslationString, string>(TranslationString.PkmPotentialEvolveCount,
"[Evolves] Potential Evolves: {}"),
new KeyValuePair<TranslationString, string>(TranslationString.PkmNotEnoughRessources,
Expand Down
5 changes: 1 addition & 4 deletions PoGo.NecroBot.Logic/Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,12 @@ public async Task<List<InventoryItem>> GetPokeDexItems()
var hfgds = await _client.Inventory.GetInventory();
for (int i = 0; i < hfgds.InventoryDelta.InventoryItems.Count; i++)
{
if (hfgds.InventoryDelta.InventoryItems[i].ToString().ToLower().Contains("pokedex") && hfgds.InventoryDelta.InventoryItems[i].ToString().ToLower().Contains("timescaptured"))
if (hfgds.InventoryDelta.InventoryItems[i].ToString().ToLower().Contains("pokedex") && hfgds.InventoryDelta.InventoryItems[i].ToString().ToLower().Contains("timesencountered"))
{
PokeDex.Add(hfgds.InventoryDelta.InventoryItems[i]);
}


}
return PokeDex;

}

public async Task<List<Candy>> GetPokemonFamilies()
Expand Down
14 changes: 7 additions & 7 deletions PoGo.NecroBot.Logic/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ public class GlobalSettings
public bool PrioritizeIvOverCp = false;
//luckyandincense
public bool UseEggIncubators = true;
public bool UseLuckyEggConstantly = true;
public bool UseLuckyEggConstantly = false;
public int UseLuckyEggsMinPokemonAmount = 30;
public bool UseLuckyEggsWhileEvolving = false;
public bool UseIncenseConstantly = true;
public bool UseIncenseConstantly = false;
//snipe
public bool UseSnipeOnlineLocationServer = true;
public bool UseSnipeLocationServer = false;
Expand All @@ -178,13 +178,13 @@ public class GlobalSettings
public int TotalAmountOfPotionsToKeep = 80;
public int TotalAmountOfRevivesToKeep = 60;
//balls
public int UseGreatBallAboveCp = 750;
public int UseUltraBallAboveCp = 1000;
public int UseGreatBallAboveCp = 1000;
public int UseUltraBallAboveCp = 1250;
public int UseMasterBallAboveCp = 1500;
public int UseGreatBallAboveIv = 80;
public int UseGreatBallAboveIv = 85;
public int UseUltraBallAboveIv = 90;
public double UseGreatBallBelowCatchProbability = 0.5;
public double UseUltraBallBelowCatchProbability = 0.4;
public double UseGreatBallBelowCatchProbability = 0.3;
public double UseUltraBallBelowCatchProbability = 0.2;
public double UseMasterBallBelowCatchProbability = 0.05;
//transfer
public bool TransferDuplicatePokemon = true;
Expand Down
6 changes: 6 additions & 0 deletions PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
Longitude = pokeStop.Longitude
});
}
else
{
await RecycleItemsTask.Execute(session, cancellationToken);

}

if (fortSearch.ItemsAwarded.Count > 0)
{
await session.Inventory.RefreshCachedInventory();
Expand Down
3 changes: 2 additions & 1 deletion PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,14 @@ await session.Navigation.Move(new GeoCoordinate(pokeStop.Latitude, pokeStop.Long
Longitude = pokeStop.Longitude,
InventoryFull = fortSearch.Result == FortSearchResponse.Types.Result.InventoryFull
});
await RecycleItemsTask.Execute(session, cancellationToken);

break; //Continue with program as loot was succesfull.
}
} while (fortTry < retryNumber - zeroCheck);
//Stop trying if softban is cleaned earlier or if 40 times fort looting failed.

await Task.Delay(1000, cancellationToken);
//await Task.Delay(1000, cancellationToken);

await eggWalker.ApplyDistance(distance, cancellationToken);

Expand Down
18 changes: 5 additions & 13 deletions PoGo.NecroBot.Logic/Tasks/GetPokeDexCount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,25 @@
using System.Threading;
using System.Threading.Tasks;
using PoGo.NecroBot.Logic.Logging;
using PoGo.NecroBot.Logic.Common;

namespace PoGo.NecroBot.Logic.Tasks
{
class GetPokeDexCount
{


public static async Task Execute(ISession session, CancellationToken cancellationToken)
{
int Amount = 0;
int timesCaptured = 0;
var PokeDex = await session.Inventory.GetPokeDexItems();
for (int i = 0; i < PokeDex.Count; i++)
{
var CaughtPokemon = PokeDex[i].ToString().Split(new[] { "timesCaptured" }, StringSplitOptions.None);
var split = CaughtPokemon[1].Split(' ');
int Times = int.Parse(split[1]);
if (Times == 0)
{


}
else
{
Amount++;
}
if (Times > 0)
timesCaptured++;
}
Logger.Write("Amount Of Pokemon Seen:" + PokeDex.Count + ":151" + ", Amount Of Pokemon Caught:" + Amount + ":151");
Logger.Write(session.Translation.GetTranslation(TranslationString.AmountPkmSeenCaught, PokeDex.Count, timesCaptured));
}
}
}

0 comments on commit 5123f42

Please sign in to comment.