diff --git a/src/RocketAPI/Helpers/Utils.cs b/src/RocketAPI/Helpers/Utils.cs
index 81d0f7e..1b71286 100644
--- a/src/RocketAPI/Helpers/Utils.cs
+++ b/src/RocketAPI/Helpers/Utils.cs
@@ -15,6 +15,10 @@ namespace PokemonGo.RocketAPI.Helpers
var bytes = BitConverter.GetBytes(value);
return BitConverter.ToUInt64(bytes, 0);
}
+
+ public static DateTime FromUnixTimeUtc(long time) {
+ return new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(time);
+ }
}
/// <summary>
diff --git a/src/RocketAPI/PokemonGo.RocketAPI.csproj b/src/RocketAPI/PokemonGo.RocketAPI.csproj
index 71f8e5e..932802c 100644
--- a/src/RocketAPI/PokemonGo.RocketAPI.csproj
+++ b/src/RocketAPI/PokemonGo.RocketAPI.csproj
@@ -130,6 +130,11 @@
<Compile Include="Login\GoogleLogin.cs" />
<Compile Include="Login\ILoginType.cs" />
<Compile Include="Login\PtcLogin.cs" />
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
<Compile Include="Rpc\BaseRpc.cs" />
<Compile Include="Rpc\Download.cs" />
<Compile Include="Rpc\Encounter.cs" />
@@ -156,6 +161,17 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
+ <ItemGroup>
+ <Content Include="Resources\encrypt.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/src/RocketAPI/Properties/Resources.Designer.cs b/src/RocketAPI/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..88e8347
--- /dev/null
+++ b/src/RocketAPI/Properties/Resources.Designer.cs
@@ -0,0 +1,73 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace PokemonGo.RocketAPI.Properties {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PokemonGo.RocketAPI.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized resource of type System.Byte[].
+ /// </summary>
+ internal static byte[] encrypt {
+ get {
+ object obj = ResourceManager.GetObject("encrypt", resourceCulture);
+ return ((byte[])(obj));
+ }
+ }
+ }
+}
diff --git a/src/RocketAPI/Properties/Resources.resx b/src/RocketAPI/Properties/Resources.resx
new file mode 100644
index 0000000..9ed4551
--- /dev/null
+++ b/src/RocketAPI/Properties/Resources.resx
@@ -0,0 +1,124 @@
+<?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>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="encrypt" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\encrypt.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+</root>
\ No newline at end of file
diff --git a/src/RocketAPI/Resources/encrypt.dll b/src/RocketAPI/Resources/encrypt.dll
new file mode 100644
index 0000000..1565c46
Binary files /dev/null and b/src/RocketAPI/Resources/encrypt.dll differ
diff --git a/src/RocketBotGUI/ItemBox.Designer.cs b/src/RocketBotGUI/ItemBox.Designer.cs
index 10ec543..d52b847 100644
--- a/src/RocketBotGUI/ItemBox.Designer.cs
+++ b/src/RocketBotGUI/ItemBox.Designer.cs
@@ -23,14 +23,17 @@
/// 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)
+ 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)));
@@ -45,7 +48,7 @@
//
// pb
//
- this.pb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ 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);
@@ -56,10 +59,31 @@
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;
@@ -74,5 +98,7 @@
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/src/RocketBotGUI/ItemBox.cs b/src/RocketBotGUI/ItemBox.cs
index 636b909..65e0f51 100644
--- a/src/RocketBotGUI/ItemBox.cs
+++ b/src/RocketBotGUI/ItemBox.cs
@@ -2,11 +2,15 @@
using System.Drawing;
using System.Windows.Forms;
using POGOProtos.Inventory.Item;
+using System.Collections.Generic;
+using POGOProtos.Inventory;
namespace PokemonGo.RocketAPI.Window
{
public partial class ItemBox : UserControl
{
+ public DateTime expires = new DateTime(0);
+
public ItemBox(ItemData item)
{
InitializeComponent();
@@ -15,6 +19,7 @@ namespace PokemonGo.RocketAPI.Window
pb.Image = (Image) Properties.Resources.ResourceManager.GetObject(item.ItemId.ToString());
lbl.Text = item.Count.ToString();
+ lblTime.Parent = pb;
foreach (Control control in Controls)
{
@@ -23,7 +28,7 @@ namespace PokemonGo.RocketAPI.Window
control.MouseClick += childMouseClick;
}
- if (item_.ItemId == ItemId.ItemIncubatorBasic || item_.ItemId == ItemId.ItemIncubatorBasicUnlimited)
+ if (item_.ItemId == ItemId.ItemIncubatorBasic || item_.ItemId == ItemId.ItemIncubatorBasicUnlimited || item.Count < 1)
{
Enabled = false;
}
@@ -74,5 +79,15 @@ namespace PokemonGo.RocketAPI.Window
handler(item, e);
}
}
+
+ private void tmr_Tick(object sender, EventArgs e) {
+ TimeSpan 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/src/RocketBotGUI/ItemBox.resx b/src/RocketBotGUI/ItemBox.resx
new file mode 100644
index 0000000..d3ab77a
--- /dev/null
+++ b/src/RocketBotGUI/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/src/RocketBotGUI/MainForm.cs b/src/RocketBotGUI/MainForm.cs
index 3abb964..03a2956 100644
--- a/src/RocketBotGUI/MainForm.cs
+++ b/src/RocketBotGUI/MainForm.cs
@@ -1531,6 +1531,17 @@ namespace PokemonGo.RocketAPI.Window
var profile = await _client2.Player.GetPlayer();
var itemTemplates = await _client2.Download.GetItemTemplates();
+ var appliedItems = new Dictionary<ItemId, DateTime>();
+ var inventoryAppliedItems = inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.AppliedItems);
+
+ foreach (AppliedItems aItems in inventoryAppliedItems) {
+ if (aItems != null && aItems.Item != null) {
+ foreach (AppliedItem item in aItems.Item) {
+ appliedItems.Add(item.ItemId, Utils.FromUnixTimeUtc(item.ExpireMs));
+ }
+ }
+ }
+
PokemonObject.Initilize(itemTemplates);
var pokemons =
@@ -1571,10 +1582,13 @@ namespace PokemonGo.RocketAPI.Window
pokemoncount + " pokemon, " + eggcount + " eggs)";
var items =
- inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.Item)
- .Where(i => i != null && i.Count > 0);
+ inventory.InventoryDelta.InventoryItems
+ .Select(i => i.InventoryItemData?.Item)
+ .Where(i => i != null)
+ .OrderBy(i => i.ItemId);
var itemscount =
- inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.Item)
+ inventory.InventoryDelta.InventoryItems
+ .Select(i => i.InventoryItemData?.Item)
.Where(i => i != null)
.Sum(i => i.Count) + 1;
@@ -1582,13 +1596,14 @@ namespace PokemonGo.RocketAPI.Window
foreach (var item in items)
{
var box = new ItemBox(item);
- box.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom;
+ if (appliedItems.ContainsKey(item.ItemId))
+ box.expires = appliedItems[item.ItemId];
box.ItemClick += ItemBox_ItemClick;
- ;
flpItems.Controls.Add(box);
}
lblInventory.Text = itemscount + " / " + profile.PlayerData.MaxItemStorage;
+
}
catch (GoogleException ex)
{
@@ -1629,12 +1644,11 @@ namespace PokemonGo.RocketAPI.Window
SetState(true);
return;
}
-
var response = await _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)}");
+ ColoredConsoleWrite(Color.Yellow, $"Lucky Egg valid until: {DateTime.Now.AddMinutes(30)}");
}
else if (response.Result == UseItemXpBoostResponse.Types.Result.ErrorXpBoostAlreadyActive)
{
@@ -1651,6 +1665,22 @@ namespace PokemonGo.RocketAPI.Window
}
else if (item.ItemId == ItemId.ItemIncenseOrdinary)
{
+ if (!_botStarted) {
+ ColoredConsoleWrite(Color.Red, $"Bot must be running first!");
+ SetState(true);
+ return;
+ }
+ var response = await _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
{
diff --git a/src/RocketBotGUI/PokemonGo.RocketBot.csproj b/src/RocketBotGUI/PokemonGo.RocketBot.csproj
index 70dd1ca..812ecbd 100644
--- a/src/RocketBotGUI/PokemonGo.RocketBot.csproj
+++ b/src/RocketBotGUI/PokemonGo.RocketBot.csproj
@@ -117,6 +117,9 @@
<Compile Include="SettingsForm.Designer.cs">
<DependentUpon>SettingsForm.cs</DependentUpon>
</Compile>
+ <EmbeddedResource Include="ItemBox.resx">
+ <DependentUpon>ItemBox.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
@@ -338,9 +341,7 @@
<None Include="Images\Items\ItemUltraBall.png" />
<None Include="Images\Items\ItemWeparBerry.png" />
</ItemGroup>
- <ItemGroup>
- <Folder Include="Resources\" />
- </ItemGroup>
+ <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
You may download the files in Public Git.