diff --git a/PokemonGo.RocketBot.Window/ItemBox.cs b/PokemonGo.RocketBot.Window/ItemBox.cs
new file mode 100644
index 0000000..43f1d20
--- /dev/null
+++ b/PokemonGo.RocketBot.Window/ItemBox.cs
@@ -0,0 +1,96 @@
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+using POGOProtos.Inventory.Item;
+
+namespace PokemonGo.RocketBot.Window
+{
+ public partial class ItemBox : UserControl
+ {
+ public DateTime expires = new DateTime(0);
+
+ public ItemBox(ItemData item)
+ {
+ InitializeComponent();
+
+ item_ = item;
+
+ pb.Image = (Image) Properties.Resources.ResourceManager.GetObject(item.ItemId.ToString());
+ lbl.Text = item.Count.ToString();
+ lblTime.Parent = pb;
+
+ foreach (Control control in Controls)
+ {
+ control.MouseEnter += childMouseEnter;
+ control.MouseLeave += childMouseLeave;
+ control.MouseClick += childMouseClick;
+ }
+
+ if (item_.ItemId == ItemId.ItemIncubatorBasic || item_.ItemId == ItemId.ItemIncubatorBasicUnlimited ||
+ item.Count < 1)
+ {
+ Enabled = false;
+ }
+ }
+
+ public ItemData item_ { get; }
+
+ public event EventHandler ItemClick;
+
+ private void childMouseClick(object sender, MouseEventArgs e)
+ {
+ OnItemClick(item_, EventArgs.Empty);
+ }
+
+ protected override void OnMouseClick(MouseEventArgs e)
+ {
+ base.OnMouseClick(e);
+ OnItemClick(item_, EventArgs.Empty);
+ }
+
+ private void childMouseLeave(object sender, EventArgs e)
+ {
+ OnMouseLeave(e);
+ }
+
+ private void childMouseEnter(object sender, EventArgs e)
+ {
+ OnMouseEnter(e);
+ }
+
+ protected override void OnMouseLeave(EventArgs e)
+ {
+ base.OnMouseLeave(e);
+ BackColor = Color.Transparent;
+ }
+
+ protected override void OnMouseEnter(EventArgs e)
+ {
+ base.OnMouseEnter(e);
+ BackColor = Color.LightGreen;
+ }
+
+ protected virtual void OnItemClick(ItemData item, EventArgs e)
+ {
+ var handler = ItemClick;
+ if (handler != null)
+ {
+ handler(item, e);
+ }
+ }
+
+ private void tmr_Tick(object sender, EventArgs e)
+ {
+ var time = expires - DateTime.UtcNow;
+ if (expires.Ticks == 0 || time.TotalSeconds < 0)
+ {
+ lblTime.Visible = false;
+ }
+ else
+ {
+ lblTime.Visible = true;
+ lblTime.Text = $"{time.Minutes}m {Math.Abs(time.Seconds)}s";
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/PokemonGo.RocketBot.Window/ItemBox.designer.cs b/PokemonGo.RocketBot.Window/ItemBox.designer.cs
new file mode 100644
index 0000000..3c347f6
--- /dev/null
+++ b/PokemonGo.RocketBot.Window/ItemBox.designer.cs
@@ -0,0 +1,104 @@
+namespace PokemonGo.RocketBot.Window {
+ partial class ItemBox {
+ /// <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.components = new System.ComponentModel.Container();
+ this.lbl = new System.Windows.Forms.Label();
+ this.pb = new System.Windows.Forms.PictureBox();
+ this.tmr = new System.Windows.Forms.Timer(this.components);
+ this.lblTime = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.pb)).BeginInit();
+ this.SuspendLayout();
+ //
+ // lbl
+ //
+ this.lbl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.lbl.BackColor = System.Drawing.Color.Transparent;
+ this.lbl.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbl.ForeColor = System.Drawing.SystemColors.GrayText;
+ this.lbl.Location = new System.Drawing.Point(0, 64);
+ this.lbl.Margin = new System.Windows.Forms.Padding(0);
+ this.lbl.Name = "lbl";
+ this.lbl.Size = new System.Drawing.Size(64, 24);
+ this.lbl.TabIndex = 1;
+ this.lbl.Text = "999";
+ this.lbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // pb
+ //
+ this.pb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.pb.BackColor = System.Drawing.Color.Transparent;
+ this.pb.Location = new System.Drawing.Point(0, 0);
+ this.pb.Margin = new System.Windows.Forms.Padding(0);
+ this.pb.Name = "pb";
+ this.pb.Size = new System.Drawing.Size(64, 64);
+ this.pb.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+ this.pb.TabIndex = 0;
+ this.pb.TabStop = false;
+ //
+ // tmr
+ //
+ this.tmr.Enabled = true;
+ this.tmr.Interval = 1000;
+ this.tmr.Tick += new System.EventHandler(this.tmr_Tick);
+ //
+ // lblTime
+ //
+ this.lblTime.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.lblTime.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblTime.Location = new System.Drawing.Point(0, 0);
+ this.lblTime.Margin = new System.Windows.Forms.Padding(0);
+ this.lblTime.Name = "lblTime";
+ this.lblTime.Size = new System.Drawing.Size(64, 23);
+ this.lblTime.TabIndex = 2;
+ this.lblTime.Text = "30m 00s";
+ this.lblTime.TextAlign = System.Drawing.ContentAlignment.TopCenter;
+ this.lblTime.Visible = false;
+ //
+ // ItemBox
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.lblTime);
+ this.Controls.Add(this.lbl);
+ this.Controls.Add(this.pb);
+ this.Cursor = System.Windows.Forms.Cursors.Default;
+ this.Name = "ItemBox";
+ this.Size = new System.Drawing.Size(64, 88);
+ ((System.ComponentModel.ISupportInitialize)(this.pb)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.PictureBox pb;
+ private System.Windows.Forms.Label lbl;
+ private System.Windows.Forms.Timer tmr;
+ private System.Windows.Forms.Label lblTime;
+ }
+}
diff --git a/PokemonGo.RocketBot.Window/ItemBox.resx b/PokemonGo.RocketBot.Window/ItemBox.resx
new file mode 100644
index 0000000..d3ab77a
--- /dev/null
+++ b/PokemonGo.RocketBot.Window/ItemBox.resx
@@ -0,0 +1,123 @@
+<?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>
+ <metadata name="tmr.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root>
\ No newline at end of file
diff --git a/PokemonGo.RocketBot.Window/ItemForm.cs b/PokemonGo.RocketBot.Window/ItemForm.cs
new file mode 100644
index 0000000..2ddf383
--- /dev/null
+++ b/PokemonGo.RocketBot.Window/ItemForm.cs
@@ -0,0 +1,24 @@
+using System.Drawing;
+using System.Windows.Forms;
+using POGOProtos.Inventory.Item;
+
+namespace PokemonGo.RocketBot.Window
+{
+ public partial class ItemForm : Form
+ {
+ public ItemForm(ItemData item)
+ {
+ InitializeComponent();
+
+ pb.Image = (Image) Properties.Resources.ResourceManager.GetObject(item.ItemId.ToString());
+ numCount.Maximum = item.Count;
+
+ if (item.ItemId == ItemId.ItemLuckyEgg || item.ItemId == ItemId.ItemIncenseOrdinary)
+ {
+ btnRecycle.Text = "Use";
+ //btnRecycle.Enabled = false;
+ numCount.Visible = false;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/PokemonGo.RocketBot.Window/ItemForm.designer.cs b/PokemonGo.RocketBot.Window/ItemForm.designer.cs
new file mode 100644
index 0000000..56fa08e
--- /dev/null
+++ b/PokemonGo.RocketBot.Window/ItemForm.designer.cs
@@ -0,0 +1,143 @@
+namespace PokemonGo.RocketBot.Window {
+ partial class ItemForm {
+ /// <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 Windows Form 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.numCount = new System.Windows.Forms.NumericUpDown();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.btnRecycle = new System.Windows.Forms.Button();
+ this.btnCancel = new System.Windows.Forms.Button();
+ this.pb = new System.Windows.Forms.PictureBox();
+ ((System.ComponentModel.ISupportInitialize)(this.numCount)).BeginInit();
+ this.panel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pb)).BeginInit();
+ this.SuspendLayout();
+ //
+ // numCount
+ //
+ this.numCount.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.numCount.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.numCount.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.numCount.ForeColor = System.Drawing.SystemColors.ControlDark;
+ this.numCount.Location = new System.Drawing.Point(11, 113);
+ this.numCount.Maximum = new decimal(new int[] {
+ 999,
+ 0,
+ 0,
+ 0});
+ this.numCount.Minimum = new decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 0});
+ this.numCount.Name = "numCount";
+ this.numCount.Size = new System.Drawing.Size(140, 29);
+ this.numCount.TabIndex = 3;
+ this.numCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+ this.numCount.Value = new decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 0});
+ //
+ // panel1
+ //
+ this.panel1.BackColor = System.Drawing.SystemColors.Window;
+ this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.panel1.Controls.Add(this.btnRecycle);
+ this.panel1.Controls.Add(this.btnCancel);
+ this.panel1.Controls.Add(this.numCount);
+ this.panel1.Controls.Add(this.pb);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(164, 240);
+ this.panel1.TabIndex = 4;
+ //
+ // btnRecycle
+ //
+ this.btnRecycle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnRecycle.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.btnRecycle.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnRecycle.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btnRecycle.ForeColor = System.Drawing.SystemColors.ControlDark;
+ this.btnRecycle.Location = new System.Drawing.Point(11, 151);
+ this.btnRecycle.Name = "btnRecycle";
+ this.btnRecycle.Size = new System.Drawing.Size(140, 35);
+ this.btnRecycle.TabIndex = 4;
+ this.btnRecycle.Text = "Recycle";
+ this.btnRecycle.UseVisualStyleBackColor = true;
+ //
+ // btnCancel
+ //
+ this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnCancel.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btnCancel.ForeColor = System.Drawing.SystemColors.ControlDark;
+ this.btnCancel.Location = new System.Drawing.Point(11, 192);
+ this.btnCancel.Name = "btnCancel";
+ this.btnCancel.Size = new System.Drawing.Size(140, 35);
+ this.btnCancel.TabIndex = 4;
+ this.btnCancel.Text = "Cancel";
+ this.btnCancel.UseVisualStyleBackColor = true;
+ //
+ // pb
+ //
+ this.pb.Anchor = System.Windows.Forms.AnchorStyles.Top;
+ this.pb.Location = new System.Drawing.Point(33, 11);
+ this.pb.Name = "pb";
+ this.pb.Size = new System.Drawing.Size(96, 96);
+ this.pb.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+ this.pb.TabIndex = 0;
+ this.pb.TabStop = false;
+ //
+ // RecycleItemForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(164, 240);
+ this.Controls.Add(this.panel1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+ this.Name = "RecycleItemForm";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "RecycleItemForm";
+ ((System.ComponentModel.ISupportInitialize)(this.numCount)).EndInit();
+ this.panel1.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.pb)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.PictureBox pb;
+ public System.Windows.Forms.NumericUpDown numCount;
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Button btnRecycle;
+ private System.Windows.Forms.Button btnCancel;
+ }
+}
\ No newline at end of file
diff --git a/PokemonGo.RocketBot.Window/ItemSetting.Designer.cs b/PokemonGo.RocketBot.Window/ItemSetting.Designer.cs
new file mode 100644
index 0000000..a522ea1
--- /dev/null
+++ b/PokemonGo.RocketBot.Window/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/PokemonGo.RocketBot.Window/ItemSetting.cs b/PokemonGo.RocketBot.Window/ItemSetting.cs
new file mode 100644
index 0000000..d47f6fc
--- /dev/null
+++ b/PokemonGo.RocketBot.Window/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/PokemonGo.RocketBot.Window/ItemSetting.resx b/PokemonGo.RocketBot.Window/ItemSetting.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/PokemonGo.RocketBot.Window/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/PokemonGo.RocketBot.Window/MainForm.cs b/PokemonGo.RocketBot.Window/MainForm.cs
index 91c28de..7fb4697 100644
--- a/PokemonGo.RocketBot.Window/MainForm.cs
+++ b/PokemonGo.RocketBot.Window/MainForm.cs
@@ -25,6 +25,8 @@ using PokemonGo.RocketBot.Window.Plugin;
using POGOProtos.Inventory;
using POGOProtos.Inventory.Item;
using static System.Reflection.Assembly;
+using POGOProtos.Networking.Responses;
+using POGOProtos.Data;
namespace PokemonGo.RocketBot.Window
{
@@ -156,7 +158,7 @@ namespace PokemonGo.RocketBot.Window
machine.SetFailureState(new LoginState());
Logger.SetLoggerContext(session);
session.Navigation.UpdatePositionEvent +=
- (lat, lng) => session.EventDispatcher.Send(new UpdatePositionEvent {Latitude = lat, Longitude = lng});
+ (lat, lng) => session.EventDispatcher.Send(new UpdatePositionEvent { Latitude = lat, Longitude = lng });
session.Navigation.UpdatePositionEvent += Navigation_UpdatePositionEvent;
machine.AsyncStart(new VersionCheckState(), session);
@@ -266,20 +268,20 @@ namespace PokemonGo.RocketBot.Window
{
//olvPokemonList.ButtonClick += PokemonListButton_Click;
- pkmnName.ImageGetter = delegate(object rowObject)
+ pkmnName.ImageGetter = delegate (object rowObject)
{
var pokemon = rowObject as PokemonObject;
var key = pokemon.PokemonId.ToString();
if (!olvPokemonList.SmallImageList.Images.ContainsKey(key))
{
- var img = GetPokemonImage((int) pokemon.PokemonId);
+ var img = GetPokemonImage((int)pokemon.PokemonId);
olvPokemonList.SmallImageList.Images.Add(key, img);
}
return key;
};
- olvPokemonList.FormatRow += delegate(object sender, FormatRowEventArgs e)
+ olvPokemonList.FormatRow += delegate (object sender, FormatRowEventArgs e)
{
var pok = e.Model as PokemonObject;
if (olvPokemonList.Objects.Cast<PokemonObject>()
@@ -297,7 +299,7 @@ namespace PokemonGo.RocketBot.Window
}
};
- cmsPokemonList.Opening += delegate(object sender, CancelEventArgs e)
+ cmsPokemonList.Opening += delegate (object sender, CancelEventArgs e)
{
e.Cancel = false;
cmsPokemonList.Items.Clear();
@@ -315,81 +317,215 @@ namespace PokemonGo.RocketBot.Window
e.Cancel = true;
}
- /** var pokemonObject = olvPokemonList.SelectedObjects.Cast<PokemonObject>().Select(o => o).First();
-
- var item = new ToolStripMenuItem();
- var separator = new ToolStripSeparator();
- item.Text = "Transfer " + count + " pokemon";
- item.Click += delegate { TransferPokemon(pokemons); };
- cmsPokemonList.Items.Add(item);
-
- item = new ToolStripMenuItem();
- item.Text = "Rename";
- item.Click += delegate
- {
- using (var form = count == 1 ? new NicknamePokemonForm(pokemonObject) : new NicknamePokemonForm())
- {
- if (form.ShowDialog() == DialogResult.OK)
- {
- NicknamePokemon(pokemons, form.txtNickname.Text);
- }
- }
- };
- cmsPokemonList.Items.Add(item);
-
- if (canAllEvolve)
- {
- item = new ToolStripMenuItem();
- item.Text = "Evolve " + count + " pokemon";
- item.Click += delegate { EvolvePokemon(pokemons); };
- cmsPokemonList.Items.Add(item);
- }
-
- if (count == 1)
- {
- item = new ToolStripMenuItem();
- item.Text = "PowerUp";
- item.Click += delegate { PowerUpPokemon(pokemons); };
- cmsPokemonList.Items.Add(item);
-
- cmsPokemonList.Items.Add(separator);
-
- item = new ToolStripMenuItem();
- item.Text = "Transfer Clean Up (Keep highest IV)";
- item.Click += delegate { CleanUpTransferPokemon(pokemonObject, "IV"); };
- cmsPokemonList.Items.Add(item);
-
- item = new ToolStripMenuItem();
- item.Text = "Transfer Clean Up (Keep highest CP)";
- item.Click += delegate { CleanUpTransferPokemon(pokemonObject, "CP"); };
- cmsPokemonList.Items.Add(item);
-
- item = new ToolStripMenuItem();
- item.Text = "Evolve Clean Up (Highest IV)";
- item.Click += delegate { CleanUpEvolvePokemon(pokemonObject, "IV"); };
- cmsPokemonList.Items.Add(item);
-
- item = new ToolStripMenuItem();
- item.Text = "Evolve Clean Up (Highest CP)";
- item.Click += delegate { CleanUpEvolvePokemon(pokemonObject, "CP"); };
- cmsPokemonList.Items.Add(item);
-
- cmsPokemonList.Items.Add(separator);
- }**/
+ var pokemonObject = olvPokemonList.SelectedObjects.Cast<PokemonObject>().Select(o => o).First();
+
+ var item = new ToolStripMenuItem();
+ var separator = new ToolStripSeparator();
+ item.Text = "Transfer " + count + " pokemon";
+ item.Click += delegate { TransferPokemon(pokemons); };
+ cmsPokemonList.Items.Add(item);
+
+ item = new ToolStripMenuItem();
+ item.Text = "Rename";
+ /**item.Click += delegate
+ {
+ using (var form = count == 1 ? new NicknamePokemonForm(pokemonObject) : new NicknamePokemonForm())
+ {
+ if (form.ShowDialog() == DialogResult.OK)
+ {
+ NicknamePokemon(pokemons, form.txtNickname.Text);
+ }
+ }
+ };**/
+ cmsPokemonList.Items.Add(item);
+
+ if (canAllEvolve)
+ {
+ item = new ToolStripMenuItem();
+ item.Text = "Evolve " + count + " pokemon";
+ item.Click += delegate { EvolvePokemon(pokemons); };
+ cmsPokemonList.Items.Add(item);
+ }
+
+ if (count == 1)
+ {
+ item = new ToolStripMenuItem();
+ item.Text = "PowerUp";
+ item.Click += delegate { PowerUpPokemon(pokemons); };
+ cmsPokemonList.Items.Add(item);
+
+ cmsPokemonList.Items.Add(separator);
+
+ item = new ToolStripMenuItem();
+ item.Text = "Transfer Clean Up (Keep highest IV)";
+ item.Click += delegate { CleanUpTransferPokemon(pokemonObject, "IV"); };
+ cmsPokemonList.Items.Add(item);
+
+ item = new ToolStripMenuItem();
+ item.Text = "Transfer Clean Up (Keep highest CP)";
+ item.Click += delegate { CleanUpTransferPokemon(pokemonObject, "CP"); };
+ cmsPokemonList.Items.Add(item);
+
+ item = new ToolStripMenuItem();
+ item.Text = "Evolve Clean Up (Highest IV)";
+ item.Click += delegate { CleanUpEvolvePokemon(pokemonObject, "IV"); };
+ cmsPokemonList.Items.Add(item);
+
+ item = new ToolStripMenuItem();
+ item.Text = "Evolve Clean Up (Highest CP)";
+ item.Click += delegate { CleanUpEvolvePokemon(pokemonObject, "CP"); };
+ cmsPokemonList.Items.Add(item);
+
+ cmsPokemonList.Items.Add(separator);
+ }
};
}
+ private async void TransferPokemon(IEnumerable<PokemonData> pokemons)
+ {
+ SetState(false);
+ foreach (var pokemon in pokemons)
+ {
+ var transferPokemonResponse = await session.Client.Inventory.TransferPokemon(pokemon.Id);
+ if (transferPokemonResponse.Result == ReleasePokemonResponse.Types.Result.Success)
+ {
+ ColoredConsoleWrite(Color.Magenta,
+ $"{pokemon.PokemonId} was transferred. {transferPokemonResponse.CandyAwarded} candy awarded");
+ }
+ else
+ {
+ ColoredConsoleWrite(Color.Magenta, $"{pokemon.PokemonId} could not be transferred");
+ }
+ }
+ ReloadPokemonList();
+ }
+
+ private async void PowerUpPokemon(IEnumerable<PokemonData> pokemons)
+ {
+ SetState(false);
+ foreach (var pokemon in pokemons)
+ {
+ var evolvePokemonResponse = await session.Client.Inventory.UpgradePokemon(pokemon.Id);
+ if (evolvePokemonResponse.Result == UpgradePokemonResponse.Types.Result.Success)
+ {
+ ColoredConsoleWrite(Color.Magenta, $"{pokemon.PokemonId} successfully upgraded.");
+ }
+ else
+ {
+ ColoredConsoleWrite(Color.Magenta, $"{pokemon.PokemonId} could not be upgraded");
+ }
+ }
+ ReloadPokemonList();
+ }
+
+ private async void EvolvePokemon(IEnumerable<PokemonData> pokemons)
+ {
+ SetState(false);
+ foreach (var pokemon in pokemons)
+ {
+ var evolvePokemonResponse = await session.Client.Inventory.EvolvePokemon(pokemon.Id);
+ if (evolvePokemonResponse.Result == EvolvePokemonResponse.Types.Result.Success)
+ {
+ ColoredConsoleWrite(Color.Magenta,
+ $"{pokemon.PokemonId} successfully evolved into {evolvePokemonResponse.EvolvedPokemonData.PokemonId}\n{evolvePokemonResponse.ExperienceAwarded} experience awarded\n{evolvePokemonResponse.CandyAwarded} candy awarded");
+ }
+ else
+ {
+ ColoredConsoleWrite(Color.Magenta, $"{pokemon.PokemonId} could not be evolved");
+ }
+ }
+ ReloadPokemonList();
+ }
+
+ private void CleanUpTransferPokemon(PokemonObject pokemon, string type)
+ {
+ var ET = pokemon.EvolveTimes;
+ var pokemonCount =
+ olvPokemonList.Objects.Cast<PokemonObject>()
+ .Where(p => p.PokemonId == pokemon.PokemonId)
+ .Count();
+
+ if (pokemonCount < ET)
+ {
+ ReloadPokemonList();
+ return;
+ }
+
+ if (ET == 0)
+ ET = 1;
+
+ if (type.Equals("IV"))
+ {
+ var pokemons =
+ olvPokemonList.Objects.Cast<PokemonObject>()
+ .Where(p => p.PokemonId == pokemon.PokemonId)
+ .Select(p => p.PokemonData)
+ .OrderBy(p => p.Cp)
+ .OrderBy(PokemonInfo.CalculatePokemonPerfection)
+ .Take(pokemonCount - ET);
+
+ TransferPokemon(pokemons);
+ }
+ else if (type.Equals("CP"))
+ {
+ var pokemons =
+ olvPokemonList.Objects.Cast<PokemonObject>()
+ .Where(p => p.PokemonId == pokemon.PokemonId)
+ .Select(p => p.PokemonData)
+ .OrderBy(PokemonInfo.CalculatePokemonPerfection)
+ .OrderBy(p => p.Cp)
+ .Take(pokemonCount - ET);
+
+ TransferPokemon(pokemons);
+ }
+ }
+
+ private void CleanUpEvolvePokemon(PokemonObject pokemon, string type)
+ {
+ var ET = pokemon.EvolveTimes;
+
+ if (ET < 1)
+ {
+ ReloadPokemonList();
+ return;
+ }
+
+ if (type.Equals("IV"))
+ {
+ var pokemons =
+ olvPokemonList.Objects.Cast<PokemonObject>()
+ .Where(p => p.PokemonId == pokemon.PokemonId)
+ .Select(p => p.PokemonData)
+ .OrderByDescending(p => p.Cp)
+ .OrderByDescending(PokemonInfo.CalculatePokemonPerfection)
+ .Take(ET);
+
+ EvolvePokemon(pokemons);
+ }
+ else if (type.Equals("CP"))
+ {
+ var pokemons =
+ olvPokemonList.Objects.Cast<PokemonObject>()
+ .Where(p => p.PokemonId == pokemon.PokemonId)
+ .Select(p => p.PokemonData)
+ .OrderByDescending(PokemonInfo.CalculatePokemonPerfection)
+ .OrderByDescending(p => p.Cp)
+ .Take(ET);
+
+ EvolvePokemon(pokemons);
+ }
+ }
private Image GetPokemonImage(int pokemonId)
{
- return (Image) Properties.Resources.ResourceManager.GetObject("Pokemon_" + pokemonId);
+ return (Image)Properties.Resources.ResourceManager.GetObject("Pokemon_" + pokemonId);
}
private async Task ReloadPokemonList()
{
SetState(false);
-
try
{
+ await session.Inventory.RefreshCachedInventory();
var itemTemplates = await session.Client.Download.GetItemTemplates();
var inventory = await session.Inventory.GetCachedInventory();
var profile = await session.Client.Player.GetPlayer();
@@ -426,7 +562,7 @@ namespace PokemonGo.RocketBot.Window
{
var pokemonObject = new PokemonObject(pokemon);
var family =
- families.Where(i => (int) i.FamilyId <= (int) pokemon.PokemonId)
+ families.Where(i => (int)i.FamilyId <= (int)pokemon.PokemonId)
.First();
pokemonObject.Candy = family.Candy_;
pokemonObjects.Add(pokemonObject);
@@ -459,14 +595,14 @@ namespace PokemonGo.RocketBot.Window
.Sum(i => i.Count) + 1;
flpItems.Controls.Clear();
- /** foreach (var item in items)
- {
- var box = new ItemBox(item);
- if (appliedItems.ContainsKey(item.ItemId))
- box.expires = appliedItems[item.ItemId];
- box.ItemClick += ItemBox_ItemClick;
- flpItems.Controls.Add(box);
- } **/
+ foreach (var item in items)
+ {
+ var box = new ItemBox(item);
+ if (appliedItems.ContainsKey(item.ItemId))
+ box.expires = appliedItems[item.ItemId];
+ box.ItemClick += ItemBox_ItemClick;
+ flpItems.Controls.Add(box);
+ }
lblInventory.Text = itemscount + " / " + profile.PlayerData.MaxItemStorage;
}
@@ -490,6 +626,90 @@ namespace PokemonGo.RocketBot.Window
SetState(true);
}
+ private async void ItemBox_ItemClick(object sender, EventArgs e)
+ {
+ var item = (ItemData)sender;
+
+ using (var form = new ItemForm(item))
+ {
+ var result = form.ShowDialog();
+ if (result == DialogResult.OK)
+ {
+ SetState(false);
+ if (item.ItemId == ItemId.ItemLuckyEgg)
+ {
+ if (session.Client == null)
+ {
+ ColoredConsoleWrite(Color.Red, $"Bot must be running first!");
+ SetState(true);
+ return;
+ }
+ var response = await session.Client.Inventory.UseItemXpBoost();
+ if (response.Result == UseItemXpBoostResponse.Types.Result.Success)
+ {
+ ColoredConsoleWrite(Color.Green, $"Using a Lucky Egg");
+ ColoredConsoleWrite(Color.Yellow, $"Lucky Egg valid until: {DateTime.Now.AddMinutes(30)}");
+ }
+ else if (response.Result == UseItemXpBoostResponse.Types.Result.ErrorXpBoostAlreadyActive)
+ {
+ ColoredConsoleWrite(Color.Orange, $"A Lucky Egg is already active!");
+ }
+ else if (response.Result == UseItemXpBoostResponse.Types.Result.ErrorLocationUnset)
+ {
+ ColoredConsoleWrite(Color.Red, $"Bot must be running first!");
+ }
+ else
+ {
+ ColoredConsoleWrite(Color.Red, $"Failed using a Lucky Egg!");
+ }
+ }
+ else if (item.ItemId == ItemId.ItemIncenseOrdinary)
+ {
+ if (session.Client == null)
+ {
+ ColoredConsoleWrite(Color.Red, $"Bot must be running first!");
+ SetState(true);
+ return;
+ }
+ var response = await session.Client.Inventory.UseIncense(ItemId.ItemIncenseOrdinary);
+ if (response.Result == UseIncenseResponse.Types.Result.Success)
+ {
+ ColoredConsoleWrite(Color.Green, $"Using an incense");
+ ColoredConsoleWrite(Color.Yellow, $"Incense valid until: {DateTime.Now.AddMinutes(30)}");
+ }
+ else if (response.Result == UseIncenseResponse.Types.Result.IncenseAlreadyActive)
+ {
+ ColoredConsoleWrite(Color.Orange, $"An incense is already active!");
+ }
+ else if (response.Result == UseIncenseResponse.Types.Result.LocationUnset)
+ {
+ ColoredConsoleWrite(Color.Red, $"Bot must be running first!");
+ }
+ else
+ {
+ ColoredConsoleWrite(Color.Red, $"Failed using an incense!");
+ }
+ }
+ else
+ {
+ var response =
+ await session.Client.Inventory.RecycleItem(item.ItemId, decimal.ToInt32(form.numCount.Value));
+ if (response.Result == RecycleInventoryItemResponse.Types.Result.Success)
+ {
+ ColoredConsoleWrite(Color.DarkCyan,
+ $"Recycled {decimal.ToInt32(form.numCount.Value)}x {item.ItemId.ToString().Substring(4)}");
+ }
+ else
+ {
+ ColoredConsoleWrite(Color.Red,
+ $"Unable to recycle {decimal.ToInt32(form.numCount.Value)}x {item.ItemId.ToString().Substring(4)}");
+ }
+ }
+ ReloadPokemonList();
+ }
+ }
+ }
+
private void SetState(bool state)
{
btnRefresh.Enabled = state;
diff --git a/PokemonGo.RocketBot.Window/PokemonGo.RocketBot.Window.csproj b/PokemonGo.RocketBot.Window/PokemonGo.RocketBot.Window.csproj
index 114467a..72d1eb6 100644
--- a/PokemonGo.RocketBot.Window/PokemonGo.RocketBot.Window.csproj
+++ b/PokemonGo.RocketBot.Window/PokemonGo.RocketBot.Window.csproj
@@ -130,6 +130,18 @@
<ItemGroup>
<Compile Include="ConsoleEventListener.cs" />
<Compile Include="ConsoleLogger.cs" />
+ <Compile Include="ItemBox.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="ItemBox.designer.cs">
+ <DependentUpon>ItemBox.cs</DependentUpon>
+ </Compile>
+ <Compile Include="ItemForm.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="ItemForm.designer.cs">
+ <DependentUpon>ItemForm.cs</DependentUpon>
+ </Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
@@ -469,6 +481,9 @@
<Content Include="Resources\Icon.ico" />
</ItemGroup>
<ItemGroup>
+ <EmbeddedResource Include="ItemBox.resx">
+ <DependentUpon>ItemBox.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
You may download the files in Public Git.