Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed frequent recycling to be inventory based #1514

Merged
merged 43 commits into from
Jul 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8c4ea42
Merge pull request #9 from NecronomiconCoding/master
BornSupercharged Jul 30, 2016
d9eceec
Update README.md
AN2548 Jul 30, 2016
bf48384
Update README.md
AN2548 Jul 30, 2016
d414a1f
Update translation.es.json
javilonas Jul 30, 2016
f16ae32
Update translation.es.json
javilonas Jul 30, 2016
73e9ddf
Update translation.es.json
javilonas Jul 30, 2016
65e8a26
Update translation.es.json
javilonas Jul 30, 2016
956feda
Update translation.fr.json
0xEBO Jul 30, 2016
cfd7065
Update translation.es.json
javilonas Jul 30, 2016
5a2cfea
Update translation.fr.json
0xEBO Jul 30, 2016
d8b79b8
Bot was catching all pokemons above 300 with greatball despite ignoring
Revell1on Jul 30, 2016
cc8c15d
Update EvolvePokemonTask.cs
N0ct3 Jul 30, 2016
e9677da
Update translation.fr.json
0xEBO Jul 30, 2016
44e7bc5
Update translation.fr.json
0xEBO Jul 30, 2016
f737196
Use online server
Tsuki Jul 30, 2016
90b09fd
Add translation.ca.json
SinekNAT Jul 30, 2016
b626a34
Merge pull request #10 from NecronomiconCoding/master
BornSupercharged Jul 30, 2016
587cb95
Fixed problems with ball logic
BornSupercharged Jul 30, 2016
a74e257
Fixed indentation and added iV configurable option
BornSupercharged Jul 30, 2016
520a697
Had a bug in the code where it would throw a ultraball instead of a g…
BornSupercharged Jul 30, 2016
798ca4b
Merge pull request #1472 from AN2548/master
Jul 30, 2016
0455cbd
Merge pull request #1480 from javilonas/patch-9
Jul 30, 2016
187dbfc
Merge pull request #1485 from SebastienBenazet/patch-1
Jul 30, 2016
a2b1407
Merge pull request #1493 from Sinekk/master
Jul 30, 2016
2f44785
Merge pull request #1488 from N0ct3/patch-1
Jul 30, 2016
ac7d48b
Merge pull request #1486 from Tsuki/Snaping
Jul 30, 2016
2756be6
Merge pull request #1487 from Revell1on/master
Jul 30, 2016
3c2c7e4
Update translation.pt-pt.json
BanaipePT Jul 30, 2016
78f4e8d
Updates to websockets to handle command based communcation (#1497)
TheTravelingTrainer Jul 30, 2016
fac3f0b
Update translation.pt-pt.json
BanaipePT Jul 30, 2016
97964ee
Merge pull request #1500 from nrmodesto/patch-2
Jul 31, 2016
a5f1cb7
Updated translation.it.json
Jul 31, 2016
f364256
Merge pull request #1501 from AlessioDP/patch-2
Jul 31, 2016
7cfd30a
Everything is working except the external POGOProtos dll for the sett…
BornSupercharged Jul 31, 2016
6b64c30
Merged in
BornSupercharged Jul 31, 2016
ca2d40a
Merge pull request #1495 from bornsupercharged/better_ball_decision
Jul 31, 2016
b462a1b
Merge pull request #12 from NecronomiconCoding/master
BornSupercharged Jul 31, 2016
49fbdc1
Merge pull request #13 from bornsupercharged/master
BornSupercharged Jul 31, 2016
84adbf2
Merge pull request #14 from bornsupercharged/star_high_iv
BornSupercharged Jul 31, 2016
40cb81b
Added fix for recycling to not happen unless bag capacity is at 95% o…
BornSupercharged Jul 31, 2016
8399e09
Merge pull request #15 from bornsupercharged/star_high_iv
BornSupercharged Jul 31, 2016
af17df2
Merging
BornSupercharged Jul 31, 2016
8120826
Made recycling a configurable inventory usage percentage
BornSupercharged Jul 31, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion PoGo.NecroBot.CLI/WebSocketInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private void HandleEvent(ProfileEvent evt)

private async void HandleMessage(WebSocketSession session, string message)
{
switch (message)
switch(message)
{
case "PokemonList":
await PokemonListTask.Execute(_session);
Expand All @@ -106,6 +106,18 @@ private async void HandleMessage(WebSocketSession session, string message)
{


}

// Setup to only send data back to the session that requested it.
try
{
dynamic decodedMessage = JObject.Parse(message);
await _websocketHandler?.Handle(_session, session, decodedMessage);
}
catch (JsonException ex)
{


}
}

Expand Down
1 change: 1 addition & 0 deletions PoGo.NecroBot.Logic/ILogicSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public interface ILogicSettings
int TotalAmountOfPotionsToKeep { get; }
int TotalAmountOfRevivesToKeep { get; }

double RecycleInventoryAtUsagePercentage { get; }
ICollection<KeyValuePair<ItemId, int>> ItemRecycleFilter { get; }

ICollection<PokemonId> PokemonsToEvolve { get; }
Expand Down
3 changes: 2 additions & 1 deletion PoGo.NecroBot.Logic/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public class GlobalSettings

public string GpxFile = "GPXPath.GPX";


public double RecycleInventoryAtUsagePercentage = 0.90;
public List<KeyValuePair<ItemId, int>> ItemRecycleFilter = new List<KeyValuePair<ItemId, int>>
{
new KeyValuePair<ItemId, int>(ItemId.ItemUnknown, 0),
Expand Down Expand Up @@ -620,6 +620,7 @@ public LogicSettings(GlobalSettings settings)
public int AmountOfPokemonToDisplayOnStart => _settings.AmountOfPokemonToDisplayOnStart;
public bool DumpPokemonStats => _settings.DumpPokemonStats;
public string TranslationLanguageCode => _settings.TranslationLanguageCode;
public double RecycleInventoryAtUsagePercentage => _settings.RecycleInventoryAtUsagePercentage;
public ICollection<KeyValuePair<ItemId, int>> ItemRecycleFilter => _settings.ItemRecycleFilter;
public ICollection<PokemonId> PokemonsToEvolve => _settings.PokemonsToEvolve;
public ICollection<PokemonId> PokemonsNotToTransfer => _settings.PokemonsNotToTransfer;
Expand Down
2 changes: 1 addition & 1 deletion PoGo.NecroBot.Logic/Tasks/RecycleItemsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
cancellationToken.ThrowIfCancellationRequested();

var currentTotalItems = await session.Inventory.GetTotalItemCount();
if ((session.Profile.PlayerData.MaxItemStorage*.95) > currentTotalItems)
if ((session.Profile.PlayerData.MaxItemStorage * session.LogicSettings.RecycleInventoryAtUsagePercentage) > currentTotalItems)
return;

var items = await session.Inventory.GetItemsToRecycle(session);
Expand Down