diff --git a/src/RocketBotGUI/App.config b/src/RocketBotGUI/App.config
index 0c71708..448876f 100644
--- a/src/RocketBotGUI/App.config
+++ b/src/RocketBotGUI/App.config
@@ -92,6 +92,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..b093c0e
--- /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("Segoe UI", 8.25F, 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, 22);
+ 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("Segoe UI", 8.25F, 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, 20);
+ this.ItemId.TabIndex = 1;
+ this.ItemId.Text = "Pokeball";
+ this.ItemId.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // ItemSetting
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ 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, 21);
+ ((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 300d78e..96db09e 100644
--- a/src/RocketBotGUI/MainForm.cs
+++ b/src/RocketBotGUI/MainForm.cs
@@ -785,10 +785,14 @@ namespace PokemonGo.RocketAPI.Window
PokeStopOutput.Write($", Gems: {fortSearch.GemsAwarded}");
if (fortSearch.PokemonDataEgg != null)
PokeStopOutput.Write($", Eggs: {fortSearch.PokemonDataEgg}");
- if (GetFriendlyItemsString(fortSearch.ItemsAwarded) != string.Empty)
+ 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;
@@ -798,11 +802,11 @@ 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)
@@ -1928,19 +1932,22 @@ namespace PokemonGo.RocketAPI.Window
public async Task<IEnumerable<ItemData>> GetItemsToRecycle(ISettings _settings, Client client)
{
- var settings = (Settings) _settings;
+ var itemCounts = (_settings as Settings).ItemCounts;
var myItems = await GetItems(client);
+ var itemsToRecycle = new List<ItemData>();
+
+ 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 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
- });
+ return itemsToRecycle;
}
public async Task RecycleItems(Client client)
@@ -1951,7 +1958,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);
}
}
diff --git a/src/RocketBotGUI/PokemonGo.RocketBot.csproj b/src/RocketBotGUI/PokemonGo.RocketBot.csproj
index 24273d2..48f85df 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..8cb10cb 100644
--- a/src/RocketBotGUI/Settings.cs
+++ b/src/RocketBotGUI/Settings.cs
@@ -123,6 +123,46 @@ namespace PokemonGo.RocketAPI.Window
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
diff --git a/src/RocketBotGUI/SettingsForm.Designer.cs b/src/RocketBotGUI/SettingsForm.Designer.cs
index 23b41f3..781e413 100644
--- a/src/RocketBotGUI/SettingsForm.Designer.cs
+++ b/src/RocketBotGUI/SettingsForm.Designer.cs
@@ -63,8 +63,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 +74,8 @@ 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.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();
@@ -108,16 +109,18 @@ namespace PokemonGo.RocketAPI.Window
this.DeviceIdTb = new System.Windows.Forms.TextBox();
this.deviceIdlb = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
+ this.flpItems = new System.Windows.Forms.FlowLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
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
@@ -499,9 +502,10 @@ namespace PokemonGo.RocketAPI.Window
//
// 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);
@@ -510,32 +514,32 @@ namespace PokemonGo.RocketAPI.Window
this.tabControl.Size = new System.Drawing.Size(597, 458);
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(589, 430);
+ 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(589, 430);
+ this.tabPokemon.TabIndex = 1;
+ this.tabPokemon.Text = "Pokemon";
//
// groupBox3
//
@@ -645,46 +649,57 @@ 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(589, 430);
+ this.tabItems.TabIndex = 2;
+ this.tabItems.Text = "Items";
+ //
+ // 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(589, 430);
+ this.tabDevice.TabIndex = 0;
+ this.tabDevice.Text = "Device";
//
// label22
//
@@ -1000,6 +1015,15 @@ namespace PokemonGo.RocketAPI.Window
this.label18.TabIndex = 36;
this.label18.Text = "Device Type:";
//
+ // 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(583, 424);
+ this.flpItems.TabIndex = 0;
+ //
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
@@ -1021,17 +1045,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 +1097,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 +1108,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 +1142,7 @@ 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;
}
}
diff --git a/src/RocketBotGUI/SettingsForm.cs b/src/RocketBotGUI/SettingsForm.cs
index e123405..844ce9a 100644
--- a/src/RocketBotGUI/SettingsForm.cs
+++ b/src/RocketBotGUI/SettingsForm.cs
@@ -8,6 +8,7 @@ using System.Windows.Forms;
using GMap.NET;
using GMap.NET.MapProviders;
using POGOProtos.Enums;
+using POGOProtos.Inventory.Item;
namespace PokemonGo.RocketAPI.Window
{
@@ -16,6 +17,18 @@ namespace PokemonGo.RocketAPI.Window
private DeviceHelper _deviceHelper;
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()
{
@@ -32,6 +45,12 @@ 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)
@@ -124,6 +143,15 @@ 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;
@@ -185,6 +213,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
You may download the files in Public Git.