Added an option to automatically use incubators on the best egg possible

ChemiHatake [2016-08-12 22:06:17]
Added an option to automatically use incubators on the best egg possible
Filename
PokemonGo/RocketAPI/Window/App.config
PokemonGo/RocketAPI/Window/MainForm.cs
PokemonGo/RocketAPI/Window/Settings.cs
PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs
PokemonGo/RocketAPI/Window/SettingsForm.cs
diff --git a/PokemonGo/RocketAPI/Window/App.config b/PokemonGo/RocketAPI/Window/App.config
index c59cc2e..1d67abe 100644
--- a/PokemonGo/RocketAPI/Window/App.config
+++ b/PokemonGo/RocketAPI/Window/App.config
@@ -61,6 +61,9 @@
     <add key="CatchPokemon" value="true" />
     <!--Only visit pokestop and collect items-->
     <add key="EvolveAllGivenPokemons" value="false" />
+    <!--Automatically evolve pokemon-->
+    <add key="UseIncubators" value="false" />
+    <!--Automatically use egg incubators-->
     <add key="ClientSettingsProvider.ServiceUri" value="" />
     <add key="MaxItemPokeBall" value="100" />
     <add key="MaxItemGreatBall" value="100" />
diff --git a/PokemonGo/RocketAPI/Window/MainForm.cs b/PokemonGo/RocketAPI/Window/MainForm.cs
index c983a98..92cc258 100644
--- a/PokemonGo/RocketAPI/Window/MainForm.cs
+++ b/PokemonGo/RocketAPI/Window/MainForm.cs
@@ -1,31 +1,32 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Text.RegularExpressions;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using System.Xml;
-using BrightIdeasSoftware;
+using BrightIdeasSoftware;
 using GMap.NET;
 using GMap.NET.MapProviders;
 using GMap.NET.WindowsForms;
 using GMap.NET.WindowsForms.Markers;
-using PokemonGo.RocketAPI.Enums;
-using PokemonGo.RocketAPI.Exceptions;
-using PokemonGo.RocketAPI.Extensions;
-using PokemonGo.RocketAPI.Helpers;
 using POGOProtos.Data;
+using POGOProtos.Data.Player;
 using POGOProtos.Enums;
 using POGOProtos.Inventory;
 using POGOProtos.Inventory.Item;
 using POGOProtos.Map.Fort;
 using POGOProtos.Map.Pokemon;
 using POGOProtos.Networking.Responses;
+using PokemonGo.RocketAPI.Enums;
+using PokemonGo.RocketAPI.Exceptions;
+using PokemonGo.RocketAPI.Extensions;
+using PokemonGo.RocketAPI.Helpers;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text.RegularExpressions;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.Xml;
 using static System.Reflection.Assembly;

 namespace PokemonGo.RocketAPI.Window
@@ -269,6 +270,7 @@ namespace PokemonGo.RocketAPI.Window
                     case AuthType.Ptc:
                         ColoredConsoleWrite(Color.Green, "Login Type: Pokemon Trainers Club");
                         break;
+
                     case AuthType.Google:
                         ColoredConsoleWrite(Color.Green, "Login Type: Google");
                         break;
@@ -376,7 +378,6 @@ namespace PokemonGo.RocketAPI.Window
                     ColoredConsoleWrite(Color.DarkGray, "Unable to get Country/Place");
                 }

-
                 ColoredConsoleWrite(Color.Yellow, "----------------------------");

                 // I believe a switch is more efficient and easier to read.
@@ -385,33 +386,39 @@ namespace PokemonGo.RocketAPI.Window
                     case "Leave Strongest":
                         await TransferAllButStrongestUnwantedPokemon(_client);
                         break;
+
                     case "All":
                         await TransferAllGivenPokemons(_client, pokemons, ClientSettings.TransferIvThreshold);
                         break;
+
                     case "Duplicate":
                         await TransferDuplicatePokemon(_client);
                         break;
+
                     case "IV Duplicate":
                         await TransferDuplicateIVPokemon(_client);
                         break;
+
                     case "CP":
                         await TransferAllWeakPokemon(_client, ClientSettings.TransferCpThreshold);
                         break;
+
                     case "IV":
                         await TransferAllGivenPokemons(_client, pokemons, ClientSettings.TransferIvThreshold);
                         break;
+
                     default:
                         ColoredConsoleWrite(Color.DarkGray, "Transfering pokemon disabled");
                         break;
                 }

-
                 if (ClientSettings.EvolveAllGivenPokemons)
                     await EvolveAllGivenPokemons(_client, pokemons);
                 if (ClientSettings.Recycler)
                     await RecycleItems(_client);
                 //client.RecycleItems(client);
-
+                if (ClientSettings.UseIncubators)
+                    await UseIncubators(_client);
                 if (ClientSettings.TravelSpeed > 30)
                     ColoredConsoleWrite(Color.Red, "WARNING: You are travelling over 30km/h. Your ip might get flag!");
                 //await Task.Delay(5000);
@@ -495,7 +502,6 @@ namespace PokemonGo.RocketAPI.Window
                 ColoredConsoleWrite(Color.Red, "Invalid response - Restarting");
                 //if (!_stopping) Execute();
             }
-
             catch (Exception ex)
             {
                 ColoredConsoleWrite(Color.Red, ex.ToString());
@@ -529,6 +535,7 @@ namespace PokemonGo.RocketAPI.Window
                                     return reader.ReadString();
                                 }
                                 break;
+
                             default:
                                 return "N/A";
                                 break;
@@ -614,28 +621,33 @@ namespace PokemonGo.RocketAPI.Window
                 else
                     ColoredConsoleWrite(Color.Red, $"{pokemonName} with {pokemonCp} CP and {pokemonIv}% IV got away..");

-
                 // I believe a switch is more efficient and easier to read.
                 switch (ClientSettings.TransferType)
                 {
                     case "Leave Strongest":
                         await TransferAllButStrongestUnwantedPokemon(client);
                         break;
+
                     case "All":
                         await TransferAllGivenPokemons(client, pokemons2, ClientSettings.TransferIvThreshold);
                         break;
+
                     case "Duplicate":
                         await TransferDuplicatePokemon(client);
                         break;
+
                     case "IV Duplicate":
                         await TransferDuplicateIVPokemon(client);
                         break;
+
                     case "CP":
                         await TransferAllWeakPokemon(client, ClientSettings.TransferCpThreshold);
                         break;
+
                     case "IV":
                         await TransferAllGivenPokemons(client, pokemons2, ClientSettings.TransferIvThreshold);
                         break;
+
                     default:
                         ColoredConsoleWrite(Color.DarkGray, "Transfering pokemon disabled");
                         break;
@@ -684,7 +696,6 @@ namespace PokemonGo.RocketAPI.Window
                 _pokestopsOverlay.Routes.Clear();
                 _pokestopsOverlay.Routes.Add(new GMapRoute(routePoint, "Walking Path"));

-
                 _pokemonsOverlay.Markers.Clear();
                 if (_wildPokemons != null)
                 {
@@ -853,7 +864,6 @@ namespace PokemonGo.RocketAPI.Window
                 .Aggregate((a, b) => $"{a}, {b}");
         }

-
         private async Task TransferAllButStrongestUnwantedPokemon(Client client)
         {
             var unwantedPokemonTypes = new List<PokemonId>();
@@ -1066,7 +1076,6 @@ namespace PokemonGo.RocketAPI.Window
                 else
                     pokemonToDiscard = pokemons.Where(p => p.Cp < cpThreshold).OrderByDescending(p => p.Cp).ToList();

-
                 //var unwantedPokemon = pokemonOfDesiredType.Skip(1) // keep the strongest one for potential battle-evolving
                 //                                          .ToList();
                 ColoredConsoleWrite(Color.Gray, $"Grinding {pokemonToDiscard.Count} pokemon below {cpThreshold} CP.");
@@ -1076,7 +1085,6 @@ namespace PokemonGo.RocketAPI.Window
             ColoredConsoleWrite(Color.Gray, $"Finished grinding all the meat");
         }

-
         public async Task PrintLevel(Client client)
         {
             var inventory = await client.Inventory.GetInventory();
@@ -1103,7 +1111,7 @@ namespace PokemonGo.RocketAPI.Window
             else

                 await Task.Delay(ClientSettings.LevelTimeInterval * 1000);
-           // PrintLevel(client);
+            // PrintLevel(client);
         }

         // Pulled from NecronomiconCoding
@@ -1163,82 +1171,121 @@ namespace PokemonGo.RocketAPI.Window
             {
                 case 1:
                     return 0;
+
                 case 2:
                     return 1000;
+
                 case 3:
                     return 2000;
+
                 case 4:
                     return 3000;
+
                 case 5:
                     return 4000;
+
                 case 6:
                     return 5000;
+
                 case 7:
                     return 6000;
+
                 case 8:
                     return 7000;
+
                 case 9:
                     return 8000;
+
                 case 10:
                     return 9000;
+
                 case 11:
                     return 10000;
+
                 case 12:
                     return 10000;
+
                 case 13:
                     return 10000;
+
                 case 14:
                     return 10000;
+
                 case 15:
                     return 15000;
+
                 case 16:
                     return 20000;
+
                 case 17:
                     return 20000;
+
                 case 18:
                     return 20000;
+
                 case 19:
                     return 25000;
+
                 case 20:
                     return 25000;
+
                 case 21:
                     return 50000;
+
                 case 22:
                     return 75000;
+
                 case 23:
                     return 100000;
+
                 case 24:
                     return 125000;
+
                 case 25:
                     return 150000;
+
                 case 26:
                     return 190000;
+
                 case 27:
                     return 200000;
+
                 case 28:
                     return 250000;
+
                 case 29:
                     return 300000;
+
                 case 30:
                     return 350000;
+
                 case 31:
                     return 500000;
+
                 case 32:
                     return 500000;
+
                 case 33:
                     return 750000;
+
                 case 34:
                     return 1000000;
+
                 case 35:
                     return 1250000;
+
                 case 36:
                     return 1500000;
+
                 case 37:
                     return 2000000;
+
                 case 38:
                     return 2500000;
+
                 case 39:
                     return 1000000;
+
                 case 40:
                     return 1000000;
             }
@@ -1320,6 +1367,7 @@ namespace PokemonGo.RocketAPI.Window
                 case ConsoleColor.Green:
                     c = Color.Green;
                     break;
+
                 case ConsoleColor.DarkCyan:
                     c = Color.DarkCyan;
                     break;
@@ -1477,14 +1525,17 @@ namespace PokemonGo.RocketAPI.Window
                     item.Text = "Evolve Clean Up (Highest CP)";
                     item.Click += delegate { CleanUpEvolvePokemon(pokemonObject, "CP"); };
                     cmsPokemonList.Items.Add(item);
-
+
                     cmsPokemonList.Items.Add(separator);

                     item = new ToolStripMenuItem();
                     item.Text = "Rename";
-                    item.Click += delegate (object obj, EventArgs args) {
-                        using (var form = new NicknamePokemonForm(pokemonObject)) {
-                            if (form.ShowDialog() == DialogResult.OK) {
+                    item.Click += delegate (object obj, EventArgs args)
+                    {
+                        using (var form = new NicknamePokemonForm(pokemonObject))
+                        {
+                            if (form.ShowDialog() == DialogResult.OK)
+                            {
                                 NicknamePokemon(pokemonObject, form.txtNickname.Text);
                             }
                         }
@@ -1567,7 +1618,8 @@ namespace PokemonGo.RocketAPI.Window
                     .Sum(i => i.Count) + 1;

                 flpItems.Controls.Clear();
-                foreach (ItemData item in items) {
+                foreach (ItemData item in items)
+                {
                     ItemBox box = new ItemBox(item);
                     box.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom;
                     box.ItemClick += ItemBox_ItemClick; ;
@@ -1575,7 +1627,6 @@ namespace PokemonGo.RocketAPI.Window
                 }

                 lblInventory.Text = itemscount + " / " + profile.PlayerData.MaxItemStorage;
-
             }
             catch (GoogleException ex)
             {
@@ -1598,38 +1649,56 @@ namespace PokemonGo.RocketAPI.Window
             SetState(true);
         }

-        private async void ItemBox_ItemClick(object sender, EventArgs e) {
+        private async void ItemBox_ItemClick(object sender, EventArgs e)
+        {
             ItemData item = (ItemData)sender;

-            using (var form = new ItemForm(item)) {
+            using (var form = new ItemForm(item))
+            {
                 var result = form.ShowDialog();
-                if (result == DialogResult.OK) {
+                if (result == DialogResult.OK)
+                {
                     SetState(false);
-                    if (item.ItemId == ItemId.ItemLuckyEgg) {
-                        if (!_botStarted) {
+                    if (item.ItemId == ItemId.ItemLuckyEgg)
+                    {
+                        if (!_botStarted)
+                        {
                             ColoredConsoleWrite(Color.Red, $"Bot must be running first!");
                             SetState(true);
                             return;
                         }

                         var response = await _client.Inventory.UseItemXpBoost();
-                        if (response.Result == UseItemXpBoostResponse.Types.Result.Success) {
+                        if (response.Result == UseItemXpBoostResponse.Types.Result.Success)
+                        {
                             ColoredConsoleWrite(Color.Green, $"Using a Lucky Egg");
                             ColoredConsoleWrite(Color.Yellow, $"Lucky Egg Valid until: {DateTime.Now.AddMinutes(30)}");
-                        } else if (response.Result == UseItemXpBoostResponse.Types.Result.ErrorXpBoostAlreadyActive) {
+                        }
+                        else if (response.Result == UseItemXpBoostResponse.Types.Result.ErrorXpBoostAlreadyActive)
+                        {
                             ColoredConsoleWrite(Color.Orange, $"A Lucky Egg is already active!");
-                        } else if (response.Result == UseItemXpBoostResponse.Types.Result.ErrorLocationUnset) {
+                        }
+                        else if (response.Result == UseItemXpBoostResponse.Types.Result.ErrorLocationUnset)
+                        {
                             ColoredConsoleWrite(Color.Red, $"Bot must be running first!");
-                        } else {
+                        }
+                        else
+                        {
                             ColoredConsoleWrite(Color.Red, $"Failed using a Lucky Egg!");
                         }
-                    } else if (item.ItemId == ItemId.ItemIncenseOrdinary) {
-
-                    } else {
+                    }
+                    else if (item.ItemId == ItemId.ItemIncenseOrdinary)
+                    {
+                    }
+                    else
+                    {
                         var response = await _client2.Inventory.RecycleItem(item.ItemId, Decimal.ToInt32(form.numCount.Value));
-                        if (response.Result == RecycleInventoryItemResponse.Types.Result.Success) {
+                        if (response.Result == RecycleInventoryItemResponse.Types.Result.Success)
+                        {
                             ColoredConsoleWrite(Color.DarkCyan, $"Recycled {Decimal.ToInt32(form.numCount.Value)}x {item.ItemId.ToString().Substring(4)}");
-                        } else {
+                        }
+                        else
+                        {
                             ColoredConsoleWrite(Color.Red, $"Unable to recycle {Decimal.ToInt32(form.numCount.Value)}x {item.ItemId.ToString().Substring(4)}");
                         }
                     }
@@ -1721,6 +1790,55 @@ namespace PokemonGo.RocketAPI.Window
             ReloadPokemonList();
         }

+        private async Task UseIncubators(Client client)
+        {
+            var profile = (await GetProfile(client)).FirstOrDefault();
+
+            if (profile == null)
+                return;
+
+            var kmWalked = profile.KmWalked;
+
+            var unusedEggs = (await getUnusedEggs(client))
+                .Where(x => string.IsNullOrEmpty(x.EggIncubatorId))
+                .OrderBy(x => x.EggKmWalkedTarget - x.EggKmWalkedStart)
+                .ToList();
+            var incubators = (await getUnusedIncubators(client))
+                .Where(x => x.UsesRemaining > 0 || x.ItemId == ItemId.ItemIncubatorBasicUnlimited)
+                .OrderByDescending(x => x.ItemId == ItemId.ItemIncubatorBasicUnlimited)
+                .OrderByDescending(x => x.PokemonId != 0)
+                .ToList();
+
+            var num = 1;
+
+            foreach (var inc in incubators)
+            {
+                var usesLeft = (inc.ItemId == ItemId.ItemIncubatorBasicUnlimited) ?
+                "∞" : inc.UsesRemaining.ToString();
+                if (inc.PokemonId == 0)
+                {
+                    var egg = (inc.ItemId == ItemId.ItemIncubatorBasicUnlimited && incubators.Count > 1)
+                    ? unusedEggs.FirstOrDefault()
+                    : unusedEggs.LastOrDefault();
+
+                    if (egg == null)
+                        continue;
+
+                    var useIncubator = await client.Inventory.UseItemEggIncubator(inc.Id, egg.Id);
+                    unusedEggs.Remove(egg);
+                    var eggKm = egg.EggKmWalkedTarget;
+                    ColoredConsoleWrite(Color.YellowGreen, $"Incubator #{num} was successfully used on a {eggKm}km egg, Incubator uses left: {usesLeft}");
+                }
+                else
+                {
+                    var remainingDistance = String.Format("{0:0.00}", (inc.TargetKmWalked - kmWalked));
+                    var eggKm = inc.TargetKmWalked - inc.StartKmWalked;
+                    ColoredConsoleWrite(Color.YellowGreen, $"[Status] Incubator #{num}, Uses left: {usesLeft}, Distance left: {remainingDistance}/{eggKm} km");
+                }
+                num++;
+            }
+        }
+
         private void CleanUpTransferPokemon(PokemonObject pokemon, string type)
         {
             var ET = pokemon.EvolveTimes;
@@ -1808,6 +1926,33 @@ namespace PokemonGo.RocketAPI.Window
                 .Where(p => p != null);
         }

+        private async Task<IEnumerable<EggIncubator>> getUnusedIncubators(Client client)
+        {
+            var inventory = await client.Inventory.GetInventory();
+            return inventory.InventoryDelta.InventoryItems.
+            Where(x => x.InventoryItemData?.EggIncubators != null).
+            SelectMany(x => x.InventoryItemData.EggIncubators.EggIncubator).
+            Where(x => x != null);
+        }
+
+        private async Task<IEnumerable<PokemonData>> getUnusedEggs(Client client)
+        {
+            var inventory = await client.Inventory.GetInventory();
+            return inventory.InventoryDelta.InventoryItems.
+            Select(i => i.InventoryItemData?.PokemonData).
+            Where(p => p != null && p.IsEgg).ToList().
+            Where(x => string.IsNullOrEmpty(x.EggIncubatorId)).
+            OrderBy(x => x.EggKmWalkedTarget - x.EggKmWalkedStart);
+        }
+
+        private async Task<IEnumerable<PlayerStats>> GetProfile(Client client)
+        {
+            var inventory = await client.Inventory.GetInventory();
+            return inventory.InventoryDelta.InventoryItems
+                .Select(i => i.InventoryItemData?.PlayerStats)
+                .Where(p => p != null);
+        }
+
         public async Task<IEnumerable<ItemData>> GetItemsToRecycle(ISettings _settings, Client client)
         {
             var settings = (Settings)_settings;
@@ -1927,12 +2072,16 @@ namespace PokemonGo.RocketAPI.Window
             return ItemId.ItemPokeBall;
         }

-        public async void NicknamePokemon(PokemonObject pokemon, string nickname) {
+        public async void NicknamePokemon(PokemonObject pokemon, string nickname)
+        {
             SetState(false);
             var response = await _client2.Inventory.NicknamePokemon(pokemon.Id, nickname);
-            if (response.Result == NicknamePokemonResponse.Types.Result.Success) {
+            if (response.Result == NicknamePokemonResponse.Types.Result.Success)
+            {
                 ColoredConsoleWrite(Color.Green, $"Successfully renamed {pokemon.PokemonId.ToString()} to \"{nickname}|\"");
-            } else {
+            }
+            else
+            {
                 ColoredConsoleWrite(Color.Red, $"Failed renaming {pokemon.PokemonId.ToString()} to \"{nickname}|\"");
             }
             ReloadPokemonList();
@@ -1943,6 +2092,6 @@ namespace PokemonGo.RocketAPI.Window
             await ReloadPokemonList();
         }

-        #endregion
+        #endregion POKEMON LIST
     }
 }
\ No newline at end of file
diff --git a/PokemonGo/RocketAPI/Window/Settings.cs b/PokemonGo/RocketAPI/Window/Settings.cs
index 2d40e62..bce268c 100644
--- a/PokemonGo/RocketAPI/Window/Settings.cs
+++ b/PokemonGo/RocketAPI/Window/Settings.cs
@@ -58,6 +58,9 @@ namespace PokemonGo.RocketAPI.Window
         public bool CatchPokemon
             => GetSetting() != string.Empty && Convert.ToBoolean(GetSetting(), CultureInfo.InvariantCulture);

+        public bool UseIncubators
+            => GetSetting() != string.Empty && Convert.ToBoolean(GetSetting(), CultureInfo.InvariantCulture);
+
         public string PtcUsername => GetSetting() != string.Empty ? GetSetting() : "username";
         public string PtcPassword => GetSetting() != string.Empty ? GetSetting() : "password";

diff --git a/PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs b/PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs
index a0275de..bdf9cdb 100644
--- a/PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs
+++ b/PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs
@@ -56,6 +56,8 @@ namespace PokemonGo.RocketAPI.Window
             this.AdressBox = new System.Windows.Forms.TextBox();
             this.trackBar = new System.Windows.Forms.TrackBar();
             this.panel1 = new System.Windows.Forms.Panel();
+            this.useIncubatorChk = new System.Windows.Forms.CheckBox();
+            this.UseIncubatorsText = new System.Windows.Forms.Label();
             this.TravelSpeedBox = new System.Windows.Forms.TextBox();
             this.CatchPokemonBox = new System.Windows.Forms.CheckBox();
             this.CatchPokemonText = new System.Windows.Forms.Label();
@@ -129,7 +131,7 @@ namespace PokemonGo.RocketAPI.Window
             // label1
             //
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(3, 161);
+            this.label1.Location = new System.Drawing.Point(3, 200);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(100, 15);
             this.label1.TabIndex = 6;
@@ -138,7 +140,7 @@ namespace PokemonGo.RocketAPI.Window
             // label2
             //
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(3, 222);
+            this.label2.Location = new System.Drawing.Point(3, 270);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(84, 15);
             this.label2.TabIndex = 7;
@@ -147,7 +149,7 @@ namespace PokemonGo.RocketAPI.Window
             // label3
             //
             this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(3, 370);
+            this.label3.Location = new System.Drawing.Point(3, 375);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(101, 15);
             this.label3.TabIndex = 8;
@@ -157,7 +159,7 @@ namespace PokemonGo.RocketAPI.Window
             // label4
             //
             this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(3, 254);
+            this.label4.Location = new System.Drawing.Point(3, 301);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(84, 15);
             this.label4.TabIndex = 9;
@@ -166,7 +168,7 @@ namespace PokemonGo.RocketAPI.Window
             // label5
             //
             this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(3, 192);
+            this.label5.Location = new System.Drawing.Point(3, 230);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(106, 15);
             this.label5.TabIndex = 10;
@@ -212,7 +214,7 @@ namespace PokemonGo.RocketAPI.Window
             this.razzmodeCb.Items.AddRange(new object[] {
             "probability",
             "cp"});
-            this.razzmodeCb.Location = new System.Drawing.Point(138, 159);
+            this.razzmodeCb.Location = new System.Drawing.Point(138, 200);
             this.razzmodeCb.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.razzmodeCb.Name = "razzmodeCb";
             this.razzmodeCb.Size = new System.Drawing.Size(116, 23);
@@ -220,7 +222,7 @@ namespace PokemonGo.RocketAPI.Window
             //
             // razzSettingText
             //
-            this.razzSettingText.Location = new System.Drawing.Point(138, 190);
+            this.razzSettingText.Location = new System.Drawing.Point(138, 230);
             this.razzSettingText.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.razzSettingText.Name = "razzSettingText";
             this.razzSettingText.Size = new System.Drawing.Size(116, 21);
@@ -238,7 +240,7 @@ namespace PokemonGo.RocketAPI.Window
             "Duplicate",
             "IV Duplicate",
             "All"});
-            this.transferTypeCb.Location = new System.Drawing.Point(138, 220);
+            this.transferTypeCb.Location = new System.Drawing.Point(138, 270);
             this.transferTypeCb.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.transferTypeCb.Name = "transferTypeCb";
             this.transferTypeCb.Size = new System.Drawing.Size(116, 23);
@@ -247,7 +249,7 @@ namespace PokemonGo.RocketAPI.Window
             //
             // transferCpThresText
             //
-            this.transferCpThresText.Location = new System.Drawing.Point(138, 252);
+            this.transferCpThresText.Location = new System.Drawing.Point(138, 301);
             this.transferCpThresText.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.transferCpThresText.Name = "transferCpThresText";
             this.transferCpThresText.Size = new System.Drawing.Size(116, 21);
@@ -257,7 +259,7 @@ namespace PokemonGo.RocketAPI.Window
             // evolveAllChk
             //
             this.evolveAllChk.AutoSize = true;
-            this.evolveAllChk.Location = new System.Drawing.Point(138, 370);
+            this.evolveAllChk.Location = new System.Drawing.Point(138, 377);
             this.evolveAllChk.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.evolveAllChk.Name = "evolveAllChk";
             this.evolveAllChk.Size = new System.Drawing.Size(15, 14);
@@ -269,7 +271,7 @@ namespace PokemonGo.RocketAPI.Window
             //
             this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.saveBtn.Location = new System.Drawing.Point(0, 394);
+            this.saveBtn.Location = new System.Drawing.Point(0, 461);
             this.saveBtn.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.saveBtn.Name = "saveBtn";
             this.saveBtn.Size = new System.Drawing.Size(254, 110);
@@ -318,7 +320,7 @@ namespace PokemonGo.RocketAPI.Window
             this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.groupBox1.Name = "groupBox1";
             this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
-            this.groupBox1.Size = new System.Drawing.Size(561, 510);
+            this.groupBox1.Size = new System.Drawing.Size(568, 577);
             this.groupBox1.TabIndex = 25;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "Location";
@@ -327,10 +329,10 @@ namespace PokemonGo.RocketAPI.Window
             //
             this.FindAdressButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.FindAdressButton.Location = new System.Drawing.Point(414, 474);
+            this.FindAdressButton.Location = new System.Drawing.Point(414, 541);
             this.FindAdressButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.FindAdressButton.Name = "FindAdressButton";
-            this.FindAdressButton.Size = new System.Drawing.Size(140, 30);
+            this.FindAdressButton.Size = new System.Drawing.Size(147, 30);
             this.FindAdressButton.TabIndex = 25;
             this.FindAdressButton.Text = "Find Location";
             this.FindAdressButton.UseVisualStyleBackColor = true;
@@ -352,7 +354,7 @@ namespace PokemonGo.RocketAPI.Window
             //
             this.trackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.trackBar.BackColor = System.Drawing.SystemColors.Info;
-            this.trackBar.Location = new System.Drawing.Point(505, 19);
+            this.trackBar.Location = new System.Drawing.Point(512, 19);
             this.trackBar.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.trackBar.Name = "trackBar";
             this.trackBar.Orientation = System.Windows.Forms.Orientation.Vertical;
@@ -363,6 +365,8 @@ namespace PokemonGo.RocketAPI.Window
             //
             // panel1
             //
+            this.panel1.Controls.Add(this.useIncubatorChk);
+            this.panel1.Controls.Add(this.UseIncubatorsText);
             this.panel1.Controls.Add(this.TravelSpeedBox);
             this.panel1.Controls.Add(this.CatchPokemonBox);
             this.panel1.Controls.Add(this.CatchPokemonText);
@@ -394,13 +398,34 @@ namespace PokemonGo.RocketAPI.Window
             this.panel1.Location = new System.Drawing.Point(10, 10);
             this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(261, 510);
+            this.panel1.Size = new System.Drawing.Size(261, 577);
             this.panel1.TabIndex = 26;
             this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
             //
+            // useIncubatorChk
+            //
+            this.useIncubatorChk.AutoSize = true;
+            this.useIncubatorChk.Location = new System.Drawing.Point(138, 406);
+            this.useIncubatorChk.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.useIncubatorChk.Name = "useIncubatorChk";
+            this.useIncubatorChk.Size = new System.Drawing.Size(15, 14);
+            this.useIncubatorChk.TabIndex = 28;
+            this.useIncubatorChk.UseVisualStyleBackColor = true;
+            this.useIncubatorChk.CheckedChanged += new System.EventHandler(this.useIncubatorChk_CheckedChanged);
+            //
+            // UseIncubatorsText
+            //
+            this.UseIncubatorsText.AutoSize = true;
+            this.UseIncubatorsText.Location = new System.Drawing.Point(3, 405);
+            this.UseIncubatorsText.Name = "UseIncubatorsText";
+            this.UseIncubatorsText.Size = new System.Drawing.Size(92, 15);
+            this.UseIncubatorsText.TabIndex = 27;
+            this.UseIncubatorsText.Text = "Use Incubators:";
+            this.UseIncubatorsText.Click += new System.EventHandler(this.UseIncubatorsText_Click);
+            //
             // TravelSpeedBox
             //
-            this.TravelSpeedBox.Location = new System.Drawing.Point(138, 314);
+            this.TravelSpeedBox.Location = new System.Drawing.Point(138, 158);
             this.TravelSpeedBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.TravelSpeedBox.Name = "TravelSpeedBox";
             this.TravelSpeedBox.Size = new System.Drawing.Size(116, 21);
@@ -411,7 +436,7 @@ namespace PokemonGo.RocketAPI.Window
             // CatchPokemonBox
             //
             this.CatchPokemonBox.AutoSize = true;
-            this.CatchPokemonBox.Location = new System.Drawing.Point(138, 344);
+            this.CatchPokemonBox.Location = new System.Drawing.Point(138, 346);
             this.CatchPokemonBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.CatchPokemonBox.Name = "CatchPokemonBox";
             this.CatchPokemonBox.Size = new System.Drawing.Size(15, 14);
@@ -422,7 +447,7 @@ namespace PokemonGo.RocketAPI.Window
             // CatchPokemonText
             //
             this.CatchPokemonText.AutoSize = true;
-            this.CatchPokemonText.Location = new System.Drawing.Point(3, 344);
+            this.CatchPokemonText.Location = new System.Drawing.Point(3, 345);
             this.CatchPokemonText.Name = "CatchPokemonText";
             this.CatchPokemonText.Size = new System.Drawing.Size(97, 15);
             this.CatchPokemonText.TabIndex = 25;
@@ -431,7 +456,7 @@ namespace PokemonGo.RocketAPI.Window
             //
             // transferIVThresText
             //
-            this.transferIVThresText.Location = new System.Drawing.Point(138, 254);
+            this.transferIVThresText.Location = new System.Drawing.Point(138, 300);
             this.transferIVThresText.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.transferIVThresText.Name = "transferIVThresText";
             this.transferIVThresText.Size = new System.Drawing.Size(116, 21);
@@ -441,7 +466,7 @@ namespace PokemonGo.RocketAPI.Window
             // TravelSpeedText
             //
             this.TravelSpeedText.AutoSize = true;
-            this.TravelSpeedText.Location = new System.Drawing.Point(3, 318);
+            this.TravelSpeedText.Location = new System.Drawing.Point(3, 158);
             this.TravelSpeedText.Name = "TravelSpeedText";
             this.TravelSpeedText.Size = new System.Drawing.Size(112, 15);
             this.TravelSpeedText.TabIndex = 23;
@@ -450,7 +475,7 @@ namespace PokemonGo.RocketAPI.Window
             // label6
             //
             this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(3, 254);
+            this.label6.Location = new System.Drawing.Point(3, 300);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(78, 15);
             this.label6.TabIndex = 21;
@@ -461,7 +486,7 @@ namespace PokemonGo.RocketAPI.Window
             //
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(842, 530);
+            this.ClientSize = new System.Drawing.Size(849, 597);
             this.Controls.Add(this.groupBox1);
             this.Controls.Add(this.panel1);
             this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
@@ -469,7 +494,7 @@ namespace PokemonGo.RocketAPI.Window
             this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.MinimumSize = new System.Drawing.Size(732, 408);
             this.Name = "SettingsForm";
-            this.Padding = new System.Windows.Forms.Padding(10, 10, 10, 10);
+            this.Padding = new System.Windows.Forms.Padding(10);
             this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "Settings";
@@ -518,5 +543,7 @@ namespace PokemonGo.RocketAPI.Window
         private System.Windows.Forms.Button FindAdressButton;
         private System.Windows.Forms.CheckBox CatchPokemonBox;
         private System.Windows.Forms.Label CatchPokemonText;
+        private System.Windows.Forms.Label UseIncubatorsText;
+        private System.Windows.Forms.CheckBox useIncubatorChk;
     }
 }
diff --git a/PokemonGo/RocketAPI/Window/SettingsForm.cs b/PokemonGo/RocketAPI/Window/SettingsForm.cs
index 85e8b14..764cb58 100644
--- a/PokemonGo/RocketAPI/Window/SettingsForm.cs
+++ b/PokemonGo/RocketAPI/Window/SettingsForm.cs
@@ -36,6 +36,7 @@ namespace PokemonGo.RocketAPI.Window
             transferCpThresText.Text = Settings.Instance.TransferCpThreshold.ToString();
             transferIVThresText.Text = Settings.Instance.TransferIvThreshold.ToString();
             evolveAllChk.Checked = Settings.Instance.EvolveAllGivenPokemons;
+            useIncubatorChk.Checked = Settings.Instance.UseIncubators;
             CatchPokemonBox.Checked = Settings.Instance.CatchPokemon;
             TravelSpeedBox.Text = Settings.Instance.TravelSpeed.ToString();
             // ImageSizeBox.Text = Settings.Instance.ImageSize.ToString();
@@ -100,6 +101,7 @@ namespace PokemonGo.RocketAPI.Window
             Settings.Instance.SetSetting(TravelSpeedBox.Text, "TravelSpeed");
             //Settings.Instance.SetSetting(ImageSizeBox.Text, "ImageSize");
             Settings.Instance.SetSetting(evolveAllChk.Checked ? "true" : "false", "EvolveAllGivenPokemons");
+            Settings.Instance.SetSetting(useIncubatorChk.Checked ? "true" : "false", "UseIncubators");
             Settings.Instance.SetSetting(CatchPokemonBox.Checked ? "true" : "false", "CatchPokemon");
             Settings.Instance.Reload();

@@ -221,6 +223,14 @@ namespace PokemonGo.RocketAPI.Window
         {
         }

+        private void UseIncubatorsText_Click(object sender, EventArgs e)
+        {
+        }
+
+        private void useIncubatorChk_CheckedChanged(object sender, EventArgs e)
+        {
+        }
+
         private void label7_Click(object sender, EventArgs e)
         {
         }
@@ -264,7 +274,5 @@ namespace PokemonGo.RocketAPI.Window
                 AdressBox.ForeColor = SystemColors.WindowText;
             }
         }
-
-
     }
 }
\ No newline at end of file
You may download the files in Public Git.