Added a button for force unban

Brian [2016-07-27 15:36:46]
Added a button for force unban

Added a button for force unban.
Now if you got soft banned, this button can unban you in 10 seconds! :D
Filename
PokemonGo/RocketAPI/Console/App.config
PokemonGo/RocketAPI/Window/MainForm.Designer.cs
PokemonGo/RocketAPI/Window/MainForm.cs
diff --git a/PokemonGo/RocketAPI/Console/App.config b/PokemonGo/RocketAPI/Console/App.config
index d7cfe10..98a593f 100644
--- a/PokemonGo/RocketAPI/Console/App.config
+++ b/PokemonGo/RocketAPI/Console/App.config
@@ -12,12 +12,12 @@
     </assemblyBinding>
   </runtime>
   <appSettings>
-    <add key="AuthType" value="Ptc" /> <!--Google/Ptc-->
+    <add key="AuthType" value="Google" /> <!--Google/Ptc-->
     <add key="PtcUsername" value="username" /> <!--Username-->
     <add key="PtcPassword" value="pw" /> <!--Password-->
     <add key="GoogleRefreshToken" value="" />
-    <add key="DefaultLatitude" value="-36.842887" /> <!--Default Viaduct Harbour, Auckland, New Zealand-->
-    <add key="DefaultLongitude" value="174.766365" /> <!--Default Viaduct Harbour, Auckland, New Zealand-->
+    <add key="DefaultLatitude" value="45.030152" /> <!--Default Viaduct Harbour, Auckland, New Zealand-->
+    <add key="DefaultLongitude" value="-93.31931" /> <!--Default Viaduct Harbour, Auckland, New Zealand-->
     <add key="LevelOutput" value="levelup" /> <!--2 Modes: "time": Every XXX seconds and "levelup" every levelup-->
     <add key="LevelTimeInterval" value="1" /> <!--Pick 1 if levelup and time in seconds if "time"-->
     <add key="Recycler" value="true" /> <!--Recycler master switch-->
@@ -28,7 +28,7 @@
     <add key="TransferType" value="duplicate" /> <!--none/cp/iv/leaveStrongest/duplicate/all Whitelists/blackslists for each type is in Program.cs-->
     <add key="TransferCPThreshold" value="0" /> <!--transfer pokemon with CP less than this value if cp transfer type is selected. Whitelist in Program.cs-->
     <add key="TransferIVThreshold" value="80" /> <!--transfer pokemon with IV less than this value if iv transfer type is selected. Whitelist in Program.cs-->
-    <add key="EvolveAllGivenPokemons" value="false" />
+    <add key="EvolveAllGivenPokemons" value="true" />
     <add key="ClientSettingsProvider.ServiceUri" value="" />
   </appSettings>
   <system.web>
diff --git a/PokemonGo/RocketAPI/Window/MainForm.Designer.cs b/PokemonGo/RocketAPI/Window/MainForm.Designer.cs
index ab35a33..40f3347 100644
--- a/PokemonGo/RocketAPI/Window/MainForm.Designer.cs
+++ b/PokemonGo/RocketAPI/Window/MainForm.Designer.cs
@@ -43,6 +43,7 @@
             this.useLuckyEggToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.showAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.showAllToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+            this.forceUnbanToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.statusStrip1.SuspendLayout();
             this.menuStrip1.SuspendLayout();
             this.SuspendLayout();
@@ -53,9 +54,9 @@
             this.logTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
             this.logTextBox.Font = new System.Drawing.Font("Consolas", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.logTextBox.ForeColor = System.Drawing.Color.White;
-            this.logTextBox.Location = new System.Drawing.Point(0, 24);
+            this.logTextBox.Location = new System.Drawing.Point(0, 25);
             this.logTextBox.Name = "logTextBox";
-            this.logTextBox.Size = new System.Drawing.Size(905, 471);
+            this.logTextBox.Size = new System.Drawing.Size(905, 430);
             this.logTextBox.TabIndex = 0;
             this.logTextBox.Text = "";
             this.logTextBox.TextChanged += new System.EventHandler(this.logTextBox_TextChanged);
@@ -64,7 +65,7 @@
             //
             this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.statusLabel});
-            this.statusStrip1.Location = new System.Drawing.Point(0, 495);
+            this.statusStrip1.Location = new System.Drawing.Point(0, 455);
             this.statusStrip1.Name = "statusStrip1";
             this.statusStrip1.Size = new System.Drawing.Size(905, 22);
             this.statusStrip1.TabIndex = 1;
@@ -73,7 +74,7 @@
             // statusLabel
             //
             this.statusLabel.Name = "statusLabel";
-            this.statusLabel.Size = new System.Drawing.Size(39, 17);
+            this.statusLabel.Size = new System.Drawing.Size(43, 17);
             this.statusLabel.Text = "Status";
             //
             // menuStrip1
@@ -82,10 +83,11 @@
             this.todoToolStripMenuItem,
             this.startBotToolStripMenuItem,
             this.pokemonToolStripMenuItem2,
-            this.useLuckyEggToolStripMenuItem});
+            this.useLuckyEggToolStripMenuItem,
+            this.forceUnbanToolStripMenuItem});
             this.menuStrip1.Location = new System.Drawing.Point(0, 0);
             this.menuStrip1.Name = "menuStrip1";
-            this.menuStrip1.Size = new System.Drawing.Size(905, 24);
+            this.menuStrip1.Size = new System.Drawing.Size(905, 25);
             this.menuStrip1.TabIndex = 2;
             this.menuStrip1.Text = "menuStrip1";
             //
@@ -94,20 +96,20 @@
             this.todoToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.settingsToolStripMenuItem});
             this.todoToolStripMenuItem.Name = "todoToolStripMenuItem";
-            this.todoToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
+            this.todoToolStripMenuItem.Size = new System.Drawing.Size(40, 21);
             this.todoToolStripMenuItem.Text = "Bot";
             //
             // settingsToolStripMenuItem
             //
             this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
-            this.settingsToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
+            this.settingsToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
             this.settingsToolStripMenuItem.Text = "Settings";
             this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
             //
             // startBotToolStripMenuItem
             //
             this.startBotToolStripMenuItem.Name = "startBotToolStripMenuItem";
-            this.startBotToolStripMenuItem.Size = new System.Drawing.Size(64, 20);
+            this.startBotToolStripMenuItem.Size = new System.Drawing.Size(71, 21);
             this.startBotToolStripMenuItem.Text = "Start bot";
             this.startBotToolStripMenuItem.Click += new System.EventHandler(this.startBotToolStripMenuItem_Click);
             //
@@ -117,7 +119,7 @@
             this.showAllToolStripMenuItem2,
             this.statsToolStripMenuItem});
             this.pokemonToolStripMenuItem2.Name = "pokemonToolStripMenuItem2";
-            this.pokemonToolStripMenuItem2.Size = new System.Drawing.Size(51, 20);
+            this.pokemonToolStripMenuItem2.Size = new System.Drawing.Size(55, 21);
             this.pokemonToolStripMenuItem2.Text = "Player";
             //
             // showAllToolStripMenuItem2
@@ -125,27 +127,27 @@
             this.showAllToolStripMenuItem2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.showAllToolStripMenuItem3});
             this.showAllToolStripMenuItem2.Name = "showAllToolStripMenuItem2";
-            this.showAllToolStripMenuItem2.Size = new System.Drawing.Size(125, 22);
+            this.showAllToolStripMenuItem2.Size = new System.Drawing.Size(131, 22);
             this.showAllToolStripMenuItem2.Text = "Pokemon";
             //
             // showAllToolStripMenuItem3
             //
             this.showAllToolStripMenuItem3.Name = "showAllToolStripMenuItem3";
-            this.showAllToolStripMenuItem3.Size = new System.Drawing.Size(101, 22);
+            this.showAllToolStripMenuItem3.Size = new System.Drawing.Size(105, 22);
             this.showAllToolStripMenuItem3.Text = "Mine";
             this.showAllToolStripMenuItem3.Click += new System.EventHandler(this.showAllToolStripMenuItem3_Click);
             //
             // statsToolStripMenuItem
             //
             this.statsToolStripMenuItem.Name = "statsToolStripMenuItem";
-            this.statsToolStripMenuItem.Size = new System.Drawing.Size(125, 22);
+            this.statsToolStripMenuItem.Size = new System.Drawing.Size(131, 22);
             this.statsToolStripMenuItem.Text = "Stats";
             this.statsToolStripMenuItem.Click += new System.EventHandler(this.statsToolStripMenuItem_Click);
             //
             // useLuckyEggToolStripMenuItem
             //
             this.useLuckyEggToolStripMenuItem.Name = "useLuckyEggToolStripMenuItem";
-            this.useLuckyEggToolStripMenuItem.Size = new System.Drawing.Size(95, 20);
+            this.useLuckyEggToolStripMenuItem.Size = new System.Drawing.Size(105, 21);
             this.useLuckyEggToolStripMenuItem.Text = "Use Lucky Egg";
             this.useLuckyEggToolStripMenuItem.Click += new System.EventHandler(this.useLuckyEggToolStripMenuItem_Click);
             //
@@ -159,11 +161,18 @@
             this.showAllToolStripMenuItem1.Name = "showAllToolStripMenuItem1";
             this.showAllToolStripMenuItem1.Size = new System.Drawing.Size(32, 19);
             //
+            // forceUnbanToolStripMenuItem
+            //
+            this.forceUnbanToolStripMenuItem.Name = "forceUnbanToolStripMenuItem";
+            this.forceUnbanToolStripMenuItem.Size = new System.Drawing.Size(94, 21);
+            this.forceUnbanToolStripMenuItem.Text = "Force Unban";
+            this.forceUnbanToolStripMenuItem.Click += new System.EventHandler(this.forceUnbanToolStripMenuItem_Click);
+            //
             // MainForm
             //
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(905, 517);
+            this.ClientSize = new System.Drawing.Size(905, 477);
             this.Controls.Add(this.logTextBox);
             this.Controls.Add(this.statusStrip1);
             this.Controls.Add(this.menuStrip1);
@@ -197,6 +206,7 @@
         private System.Windows.Forms.ToolStripMenuItem showAllToolStripMenuItem3;
         private System.Windows.Forms.ToolStripMenuItem statsToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem useLuckyEggToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem forceUnbanToolStripMenuItem;
     }
 }

diff --git a/PokemonGo/RocketAPI/Window/MainForm.cs b/PokemonGo/RocketAPI/Window/MainForm.cs
index 9d2d616..a8986e1 100644
--- a/PokemonGo/RocketAPI/Window/MainForm.cs
+++ b/PokemonGo/RocketAPI/Window/MainForm.cs
@@ -31,13 +31,15 @@ namespace PokemonGo.RocketAPI.Window

         private void MainForm_Load(object sender, EventArgs e)
         {
-
+
         }

         public static ISettings ClientSettings;
         private static int Currentlevel = -1;
         private static int TotalExperience = 0;
         private static int TotalPokemon = 0;
+        private static bool ForceUnbanning = false;
+        private static bool Farming = false;
         private static DateTime TimeStarted = DateTime.Now;
         public static DateTime InitSessionDateTime = DateTime.Now;

@@ -180,7 +182,7 @@ namespace PokemonGo.RocketAPI.Window
                         ColoredConsoleWrite(Color.Green, "Attempting to log into Google..");
                         if (ClientSettings.GoogleRefreshToken == "")
                             ColoredConsoleWrite(Color.Green, "Now opening www.Google.com/device and copying the 8 digit code to your clipboard");
-
+
                         await client.DoGoogleLogin();
                         break;
                 }
@@ -253,6 +255,7 @@ namespace PokemonGo.RocketAPI.Window
                 await Task.Delay(5000);
                 PrintLevel(client);
                 await ExecuteFarmingPokestopsAndPokemons(client);
+                // await ForceUnban(client);
                 ColoredConsoleWrite(Color.Red, $"No nearby useful locations found. Please wait 10 seconds.");
                 await Task.Delay(10000);
                 CheckVersion();
@@ -373,6 +376,12 @@ namespace PokemonGo.RocketAPI.Window

             foreach (var pokeStop in pokeStops)
             {
+                while (ForceUnbanning)
+                {
+                    Farming = false;
+                    await Task.Delay(25);
+                }
+                Farming = true;
                 var update = await client.UpdatePlayerLocation(pokeStop.Latitude, pokeStop.Longitude);
                 var fortInfo = await client.GetFort(pokeStop.Id, pokeStop.Latitude, pokeStop.Longitude);
                 var fortSearch = await client.SearchFort(pokeStop.Id, pokeStop.Latitude, pokeStop.Longitude);
@@ -393,9 +402,73 @@ namespace PokemonGo.RocketAPI.Window

                 if (fortSearch.ExperienceAwarded != 0)
                     TotalExperience += (fortSearch.ExperienceAwarded);
+
+                if (ForceUnbanning)
+                {
+                    Farming = false;
+                    break;
+                }
                 await Task.Delay(15000);
-                await ExecuteCatchAllNearbyPokemons(client);
             }
+            Farming = false;
+            await ExecuteCatchAllNearbyPokemons(client);
+        }
+
+        private async Task ForceUnban(Client client)
+        {
+            if (!ForceUnbanning)
+            {
+                ColoredConsoleWrite(Color.LightGreen, "Waiting for last farming action to be complete...");
+                ForceUnbanning = true;
+                while (Farming)
+                {
+                    await Task.Delay(25);
+                }
+                ColoredConsoleWrite(Color.LightGreen, "Starting force unban...");
+
+                var mapObjects = await client.GetMapObjects();
+                var pokeStops = mapObjects.MapCells.SelectMany(i => i.Forts).Where(i => i.Type == FortType.Checkpoint && i.CooldownCompleteTimestampMs < DateTime.UtcNow.ToUnixTime());
+
+                await Task.Delay(10000);
+                bool done = false;
+
+                foreach (var pokeStop in pokeStops)
+                {
+                    var update = await client.UpdatePlayerLocation(pokeStop.Latitude, pokeStop.Longitude);
+                    var fortInfo = await client.GetFort(pokeStop.Id, pokeStop.Latitude, pokeStop.Longitude);
+
+                    if (fortInfo.Name != string.Empty)
+                    {
+                        ColoredConsoleWrite(Color.LightGreen, "Chosen PokeStop " + fortInfo.Name + " for force unban");
+                        for (int i = 1; i <= 50; i++)
+                        {
+                            var fortSearch = await client.SearchFort(pokeStop.Id, pokeStop.Latitude, pokeStop.Longitude);
+                            if (fortSearch.ExperienceAwarded == 0)
+                            {
+                                ColoredConsoleWrite(Color.LightGreen, "Attempt: " + i);
+                            }
+                            else
+                            {
+                                ColoredConsoleWrite(Color.LightGreen, "Fuck yes, you are now unbanned!");
+                                done = true;
+                                break;
+                            }
+                        }
+                    }
+
+                    if (!done)
+                        ColoredConsoleWrite(Color.LightGreen, "Force unban failed, please try again.");
+
+                    ForceUnbanning = false;
+                    break;
+                }
+            }
+            else
+            {
+                ColoredConsoleWrite(Color.Red, "A force unban attempt is in action... Please wait.");
+            }
+
+
         }

         private string GetFriendlyItemsString(IEnumerable<FortSearchResponse.Types.ItemAward> items)
@@ -792,7 +865,7 @@ namespace PokemonGo.RocketAPI.Window
             // todo: add player stats later
         }

-        private async void useLuckyEggToolStripMenuItem_Click(object sender ,EventArgs e)
+        private async void useLuckyEggToolStripMenuItem_Click(object sender, EventArgs e)
         {
             if (client != null)
             {
@@ -806,7 +879,7 @@ namespace PokemonGo.RocketAPI.Window
                         var useItemXpBoostRequest = await client.UseItemXpBoost(ItemId.ItemLuckyEgg);
                         ColoredConsoleWrite(Color.Green, $"Using a Lucky Egg, we have {LuckyEgg.Count} left.");
                         ColoredConsoleWrite(Color.Yellow, $"Lucky Egg Valid until: {DateTime.Now.AddMinutes(30).ToString()}");
-
+
                         var stripItem = sender as ToolStripMenuItem;
                         stripItem.Enabled = false;
                         await Task.Delay(30000);
@@ -827,5 +900,24 @@ namespace PokemonGo.RocketAPI.Window
                 ColoredConsoleWrite(Color.Red, "Please start the bot before trying to use a lucky egg.");
             }
         }
+
+        private async void forceUnbanToolStripMenuItem_Click(object sender, EventArgs e)
+        {
+            if (client != null)
+            {
+                if (ForceUnbanning)
+                {
+                    ColoredConsoleWrite(Color.Red, "A force unban attempt is in action... Please wait.");
+                }
+                else
+                {
+                    await ForceUnban(client);
+                }
+            }
+            else
+            {
+                ColoredConsoleWrite(Color.Red, "Please start the bot before trying to force unban");
+            }
+        }
     }
 }
You may download the files in Public Git.