diff --git a/src/RocketBotGUI/App.config b/src/RocketBotGUI/App.config
index 0c71708..9a4bfcc 100644
--- a/src/RocketBotGUI/App.config
+++ b/src/RocketBotGUI/App.config
@@ -44,7 +44,7 @@
<!--Recycle Interval in seconds-->
<add key="Language" value="english" />
<!--Languages english/german-->
- <add key="RazzBerryMode" value="probability" />
+ <add key="RazzBerryMode" value="Probability" />
<!--When to use RazzBerry cp/probability-->
<add key="RazzBerrySetting" value="0.4" />
<!--Cp Mode: Use RazzBerry when Pokemon is over this value; pobability Mode: Use Razzberry when % between 0 and 1 of catching is under this value-->
@@ -61,6 +61,7 @@
<add key="CatchPokemon" value="true" />
<!--Only visit pokestop and collect items-->
<add key="EvolveAllGivenPokemons" value="false" />
+ <add key="UseIncubatorsMode" value="Disabled" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="MaxItemPokeBall" value="100" />
<add key="MaxItemGreatBall" value="100" />
@@ -92,6 +93,8 @@
<add key="ExcludedPokemonTransfer" value="" />
<!--Pokemon filter, seperated by comma-->
<add key="ExcludedPokemonEvolve" value="" />
+ <!--Item count, format ItemId,MaxCount;ItemId,MaxCount;...etc-->
+ <add key="ItemCounts" value="ItemPokeball,100;ItemGreatBall,100;ItemUltraBall,50;ItemRazzBerry,25;ItemPotion,0;ItemSuperPotion,0;ItemHyperPotion,10;ItemMaxPotion,20;ItemRevive,10;ItemMaxRevive,10" />
</appSettings>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
diff --git a/src/RocketBotGUI/ItemSetting.Designer.cs b/src/RocketBotGUI/ItemSetting.Designer.cs
new file mode 100644
index 0000000..a522ea1
--- /dev/null
+++ b/src/RocketBotGUI/ItemSetting.Designer.cs
@@ -0,0 +1,77 @@
+namespace PokemonGo.RocketAPI.Window {
+ partial class ItemSetting {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent() {
+ this.count = new System.Windows.Forms.NumericUpDown();
+ this.ItemId = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.count)).BeginInit();
+ this.SuspendLayout();
+ //
+ // count
+ //
+ this.count.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.count.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.count.Location = new System.Drawing.Point(132, 0);
+ this.count.Maximum = new decimal(new int[] {
+ 999,
+ 0,
+ 0,
+ 0});
+ this.count.Name = "count";
+ this.count.Size = new System.Drawing.Size(75, 21);
+ this.count.TabIndex = 0;
+ this.count.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+ //
+ // ItemId
+ //
+ this.ItemId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.ItemId.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.ItemId.Location = new System.Drawing.Point(-1, -1);
+ this.ItemId.Name = "ItemId";
+ this.ItemId.Size = new System.Drawing.Size(127, 18);
+ this.ItemId.TabIndex = 1;
+ this.ItemId.Text = "Pokeball";
+ this.ItemId.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // ItemSetting
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.ItemId);
+ this.Controls.Add(this.count);
+ this.Margin = new System.Windows.Forms.Padding(0);
+ this.Name = "ItemSetting";
+ this.Size = new System.Drawing.Size(210, 19);
+ ((System.ComponentModel.ISupportInitialize)(this.count)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.NumericUpDown count;
+ private System.Windows.Forms.Label ItemId;
+ }
+}
diff --git a/src/RocketBotGUI/ItemSetting.cs b/src/RocketBotGUI/ItemSetting.cs
new file mode 100644
index 0000000..d47f6fc
--- /dev/null
+++ b/src/RocketBotGUI/ItemSetting.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using POGOProtos.Inventory.Item;
+
+namespace PokemonGo.RocketAPI.Window {
+ public partial class ItemSetting : UserControl {
+
+ private ItemData itemData_;
+
+ public ItemSetting(ItemData itemData) {
+ InitializeComponent();
+ ItemData = itemData;
+
+ count.ValueChanged += Count_ValueChanged;
+ }
+
+ private void Count_ValueChanged(object sender, EventArgs e) {
+ ItemData.Count = Decimal.ToInt32(count.Value);
+ }
+
+ public ItemData ItemData
+ {
+ get
+ {
+ return itemData_;
+ }
+ set
+ {
+ itemData_ = value;
+ ItemId.Text = itemData_.ItemId.ToString().Remove(0, 4);
+ count.Value = itemData_.Count;
+ }
+ }
+ }
+}
diff --git a/src/RocketBotGUI/ItemSetting.resx b/src/RocketBotGUI/ItemSetting.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/src/RocketBotGUI/ItemSetting.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/src/RocketBotGUI/MainForm.cs b/src/RocketBotGUI/MainForm.cs
index 916fc67..de6b271 100644
--- a/src/RocketBotGUI/MainForm.cs
+++ b/src/RocketBotGUI/MainForm.cs
@@ -1,4 +1,21 @@
-using System;
+using BrightIdeasSoftware;
+using GMap.NET;
+using GMap.NET.MapProviders;
+using GMap.NET.WindowsForms;
+using GMap.NET.WindowsForms.Markers;
+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;
@@ -11,22 +28,6 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;
-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.Enums;
-using POGOProtos.Inventory;
-using POGOProtos.Inventory.Item;
-using POGOProtos.Map.Fort;
-using POGOProtos.Map.Pokemon;
-using POGOProtos.Networking.Responses;
using static System.Reflection.Assembly;
namespace PokemonGo.RocketAPI.Window
@@ -281,6 +282,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;
@@ -393,7 +395,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.
@@ -402,36 +403,57 @@ 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/IV Duplicate":
await TransferDuplicateCPIVPokemon(_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);
//await Task.Delay(5000);
+
+ String incubatorMode = ClientSettings.UseIncubatorsMode.ToLower();
+ switch (incubatorMode)
+ {
+ case "only unlimited":
+ await UseIncubators(_client, incubatorMode);
+ break;
+ case "all incubators":
+ await UseIncubators(_client, incubatorMode);
+ break;
+ default:
+ ColoredConsoleWrite(Color.DarkGray, "Using incubators disabled");
+ break;
+ }
+
await PrintLevel(_client);
await ExecuteFarmingPokestopsAndPokemons(_client);
@@ -499,7 +521,7 @@ namespace PokemonGo.RocketAPI.Window
ColoredConsoleWrite(Color.Red, "Access Token Expired - Restarting");
//if (!_stopping) Execute();
}
- catch (GoogleException ex)
+ catch (GoogleException)
{
ColoredConsoleWrite(Color.Red, "Please check your google login information again");
}
@@ -512,7 +534,6 @@ namespace PokemonGo.RocketAPI.Window
ColoredConsoleWrite(Color.Red, "Invalid response - Restarting");
//if (!_stopping) Execute();
}
-
catch (Exception ex)
{
ColoredConsoleWrite(Color.Red, ex.ToString());
@@ -546,6 +567,7 @@ namespace PokemonGo.RocketAPI.Window
return reader.ReadString();
}
break;
+
default:
return "N/A";
break;
@@ -617,10 +639,10 @@ namespace PokemonGo.RocketAPI.Window
ColoredConsoleWrite(Color.Green, $"Encounter a {pokemonName} with {pokemonCp} CP and {pokemonIv}% IV");
do
{
- if (ClientSettings.RazzBerryMode == "cp")
+ if (ClientSettings.RazzBerryMode.ToLower().Equals("cp"))
if (pokemonCp > ClientSettings.RazzBerrySetting)
await UseRazzBerry(client, pokemon.EncounterId, pokemon.SpawnPointId);
- if (ClientSettings.RazzBerryMode == "probability")
+ if (ClientSettings.RazzBerryMode.ToLower().Equals("probability"))
if (encounterPokemonResponse.CaptureProbability.CaptureProbability_.First() <
ClientSettings.RazzBerrySetting)
await UseRazzBerry(client, pokemon.EncounterId, pokemon.SpawnPointId);
@@ -648,31 +670,37 @@ 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/IV Duplicate":
await TransferDuplicateCPIVPokemon(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;
@@ -721,7 +749,6 @@ namespace PokemonGo.RocketAPI.Window
_pokestopsOverlay.Routes.Clear();
_pokestopsOverlay.Routes.Add(new GMapRoute(routePoint, "Walking Path"));
-
_pokemonsOverlay.Markers.Clear();
if (_wildPokemons != null)
{
@@ -790,9 +817,14 @@ namespace PokemonGo.RocketAPI.Window
if (fortSearch.PokemonDataEgg != null)
PokeStopOutput.Write($", Eggs: {fortSearch.PokemonDataEgg}");
if (GetFriendlyItemsString(fortSearch.ItemsAwarded) != string.Empty)
+ {
PokeStopOutput.Write($", Items: {GetFriendlyItemsString(fortSearch.ItemsAwarded)} ");
+ }
+
ColoredConsoleWrite(Color.Cyan, PokeStopOutput.ToString());
+ await RecycleItems(client);
+
if (fortSearch.ExperienceAwarded != 0)
_totalExperience += fortSearch.ExperienceAwarded;
@@ -802,11 +834,10 @@ namespace PokemonGo.RocketAPI.Window
await ExecuteCatchAllNearbyPokemons(client);
}
_farmingStops = false;
- if (!_forceUnbanning && !_stopping)
+ /*if (!_forceUnbanning && !_stopping)
{
- await RecycleItems(client);
//await ExecuteFarmingPokestopsAndPokemons(client);
- }
+ }*/
}
private async Task ForceUnban(Client client)
@@ -891,7 +922,6 @@ namespace PokemonGo.RocketAPI.Window
.Aggregate((a, b) => $"{a}, {b}");
}
-
private async Task TransferAllButStrongestUnwantedPokemon(Client client)
{
var unwantedPokemonTypes = new List<PokemonId>();
@@ -1150,7 +1180,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();
@@ -1240,82 +1269,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;
}
@@ -1397,6 +1465,7 @@ namespace PokemonGo.RocketAPI.Window
case ConsoleColor.Green:
c = Color.Green;
break;
+
case ConsoleColor.DarkCyan:
c = Color.DarkCyan;
break;
@@ -1654,7 +1723,7 @@ namespace PokemonGo.RocketAPI.Window
lblInventory.Text = itemscount + " / " + profile.PlayerData.MaxItemStorage;
}
- catch (GoogleException ex)
+ catch (GoogleException)
{
ColoredConsoleWrite(Color.Red, "Please check your google login information again");
}
@@ -1842,6 +1911,59 @@ namespace PokemonGo.RocketAPI.Window
ReloadPokemonList();
}
+ private async Task UseIncubators(Client client, String mode)
+ {
+ 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)
+ {
+ if (mode.Equals("only unlimited")
+ && inc.ItemId != ItemId.ItemIncubatorBasicUnlimited)
+ continue;
+
+ 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;
@@ -1929,21 +2051,55 @@ 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 itemCounts = (_settings as Settings).ItemCounts;
var settings = (Settings)_settings;
var myItems = await GetItems(client);
+ var itemsToRecycle = new List<ItemData>();
- return myItems
- .Where(x => settings.ItemRecycleFilter.Any(f => f.Key == x.ItemId && x.Count > f.Value))
- .Select(
- x =>
- new ItemData
- {
- ItemId = x.ItemId,
- Count = x.Count - settings.ItemRecycleFilter.Single(f => f.Key == x.ItemId).Value,
- Unseen = x.Unseen
- });
+ foreach (var itemData in myItems)
+ {
+ foreach (var itemCount in itemCounts)
+ {
+ if (itemData.ItemId == itemCount.ItemId && itemData.Count > itemCount.Count)
+ {
+ var itemToRecycle = new ItemData();
+ itemToRecycle.ItemId = itemData.ItemId;
+ itemToRecycle.Count = itemData.Count - itemCount.Count;
+ itemsToRecycle.Add(itemToRecycle);
+ }
+ }
+ }
+
+ return itemsToRecycle;
}
public async Task RecycleItems(Client client)
@@ -1954,7 +2110,7 @@ namespace PokemonGo.RocketAPI.Window
{
var transfer = await client.Inventory.RecycleItem(item.ItemId, item.Count);
ColoredConsoleWrite(Color.DarkCyan, $"Recycled {item.Count}x {item.ItemId.ToString().Substring(4)}");
- await Task.Delay(500);
+ //await Task.Delay(500);
}
}
@@ -2085,6 +2241,6 @@ namespace PokemonGo.RocketAPI.Window
await ReloadPokemonList();
}
- #endregion
+ #endregion POKEMON LIST
}
}
\ No newline at end of file
diff --git a/src/RocketBotGUI/PokemonGo.RocketBot.csproj b/src/RocketBotGUI/PokemonGo.RocketBot.csproj
index 0cbf4da..b955eaf 100644
--- a/src/RocketBotGUI/PokemonGo.RocketBot.csproj
+++ b/src/RocketBotGUI/PokemonGo.RocketBot.csproj
@@ -92,6 +92,12 @@
<Compile Include="ItemForm.Designer.cs">
<DependentUpon>ItemForm.cs</DependentUpon>
</Compile>
+ <Compile Include="ItemSetting.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="ItemSetting.Designer.cs">
+ <DependentUpon>ItemSetting.cs</DependentUpon>
+ </Compile>
<Compile Include="LocationManager.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
@@ -117,6 +123,9 @@
<Compile Include="SettingsForm.Designer.cs">
<DependentUpon>SettingsForm.cs</DependentUpon>
</Compile>
+ <EmbeddedResource Include="ItemSetting.resx">
+ <DependentUpon>ItemSetting.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
diff --git a/src/RocketBotGUI/Settings.cs b/src/RocketBotGUI/Settings.cs
index 07d044c..1826284 100644
--- a/src/RocketBotGUI/Settings.cs
+++ b/src/RocketBotGUI/Settings.cs
@@ -1,14 +1,14 @@
#region
+using POGOProtos.Enums;
+using POGOProtos.Inventory.Item;
+using PokemonGo.RocketAPI.Enums;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Threading;
-using PokemonGo.RocketAPI.Enums;
-using POGOProtos.Enums;
-using POGOProtos.Inventory.Item;
#endregion
@@ -62,7 +62,6 @@ namespace PokemonGo.RocketAPI.Window
public string PtcUsername => GetSetting() != string.Empty ? GetSetting() : "username";
public string PtcPassword => GetSetting() != string.Empty ? GetSetting() : "password";
-
public string LevelOutput => GetSetting() != string.Empty ? GetSetting() : "time";
public int LevelTimeInterval => GetSetting() != string.Empty ? Convert.ToInt16(GetSetting()) : 600;
@@ -118,11 +117,60 @@ namespace PokemonGo.RocketAPI.Window
public string Language => GetSetting() != string.Empty ? GetSetting() : "english";
- public string RazzBerryMode => GetSetting() != string.Empty ? GetSetting() : "cp";
+ public string RazzBerryMode => GetSetting() != string.Empty ? GetSetting() : "CP";
+
+ public string UseIncubatorsMode => GetSetting() != string.Empty ? GetSetting() : "Disabled";
public double RazzBerrySetting
=> GetSetting() != string.Empty ? double.Parse(GetSetting(), CultureInfo.InvariantCulture) : 500;
+ public List<ItemData> ItemCounts
+ {
+ get
+ {
+ var itemCounts = new List<ItemData>();
+ var items = GetSetting() != String.Empty ? GetSetting() :
+ "ItemPokeball,100;ItemGreatBall,100;ItemUltraBall,50;ItemRazzBerry,25;ItemPotion,0;ItemSuperPotion,0;ItemHyperPotion,10;ItemMaxPotion,20;ItemRevive,10;ItemMaxRevive,10";
+ if (items.Contains(";"))
+ {
+ foreach (var item in items.Split(';'))
+ {
+ if (item.Contains(","))
+ {
+ var itemId = item.Split(',')[0];
+ var count = Int32.Parse(item.Split(',')[1]);
+ foreach (ItemId id in Enum.GetValues(typeof(ItemId)))
+ {
+ if (id.ToString().Equals(itemId))
+ {
+ ItemData itemData = new ItemData();
+ itemData.ItemId = id;
+ itemData.Count = count;
+ itemCounts.Add(itemData);
+ break;
+ }
+ }
+ }
+ }
+ }
+ return itemCounts;
+ }
+
+ set
+ {
+ var items = "";
+ foreach (var itemData in value)
+ {
+ items += itemData.ItemId.ToString() + "," + itemData.Count + ";";
+ }
+ if (items != string.Empty)
+ {
+ items = items.Remove(items.Length - 1, 1);
+ }
+ SetSetting(items);
+ }
+ }
+
public List<PokemonId> ExcludedPokemonCatch
{
get
@@ -237,12 +285,11 @@ namespace PokemonGo.RocketAPI.Window
}
}
-
public AuthType AuthType
{
get
{
- return (GetSetting() != string.Empty ? GetSetting() : "Ptc") == "Ptc" ? AuthType.Ptc : AuthType.Google;
+ return (GetSetting() != string.Empty ? GetSetting() : "PTC") == "PTC" ? AuthType.Ptc : AuthType.Google;
}
set { SetSetting(value.ToString()); }
}
@@ -256,7 +303,6 @@ namespace PokemonGo.RocketAPI.Window
set { SetSetting(value); }
}
-
public double DefaultLongitude
{
get
@@ -423,7 +469,7 @@ namespace PokemonGo.RocketAPI.Window
public void SetSetting(double value, [CallerMemberName] string key = null)
{
- var customCulture = (CultureInfo) Thread.CurrentThread.CurrentCulture.Clone();
+ var customCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();
customCulture.NumberFormat.NumberDecimalSeparator = ".";
Thread.CurrentThread.CurrentCulture = customCulture;
var configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
diff --git a/src/RocketBotGUI/SettingsForm.Designer.cs b/src/RocketBotGUI/SettingsForm.Designer.cs
index 23b41f3..0688c62 100644
--- a/src/RocketBotGUI/SettingsForm.Designer.cs
+++ b/src/RocketBotGUI/SettingsForm.Designer.cs
@@ -55,6 +55,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.useIncubatorsCb = new System.Windows.Forms.ComboBox();
+ 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();
@@ -63,8 +65,8 @@ namespace PokemonGo.RocketAPI.Window
this.label6 = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.tabControl = new System.Windows.Forms.TabControl();
- this.tabPage1 = new System.Windows.Forms.TabPage();
- this.tabPage2 = new System.Windows.Forms.TabPage();
+ this.tabLocation = new System.Windows.Forms.TabPage();
+ this.tabPokemon = new System.Windows.Forms.TabPage();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.cbSelectAllEvolve = new System.Windows.Forms.CheckBox();
this.clbEvolve = new System.Windows.Forms.CheckedListBox();
@@ -74,7 +76,9 @@ namespace PokemonGo.RocketAPI.Window
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cbSelectAllTransfer = new System.Windows.Forms.CheckBox();
this.clbTransfer = new System.Windows.Forms.CheckedListBox();
- this.tabPage3 = new System.Windows.Forms.TabPage();
+ this.tabItems = new System.Windows.Forms.TabPage();
+ this.flpItems = new System.Windows.Forms.FlowLayoutPanel();
+ this.tabDevice = new System.Windows.Forms.TabPage();
this.label22 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
@@ -112,12 +116,13 @@ namespace PokemonGo.RocketAPI.Window
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.tabControl.SuspendLayout();
- this.tabPage1.SuspendLayout();
- this.tabPage2.SuspendLayout();
+ this.tabLocation.SuspendLayout();
+ this.tabPokemon.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
- this.tabPage3.SuspendLayout();
+ this.tabItems.SuspendLayout();
+ this.tabDevice.SuspendLayout();
this.SuspendLayout();
//
// authTypeLabel
@@ -133,8 +138,8 @@ namespace PokemonGo.RocketAPI.Window
//
this.authTypeCb.FormattingEnabled = true;
this.authTypeCb.Items.AddRange(new object[] {
- "google",
- "Ptc"});
+ "Google",
+ "PTC"});
this.authTypeCb.Location = new System.Drawing.Point(96, 5);
this.authTypeCb.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.authTypeCb.Name = "authTypeCb";
@@ -199,7 +204,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, 387);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(101, 15);
this.label3.TabIndex = 8;
@@ -262,8 +267,8 @@ namespace PokemonGo.RocketAPI.Window
//
this.razzmodeCb.FormattingEnabled = true;
this.razzmodeCb.Items.AddRange(new object[] {
- "probability",
- "cp"});
+ "Probability",
+ "CP"});
this.razzmodeCb.Location = new System.Drawing.Point(138, 159);
this.razzmodeCb.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.razzmodeCb.Name = "razzmodeCb";
@@ -308,7 +313,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, 387);
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);
@@ -319,7 +324,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(6, 412);
+ this.saveBtn.Location = new System.Drawing.Point(6, 419);
this.saveBtn.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(248, 42);
@@ -354,7 +359,7 @@ namespace PokemonGo.RocketAPI.Window
this.gMapControl1.ScaleMode = GMap.NET.WindowsForms.ScaleModes.Integer;
this.gMapControl1.SelectedAreaFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(65)))), ((int)(((byte)(105)))), ((int)(((byte)(225)))));
this.gMapControl1.ShowTileGridLines = false;
- this.gMapControl1.Size = new System.Drawing.Size(577, 378);
+ this.gMapControl1.Size = new System.Drawing.Size(586, 385);
this.gMapControl1.TabIndex = 22;
this.gMapControl1.Zoom = 0D;
this.gMapControl1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.gMapControl1_MouseClick);
@@ -362,7 +367,7 @@ namespace PokemonGo.RocketAPI.Window
// FindAdressButton
//
this.FindAdressButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.FindAdressButton.Location = new System.Drawing.Point(464, 393);
+ this.FindAdressButton.Location = new System.Drawing.Point(473, 400);
this.FindAdressButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.FindAdressButton.Name = "FindAdressButton";
this.FindAdressButton.Size = new System.Drawing.Size(119, 30);
@@ -376,10 +381,10 @@ namespace PokemonGo.RocketAPI.Window
this.AdressBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.AdressBox.ForeColor = System.Drawing.Color.Gray;
- this.AdressBox.Location = new System.Drawing.Point(6, 397);
+ this.AdressBox.Location = new System.Drawing.Point(6, 404);
this.AdressBox.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.AdressBox.Name = "AdressBox";
- this.AdressBox.Size = new System.Drawing.Size(452, 23);
+ this.AdressBox.Size = new System.Drawing.Size(461, 23);
this.AdressBox.TabIndex = 25;
this.AdressBox.Text = "Enter an address or a coordinate";
this.AdressBox.Enter += new System.EventHandler(this.AdressBox_Enter);
@@ -389,7 +394,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(536, 7);
+ this.trackBar.Location = new System.Drawing.Point(545, 7);
this.trackBar.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.trackBar.Name = "trackBar";
this.trackBar.Orientation = System.Windows.Forms.Orientation.Vertical;
@@ -400,6 +405,8 @@ namespace PokemonGo.RocketAPI.Window
//
// panel1
//
+ this.panel1.Controls.Add(this.useIncubatorsCb);
+ this.panel1.Controls.Add(this.useIncubatorsText);
this.panel1.Controls.Add(this.TravelSpeedBox);
this.panel1.Controls.Add(this.CatchPokemonBox);
this.panel1.Controls.Add(this.CatchPokemonText);
@@ -431,12 +438,33 @@ namespace PokemonGo.RocketAPI.Window
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(261, 458);
+ this.panel1.Size = new System.Drawing.Size(261, 465);
this.panel1.TabIndex = 26;
//
+ // useIncubatorsCb
+ //
+ this.useIncubatorsCb.FormattingEnabled = true;
+ this.useIncubatorsCb.Items.AddRange(new object[] {
+ "Disabled",
+ "Only Unlimited",
+ "All Incubators"});
+ this.useIncubatorsCb.Location = new System.Drawing.Point(138, 320);
+ this.useIncubatorsCb.Name = "useIncubatorsCb";
+ this.useIncubatorsCb.Size = new System.Drawing.Size(116, 23);
+ this.useIncubatorsCb.TabIndex = 26;
+ //
+ // useIncubatorsText
+ //
+ this.useIncubatorsText.AutoSize = true;
+ this.useIncubatorsText.Location = new System.Drawing.Point(3, 323);
+ this.useIncubatorsText.Name = "useIncubatorsText";
+ this.useIncubatorsText.Size = new System.Drawing.Size(117, 15);
+ this.useIncubatorsText.TabIndex = 27;
+ this.useIncubatorsText.Text = "Use Egg Incubators:";
+ //
// TravelSpeedBox
//
- this.TravelSpeedBox.Location = new System.Drawing.Point(138, 314);
+ this.TravelSpeedBox.Location = new System.Drawing.Point(138, 283);
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);
@@ -446,7 +474,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, 363);
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);
@@ -456,7 +484,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, 362);
this.CatchPokemonText.Name = "CatchPokemonText";
this.CatchPokemonText.Size = new System.Drawing.Size(97, 15);
this.CatchPokemonText.TabIndex = 25;
@@ -473,7 +501,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, 286);
this.TravelSpeedText.Name = "TravelSpeedText";
this.TravelSpeedText.Size = new System.Drawing.Size(112, 15);
this.TravelSpeedText.TabIndex = 23;
@@ -494,48 +522,49 @@ namespace PokemonGo.RocketAPI.Window
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(261, 0);
this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(597, 458);
+ this.panel2.Size = new System.Drawing.Size(606, 465);
this.panel2.TabIndex = 27;
//
// tabControl
//
- this.tabControl.Controls.Add(this.tabPage1);
- this.tabControl.Controls.Add(this.tabPage2);
- this.tabControl.Controls.Add(this.tabPage3);
+ this.tabControl.Controls.Add(this.tabLocation);
+ this.tabControl.Controls.Add(this.tabPokemon);
+ this.tabControl.Controls.Add(this.tabItems);
+ this.tabControl.Controls.Add(this.tabDevice);
this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabControl.Location = new System.Drawing.Point(0, 0);
this.tabControl.Name = "tabControl";
this.tabControl.SelectedIndex = 0;
- this.tabControl.Size = new System.Drawing.Size(597, 458);
+ this.tabControl.Size = new System.Drawing.Size(606, 465);
this.tabControl.TabIndex = 26;
//
- // tabPage1
- //
- this.tabPage1.BackColor = System.Drawing.SystemColors.Control;
- this.tabPage1.Controls.Add(this.trackBar);
- this.tabPage1.Controls.Add(this.AdressBox);
- this.tabPage1.Controls.Add(this.FindAdressButton);
- this.tabPage1.Controls.Add(this.gMapControl1);
- this.tabPage1.Location = new System.Drawing.Point(4, 24);
- this.tabPage1.Name = "tabPage1";
- this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage1.Size = new System.Drawing.Size(589, 430);
- this.tabPage1.TabIndex = 0;
- this.tabPage1.Text = "Location";
- //
- // tabPage2
- //
- this.tabPage2.BackColor = System.Drawing.SystemColors.Control;
- this.tabPage2.Controls.Add(this.groupBox3);
- this.tabPage2.Controls.Add(this.groupBox2);
- this.tabPage2.Controls.Add(this.groupBox1);
- this.tabPage2.Location = new System.Drawing.Point(4, 24);
- this.tabPage2.Name = "tabPage2";
- this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage2.Size = new System.Drawing.Size(589, 430);
- this.tabPage2.TabIndex = 1;
- this.tabPage2.Text = "Pokemon";
+ // tabLocation
+ //
+ this.tabLocation.BackColor = System.Drawing.SystemColors.Control;
+ this.tabLocation.Controls.Add(this.trackBar);
+ this.tabLocation.Controls.Add(this.AdressBox);
+ this.tabLocation.Controls.Add(this.FindAdressButton);
+ this.tabLocation.Controls.Add(this.gMapControl1);
+ this.tabLocation.Location = new System.Drawing.Point(4, 24);
+ this.tabLocation.Name = "tabLocation";
+ this.tabLocation.Padding = new System.Windows.Forms.Padding(3);
+ this.tabLocation.Size = new System.Drawing.Size(598, 437);
+ this.tabLocation.TabIndex = 0;
+ this.tabLocation.Text = "Location";
+ //
+ // tabPokemon
+ //
+ this.tabPokemon.BackColor = System.Drawing.SystemColors.Control;
+ this.tabPokemon.Controls.Add(this.groupBox3);
+ this.tabPokemon.Controls.Add(this.groupBox2);
+ this.tabPokemon.Controls.Add(this.groupBox1);
+ this.tabPokemon.Location = new System.Drawing.Point(4, 24);
+ this.tabPokemon.Name = "tabPokemon";
+ this.tabPokemon.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPokemon.Size = new System.Drawing.Size(598, 437);
+ this.tabPokemon.TabIndex = 1;
+ this.tabPokemon.Text = "Pokemon";
//
// groupBox3
//
@@ -645,46 +674,66 @@ namespace PokemonGo.RocketAPI.Window
this.clbTransfer.Size = new System.Drawing.Size(188, 364);
this.clbTransfer.TabIndex = 0;
//
- // tabPage3
- //
- this.tabPage3.Controls.Add(this.label22);
- this.tabPage3.Controls.Add(this.label20);
- this.tabPage3.Controls.Add(this.label21);
- this.tabPage3.Controls.Add(this.RandomIDBtn);
- this.tabPage3.Controls.Add(this.deviceTypeCb);
- this.tabPage3.Controls.Add(this.RandomDeviceBtn);
- this.tabPage3.Controls.Add(this.FirmwareFingerprintTb);
- this.tabPage3.Controls.Add(this.label14);
- this.tabPage3.Controls.Add(this.FirmwareTypeTb);
- this.tabPage3.Controls.Add(this.label13);
- this.tabPage3.Controls.Add(this.FirmwareTagsTb);
- this.tabPage3.Controls.Add(this.label12);
- this.tabPage3.Controls.Add(this.FirmwareBrandTb);
- this.tabPage3.Controls.Add(this.label11);
- this.tabPage3.Controls.Add(this.HardwareModelTb);
- this.tabPage3.Controls.Add(this.label10);
- this.tabPage3.Controls.Add(this.HardwareManufacturerTb);
- this.tabPage3.Controls.Add(this.label9);
- this.tabPage3.Controls.Add(this.DeviceModelBootTb);
- this.tabPage3.Controls.Add(this.label8);
- this.tabPage3.Controls.Add(this.DeviceModelIdentifierTb);
- this.tabPage3.Controls.Add(this.label7);
- this.tabPage3.Controls.Add(this.DeviceModelTb);
- this.tabPage3.Controls.Add(this.label15);
- this.tabPage3.Controls.Add(this.DeviceBrandTb);
- this.tabPage3.Controls.Add(this.label16);
- this.tabPage3.Controls.Add(this.AndroidBootloaderTb);
- this.tabPage3.Controls.Add(this.label17);
- this.tabPage3.Controls.Add(this.AndroidBoardNameTb);
- this.tabPage3.Controls.Add(this.BoardName);
- this.tabPage3.Controls.Add(this.DeviceIdTb);
- this.tabPage3.Controls.Add(this.deviceIdlb);
- this.tabPage3.Controls.Add(this.label18);
- this.tabPage3.Location = new System.Drawing.Point(4, 24);
- this.tabPage3.Name = "tabPage3";
- this.tabPage3.Size = new System.Drawing.Size(589, 430);
- this.tabPage3.TabIndex = 0;
- this.tabPage3.Text = "Device";
+ // tabItems
+ //
+ this.tabItems.BackColor = System.Drawing.SystemColors.Control;
+ this.tabItems.Controls.Add(this.flpItems);
+ this.tabItems.Location = new System.Drawing.Point(4, 24);
+ this.tabItems.Name = "tabItems";
+ this.tabItems.Padding = new System.Windows.Forms.Padding(3);
+ this.tabItems.Size = new System.Drawing.Size(598, 437);
+ this.tabItems.TabIndex = 2;
+ this.tabItems.Text = "Items";
+ //
+ // flpItems
+ //
+ this.flpItems.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.flpItems.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
+ this.flpItems.Location = new System.Drawing.Point(3, 3);
+ this.flpItems.Name = "flpItems";
+ this.flpItems.Size = new System.Drawing.Size(592, 431);
+ this.flpItems.TabIndex = 0;
+ //
+ // tabDevice
+ //
+ this.tabDevice.Controls.Add(this.label22);
+ this.tabDevice.Controls.Add(this.label20);
+ this.tabDevice.Controls.Add(this.label21);
+ this.tabDevice.Controls.Add(this.RandomIDBtn);
+ this.tabDevice.Controls.Add(this.deviceTypeCb);
+ this.tabDevice.Controls.Add(this.RandomDeviceBtn);
+ this.tabDevice.Controls.Add(this.FirmwareFingerprintTb);
+ this.tabDevice.Controls.Add(this.label14);
+ this.tabDevice.Controls.Add(this.FirmwareTypeTb);
+ this.tabDevice.Controls.Add(this.label13);
+ this.tabDevice.Controls.Add(this.FirmwareTagsTb);
+ this.tabDevice.Controls.Add(this.label12);
+ this.tabDevice.Controls.Add(this.FirmwareBrandTb);
+ this.tabDevice.Controls.Add(this.label11);
+ this.tabDevice.Controls.Add(this.HardwareModelTb);
+ this.tabDevice.Controls.Add(this.label10);
+ this.tabDevice.Controls.Add(this.HardwareManufacturerTb);
+ this.tabDevice.Controls.Add(this.label9);
+ this.tabDevice.Controls.Add(this.DeviceModelBootTb);
+ this.tabDevice.Controls.Add(this.label8);
+ this.tabDevice.Controls.Add(this.DeviceModelIdentifierTb);
+ this.tabDevice.Controls.Add(this.label7);
+ this.tabDevice.Controls.Add(this.DeviceModelTb);
+ this.tabDevice.Controls.Add(this.label15);
+ this.tabDevice.Controls.Add(this.DeviceBrandTb);
+ this.tabDevice.Controls.Add(this.label16);
+ this.tabDevice.Controls.Add(this.AndroidBootloaderTb);
+ this.tabDevice.Controls.Add(this.label17);
+ this.tabDevice.Controls.Add(this.AndroidBoardNameTb);
+ this.tabDevice.Controls.Add(this.BoardName);
+ this.tabDevice.Controls.Add(this.DeviceIdTb);
+ this.tabDevice.Controls.Add(this.deviceIdlb);
+ this.tabDevice.Controls.Add(this.label18);
+ this.tabDevice.Location = new System.Drawing.Point(4, 24);
+ this.tabDevice.Name = "tabDevice";
+ this.tabDevice.Size = new System.Drawing.Size(598, 437);
+ this.tabDevice.TabIndex = 0;
+ this.tabDevice.Text = "Device";
//
// label22
//
@@ -1004,7 +1053,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(858, 458);
+ this.ClientSize = new System.Drawing.Size(867, 465);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
@@ -1021,17 +1070,18 @@ namespace PokemonGo.RocketAPI.Window
this.panel1.PerformLayout();
this.panel2.ResumeLayout(false);
this.tabControl.ResumeLayout(false);
- this.tabPage1.ResumeLayout(false);
- this.tabPage1.PerformLayout();
- this.tabPage2.ResumeLayout(false);
+ this.tabLocation.ResumeLayout(false);
+ this.tabLocation.PerformLayout();
+ this.tabPokemon.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
- this.tabPage3.ResumeLayout(false);
- this.tabPage3.PerformLayout();
+ this.tabItems.ResumeLayout(false);
+ this.tabDevice.ResumeLayout(false);
+ this.tabDevice.PerformLayout();
this.ResumeLayout(false);
}
@@ -1072,8 +1122,8 @@ namespace PokemonGo.RocketAPI.Window
private System.Windows.Forms.Label CatchPokemonText;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.TabControl tabControl;
- private System.Windows.Forms.TabPage tabPage1;
- private System.Windows.Forms.TabPage tabPage2;
+ private System.Windows.Forms.TabPage tabLocation;
+ private System.Windows.Forms.TabPage tabPokemon;
private System.Windows.Forms.CheckedListBox clbTransfer;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
@@ -1083,7 +1133,7 @@ namespace PokemonGo.RocketAPI.Window
private System.Windows.Forms.CheckBox cbSelectAllEvolve;
private System.Windows.Forms.CheckBox cbSelectAllCatch;
private System.Windows.Forms.CheckBox cbSelectAllTransfer;
- private System.Windows.Forms.TabPage tabPage3;
+ private System.Windows.Forms.TabPage tabDevice;
private System.Windows.Forms.Button RandomIDBtn;
private System.Windows.Forms.ComboBox deviceTypeCb;
private System.Windows.Forms.Button RandomDeviceBtn;
@@ -1117,5 +1167,9 @@ namespace PokemonGo.RocketAPI.Window
private System.Windows.Forms.Label label20;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.Label label22;
+ private System.Windows.Forms.TabPage tabItems;
+ private System.Windows.Forms.FlowLayoutPanel flpItems;
+ private System.Windows.Forms.Label useIncubatorsText;
+ private System.Windows.Forms.ComboBox useIncubatorsCb;
}
}
diff --git a/src/RocketBotGUI/SettingsForm.cs b/src/RocketBotGUI/SettingsForm.cs
index e123405..3f1ff50 100644
--- a/src/RocketBotGUI/SettingsForm.cs
+++ b/src/RocketBotGUI/SettingsForm.cs
@@ -1,13 +1,14 @@
-using System;
+using GMap.NET;
+using GMap.NET.MapProviders;
+using POGOProtos.Enums;
+using POGOProtos.Inventory.Item;
+using System;
using System.Collections.Generic;
using System.Configuration;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Windows.Forms;
-using GMap.NET;
-using GMap.NET.MapProviders;
-using POGOProtos.Enums;
namespace PokemonGo.RocketAPI.Window
{
@@ -17,6 +18,19 @@ namespace PokemonGo.RocketAPI.Window
private List<DeviceInfo> _deviceInfos;
private bool _doNotPopulate;
+ private List<ItemId> itemSettings = new List<ItemId> {
+ ItemId.ItemPokeBall,
+ ItemId.ItemGreatBall,
+ ItemId.ItemUltraBall,
+ ItemId.ItemRazzBerry,
+ ItemId.ItemPotion,
+ ItemId.ItemSuperPotion,
+ ItemId.ItemHyperPotion,
+ ItemId.ItemMaxPotion,
+ ItemId.ItemRevive,
+ ItemId.ItemMaxRevive,
+ };
+
public SettingsForm()
{
InitializeComponent();
@@ -32,12 +46,19 @@ namespace PokemonGo.RocketAPI.Window
clbTransfer.Items.Add(id);
clbEvolve.Items.Add(id);
}
+
+ foreach (ItemId itemId in itemSettings)
+ {
+ ItemData item = new ItemData();
+ item.ItemId = itemId;
+ flpItems.Controls.Add(new ItemSetting(item));
+ }
}
private void SettingsForm_Load(object sender, EventArgs e)
{
authTypeCb.Text = Settings.Instance.AuthType.ToString();
- if (authTypeCb.Text == "google")
+ if (authTypeCb.Text.ToLower().Equals("google"))
{
UserLoginBox.Text = Settings.Instance.GoogleUsername;
UserPasswordBox.Text = Settings.Instance.GooglePassword;
@@ -51,10 +72,12 @@ namespace PokemonGo.RocketAPI.Window
longitudeText.Text = Settings.Instance.DefaultLongitude.ToString();
razzmodeCb.Text = Settings.Instance.RazzBerryMode;
razzSettingText.Text = Settings.Instance.RazzBerrySetting.ToString();
+ useIncubatorsCb.Text = Settings.Instance.UseIncubatorsMode.ToString();
transferTypeCb.Text = Settings.Instance.TransferType;
transferCpThresText.Text = Settings.Instance.TransferCpThreshold.ToString();
transferIVThresText.Text = Settings.Instance.TransferIvThreshold.ToString();
evolveAllChk.Checked = Settings.Instance.EvolveAllGivenPokemons;
+
CatchPokemonBox.Checked = Settings.Instance.CatchPokemon;
TravelSpeedBox.Text = Settings.Instance.TravelSpeed.ToString();
// ImageSizeBox.Text = Settings.Instance.ImageSize.ToString();
@@ -73,7 +96,6 @@ namespace PokemonGo.RocketAPI.Window
gMapControl1.Position = new PointLatLng(double.Parse(lat.Replace(",", "."), CultureInfo.InvariantCulture),
double.Parse(longit.Replace(",", "."), CultureInfo.InvariantCulture));
-
//zoom min/max; default both = 2
gMapControl1.DragButton = MouseButtons.Left;
@@ -124,6 +146,18 @@ namespace PokemonGo.RocketAPI.Window
}
}
+ var itemCounts = Settings.Instance.ItemCounts;
+ foreach (ItemSetting itemSetting in flpItems.Controls)
+ {
+ foreach (var itemCount in itemCounts)
+ {
+ if (itemSetting.ItemData.ItemId == itemCount.ItemId)
+ {
+ itemSetting.ItemData = itemCount;
+ }
+ }
+ }
+
// Device settings
_deviceHelper = new DeviceHelper();
_deviceInfos = _deviceHelper.DeviceBucket;
@@ -154,7 +188,7 @@ namespace PokemonGo.RocketAPI.Window
private void saveBtn_Click(object sender, EventArgs e)
{
Settings.Instance.SetSetting(authTypeCb.Text, "AuthType");
- if (authTypeCb.Text == "google")
+ if (authTypeCb.Text.ToLower().Equals("google"))
{
Settings.Instance.SetSetting(UserLoginBox.Text, "GoogleUsername");
Settings.Instance.SetSetting(UserPasswordBox.Text, "GooglePassword");
@@ -172,12 +206,12 @@ namespace PokemonGo.RocketAPI.Window
lat.Replace(',', '.');
longit.Replace(',', '.');
-
Settings.Instance.SetSetting(razzmodeCb.Text, "RazzBerryMode");
Settings.Instance.SetSetting(razzSettingText.Text, "RazzBerrySetting");
Settings.Instance.SetSetting(transferTypeCb.Text, "TransferType");
Settings.Instance.SetSetting(transferCpThresText.Text, "TransferCPThreshold");
Settings.Instance.SetSetting(transferIVThresText.Text, "TransferIVThreshold");
+ Settings.Instance.SetSetting(useIncubatorsCb.Text, "useIncubatorsMode");
Settings.Instance.SetSetting(TravelSpeedBox.Text, "TravelSpeed");
//Settings.Instance.SetSetting(ImageSizeBox.Text, "ImageSize");
Settings.Instance.SetSetting(evolveAllChk.Checked ? "true" : "false", "EvolveAllGivenPokemons");
@@ -185,6 +219,7 @@ namespace PokemonGo.RocketAPI.Window
Settings.Instance.ExcludedPokemonCatch = clbCatch.CheckedItems.Cast<PokemonId>().ToList();
Settings.Instance.ExcludedPokemonTransfer = clbTransfer.CheckedItems.Cast<PokemonId>().ToList();
Settings.Instance.ExcludedPokemonEvolve = clbEvolve.CheckedItems.Cast<PokemonId>().ToList();
+ Settings.Instance.ItemCounts = flpItems.Controls.Cast<ItemSetting>().Select(i => i.ItemData).ToList();
Settings.Instance.Reload();
//Device settings
@@ -211,7 +246,7 @@ namespace PokemonGo.RocketAPI.Window
private void authTypeCb_SelectedIndexChanged(object sender, EventArgs e)
{
- if (authTypeCb.Text == "google")
+ if (authTypeCb.Text.ToLower().Equals("google"))
{
UserLabel.Text = "Email:";
}
You may download the files in Public Git.