Repository: PokemonGoF/PokemonGo-Bot

Issue:
[Feature Request] Differentiate Between Unlimited and "Purchased" Incubator use.
Blue incubators are difficult to get so I use it only for 10km eggs. Is there any configuration to prevent bot from using Blue Incubator?



Discussion:
I don't believe this feature exists.

Why should it matter?
In the end you have to use all eggs anyway to get new eggs. You can not throw away any.

So you might as well use them all
the quicker you get rid of 2km egg the faster you will get a 10km egg

if you would measure this over a long time&distance then you would have hatch as many eggs as with a config like this one and one without. You would also have hatch same amount of 2,5,10km  eggs

@jimmywarting I am under the assumption that eggs hatched under Blue incubator yield new and powerful pokemon. That is why I thought this could be added as a feature. Correct me If m wrong. 

@imvikash00 do you have something to back up that story?

@jimmywarting That story is just based on my personal experience which may not be true. But [this](https://youtu.be/QcqUfCYapbo?t=63) video by Lifehacker talks about an interesting way of using eggs. So I believe bot should be smart enough to use blue incub. for 10 km whenever available.

That video is intended for people who are not using any bot :) Bot don't cares about hatching eggs, they walk as tireless walkers, better than olympics contestants :P

@pensiero I think you are forgetting the point that most of the PRs in this proj. talks about collecting more XPs and this trick definitely fits in that picture. 

The video doesn't say that if you use a unlimited incubator you get less powerful pokemon

@pensiero I think you should read the comments above. Whole discussion is about how to effectively use incubators and I believe I have made a valid point.

The video dosent say that you will get more XP or better Pokemon The most efficient way is when you have a available incubators then use it directly 

Arguments aside, this is a feature request.

Please move your feature request/s to our feature hub - http://feathub.com/PokemonGoF/PokemonGo-Bot

Feathub may be turned off in favour of better GitHub tags, issue templates, and voting structures. Please feel free to continue using this issue (but don't delete the Feathub request just yet)

I did.

https://github.com/PokemonGoF/PokemonGo-Bot/issues/3843#issuecomment-239708680


Resolving patch:
diff --git a/pokemongo_bot/cell_workers/incubate_eggs.py b/pokemongo_bot/cell_workers/incubate_eggs.py
--- a/pokemongo_bot/cell_workers/incubate_eggs.py
+++ b/pokemongo_bot/cell_workers/incubate_eggs.py
@@ -23,7 +23,10 @@ def initialize(self):
     def _process_config(self):
         self.longer_eggs_first = self.config.get("longer_eggs_first", True)
         self.min_interval = self.config.get('min_interval', 120)
-
+        
+        self.breakable_incubator = self.config.get("breakable", [])
+        self.infinite_incubator = self.config.get("infinite", [])
+    
     def work(self):
         try:
             self._check_inventory()
@@ -57,6 +60,19 @@ def _apply_incubators(self):
             for egg in self.eggs:
                 if egg["used"] or egg["km"] == -1:
                     continue
+                
+                if self.breakable_incubator:
+                    # test if the incubator is of type breakable
+                    if incubator.get('uses_remaining') is not None:
+                        if egg["km"] not in self.breakable_incubator:
+                            continue
+                    
+                if self.infinite_incubator:
+                    # test if the incubator is of type infinite
+                    if incubator.get('uses_remaining') is None:
+                        if egg["km"] not in self.infinite_incubator:
+                            continue
+                
                 self.emit_event(
                     'incubate_try',
                     level='debug',
@@ -119,7 +135,7 @@ def _check_inventory(self, lookup_ids=[]):
                 incubators = inv_data.get("egg_incubators", {}).get("egg_incubator",[])
                 if isinstance(incubators, basestring):  # checking for old response
                     incubators = [incubators]
-                for incubator in incubators:
+                for incubator in incubators:                                           
                     if 'pokemon_id' in incubator:
                         start_km = incubator.get('start_km_walked', 9001)
                         km_walked = incubator.get('target_km_walked', 9001)


Test patch: