diff --git a/Pokemon Go Rocket API.sln b/Pokemon Go Rocket API.sln
index 7e41e44..13123b8 100644
--- a/Pokemon Go Rocket API.sln
+++ b/Pokemon Go Rocket API.sln
@@ -5,8 +5,6 @@ VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PokemonGo.RocketAPI", "PokemonGo\RocketAPI\PokemonGo.RocketAPI.csproj", "{05D2DA44-1B8E-4CF7-94ED-4D52451CD095}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PokemonGo.RocketAPI.Console", "PokemonGo\RocketAPI\Console\PokemonGo.RocketAPI.Console.csproj", "{1FEA147E-F704-497B-A538-00B053B5F672}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PokemonGo.RocketAPI.Window", "PokemonGo\RocketAPI\Window\PokemonGo.RocketAPI.Window.csproj", "{C85B9D78-9CA3-4830-84CD-6B69090B987F}"
EndProject
Global
@@ -19,10 +17,6 @@ Global
{05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Release|Any CPU.Build.0 = Release|Any CPU
- {1FEA147E-F704-497B-A538-00B053B5F672}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1FEA147E-F704-497B-A538-00B053B5F672}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1FEA147E-F704-497B-A538-00B053B5F672}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1FEA147E-F704-497B-A538-00B053B5F672}.Release|Any CPU.Build.0 = Release|Any CPU
{C85B9D78-9CA3-4830-84CD-6B69090B987F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C85B9D78-9CA3-4830-84CD-6B69090B987F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C85B9D78-9CA3-4830-84CD-6B69090B987F}.Release|Any CPU.ActiveCfg = Release|Any CPU
diff --git a/PokemonGo/RocketAPI/Client.cs b/PokemonGo/RocketAPI/Client.cs
index 7e247ea..94ccfa9 100644
--- a/PokemonGo/RocketAPI/Client.cs
+++ b/PokemonGo/RocketAPI/Client.cs
@@ -98,9 +98,9 @@ namespace PokemonGo.RocketAPI
string token = _GPSOresponse["Token"];
Dictionary<string, string> oauthResponse = _GPSOclient.PerformOAuth(
token,
-"audience:server:client_id:848232511240-7so421jotr2609rmqakceuu1luuq0ptb.apps.googleusercontent.com",
-"com.nianticlabs.pokemongo",
-"321187995bc7cdc2b5fc91b11a96e2baa8602c62");
+ "audience:server:client_id:848232511240-7so421jotr2609rmqakceuu1luuq0ptb.apps.googleusercontent.com",
+ "com.nianticlabs.pokemongo",
+ "321187995bc7cdc2b5fc91b11a96e2baa8602c62");
/* string oauthJson = JsonConvert.SerializeObject(oauthResponse, Formatting.Indented);
Console.WriteLine(oauthJson); */
_accessToken = oauthResponse["Auth"];
@@ -159,26 +159,26 @@ namespace PokemonGo.RocketAPI
}
- public async Task<EvolvePokemonOut> PowerUp(ulong pokemonId)
- {
- var customRequest = new EvolvePokemon
- {
- PokemonId = pokemonId
- };
-
- var releasePokemonRequest = RequestBuilder.GetRequest(_unknownAuth, _currentLat, _currentLng, 30,
- new Request.Types.Requests
- {
- Type = (int)RequestType.UPGRADE_POKEMON,
- Message = customRequest.ToByteString()
- });
- return
- await
- _httpClient.PostProtoPayload<Request, EvolvePokemonOut>($"https://{_apiUrl}/rpc",
- releasePokemonRequest);
- }
-
- private async Task<MiscEnums.Item> GetBestBall(int? pokemonCP)
+ public async Task<EvolvePokemonOut> PowerUp(ulong pokemonId)
+ {
+ var customRequest = new EvolvePokemon
+ {
+ PokemonId = pokemonId
+ };
+
+ var releasePokemonRequest = RequestBuilder.GetRequest(_unknownAuth, _currentLat, _currentLng, 30,
+ new Request.Types.Requests
+ {
+ Type = (int)RequestType.UPGRADE_POKEMON,
+ Message = customRequest.ToByteString()
+ });
+ return
+ await
+ _httpClient.PostProtoPayload<Request, EvolvePokemonOut>($"https://{_apiUrl}/rpc",
+ releasePokemonRequest);
+ }
+
+ private async Task<MiscEnums.Item> GetBestBall(int? pokemonCP)
{
var inventory = await GetInventory();
@@ -377,8 +377,8 @@ namespace PokemonGo.RocketAPI
{
_currentLat = lat;
_currentLng = lng;
-// _settings.DefaultLatitude = lat;
-// _settings.DefaultLongitude = lng;
+ // _settings.DefaultLatitude = lat;
+ // _settings.DefaultLongitude = lng;
}
public async Task SetServer()
diff --git a/PokemonGo/RocketAPI/Console/App.config b/PokemonGo/RocketAPI/Console/App.config
deleted file mode 100644
index 1369910..0000000
--- a/PokemonGo/RocketAPI/Console/App.config
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
- </startup>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
- <appSettings>
- <add key="AuthType" value="Google" /> <!--Google/Ptc-->
- <add key="PtcUsername" value="username" /> <!--Username-->
- <add key="PtcPassword" value="pw" /> <!--Password-->
- <add key="Email" value="" />
- <add key="Password" value="" />
- <add key="GoogleRefreshToken" value="" />
- <add key="DefaultLatitude" value="45.030152" /> <!--Default Viaduct Harbour, Auckland, New Zealand-->
- <add key="DefaultLongitude" value="-93.31931" /> <!--Default Viaduct Harbour, Auckland, New Zealand-->
- <add key="LevelOutput" value="levelup" /> <!--2 Modes: "time": Every XXX seconds and "levelup" every levelup-->
- <add key="LevelTimeInterval" value="1" /> <!--Pick 1 if levelup and time in seconds if "time"-->
- <add key="Recycler" value="true" /> <!--Recycler master switch-->
- <add key="RecycleItemsInterval" value="60" /> <!--Recycle Interval in seconds-->
- <add key="Language" value="english" /> <!--Languages english/german-->
- <add key="RazzBerryMode" value="probability" /> <!--When to use RazzBerry cp/probability-->
- <add key="RazzBerrySetting" value="0.4" /> <!--Cp Mode: Use RazzBerry when Pokemon is over this value; pobability Mode: Use Razzberry when % between 0 and 1 of catching is under this value-->
- <add key="TransferType" value="duplicate" /> <!--none/cp/iv/leaveStrongest/duplicate/all Whitelists/blackslists for each type is in Program.cs-->
- <add key="TransferCPThreshold" value="0" /> <!--transfer pokemon with CP less than this value if cp transfer type is selected. Whitelist in Program.cs-->
- <add key="TransferIVThreshold" value="80" /> <!--transfer pokemon with IV less than this value if iv transfer type is selected. Whitelist in Program.cs-->
- <add key="EvolveAllGivenPokemons" value="true" />
- <add key="ClientSettingsProvider.ServiceUri" value="" />
- </appSettings>
- <system.web>
- <membership defaultProvider="ClientAuthenticationMembershipProvider">
- <providers>
- <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
- </providers>
- </membership>
- <roleManager defaultProvider="ClientRoleProvider" enabled="true">
- <providers>
- <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
- </providers>
- </roleManager>
- </system.web>
-</configuration>
diff --git a/PokemonGo/RocketAPI/Console/PokemonGo.RocketAPI.Console.csproj b/PokemonGo/RocketAPI/Console/PokemonGo.RocketAPI.Console.csproj
deleted file mode 100644
index 615f12d..0000000
--- a/PokemonGo/RocketAPI/Console/PokemonGo.RocketAPI.Console.csproj
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProjectGuid>{1FEA147E-F704-497B-A538-00B053B5F672}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>PokemonGo.RocketAPI.Console</RootNamespace>
- <AssemblyName>PokemonGo.RocketAPI.Console</AssemblyName>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <PlatformTarget>AnyCPU</PlatformTarget>
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <PlatformTarget>AnyCPU</PlatformTarget>
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
- <HintPath>..\..\..\packages\Google.Protobuf.3.0.0-beta3\lib\dotnet\Google.Protobuf.dll</HintPath>
- <Private>True</Private>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Configuration" />
- <Reference Include="System.Core" />
- <Reference Include="System.Web.Extensions" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Data" />
- <Reference Include="System.Net.Http" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Settings.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="App.config" />
- <None Include="packages.config" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\PokemonGo.RocketAPI.csproj">
- <Project>{05D2DA44-1B8E-4CF7-94ED-4D52451CD095}</Project>
- <Name>PokemonGo.RocketAPI</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include=".NETFramework,Version=v4.5">
- <Visible>False</Visible>
- <ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- </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.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
\ No newline at end of file
diff --git a/PokemonGo/RocketAPI/Console/Program.cs b/PokemonGo/RocketAPI/Console/Program.cs
deleted file mode 100644
index 1c11260..0000000
--- a/PokemonGo/RocketAPI/Console/Program.cs
+++ /dev/null
@@ -1,746 +0,0 @@
-#region
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Net;
-using System.Reflection;
-using System.Text.RegularExpressions;
-using System.Threading;
-using System.Threading.Tasks;
-using AllEnum;
-using System.Xml;
-using PokemonGo.RocketAPI.Enums;
-using PokemonGo.RocketAPI.Exceptions;
-using PokemonGo.RocketAPI.Extensions;
-using PokemonGo.RocketAPI.GeneratedCode;
-using System.Net.Http;
-using System.Text;
-using Google.Protobuf;
-using PokemonGo.RocketAPI.Helpers;
-using System.IO;
-
-
-#endregion
-
-namespace PokemonGo.RocketAPI.Console
-{
- internal class Program
- {
- private static ISettings ClientSettings = new Settings();
- private static int Currentlevel = -1;
- private static int TotalExperience = 0;
- private static int TotalPokemon = 0;
- private static DateTime TimeStarted = DateTime.Now;
- public static DateTime InitSessionDateTime = DateTime.Now;
-
- public static double GetRuntime()
- {
- return ((DateTime.Now - TimeStarted).TotalSeconds) / 3600;
- }
-
- public static void CheckVersion()
- {
- try
- {
- var match =
- new Regex(
- @"\[assembly\: AssemblyVersion\(""(\d{1,})\.(\d{1,})\.(\d{1,})\.(\d{1,})""\)\]")
- .Match(DownloadServerVersion());
-
- if (!match.Success) return;
- var gitVersion =
- new Version(
- string.Format(
- "{0}.{1}.{2}.{3}",
- match.Groups[1],
- match.Groups[2],
- match.Groups[3],
- match.Groups[4]));
- if (gitVersion <= Assembly.GetExecutingAssembly().GetName().Version)
- {
- ColoredConsoleWrite(ConsoleColor.Green, "Awesome! You have already got the newest version! " + Assembly.GetExecutingAssembly().GetName().Version);
- return;
- }
-
- ColoredConsoleWrite(ConsoleColor.Red, "There is a new Version available: " + gitVersion);
- ColoredConsoleWrite(ConsoleColor.Red, "You can find it at https://github.com/DetectiveSquirrel/Pokemon-Go-Rocket-API");
- }
- catch (Exception)
- {
- ColoredConsoleWrite(ConsoleColor.Red, "Unable to check for updates now...");
- }
- }
-
- private static string DownloadServerVersion()
- {
- using (var wC = new WebClient())
- return
- wC.DownloadString(
- "https://raw.githubusercontent.com/DetectiveSquirrel/Pokemon-Go-Rocket-API/master/PokemonGo/RocketAPI/Console/Properties/AssemblyInfo.cs");
- }
-
- public static void ColoredConsoleWrite(ConsoleColor color, string text)
- {
- ConsoleColor originalColor = System.Console.ForegroundColor;
- System.Console.ForegroundColor = color;
- System.Console.WriteLine("[" + DateTime.Now.ToString("HH:mm:ss tt") + "] " + text);
- File.AppendAllText(AppDomain.CurrentDomain.BaseDirectory + @"\Logs.txt", "[" + DateTime.Now.ToString("HH:mm:ss tt") + "] " + text + "\n");
- System.Console.ForegroundColor = originalColor;
- }
-
- private static async Task EvolveAllGivenPokemons(Client client, IEnumerable<PokemonData> pokemonToEvolve)
- {
- foreach (var pokemon in pokemonToEvolve)
- {
- /*
- enum Holoholo.Rpc.Types.EvolvePokemonOutProto.Result {
- UNSET = 0;
- SUCCESS = 1;
- FAILED_POKEMON_MISSING = 2;
- FAILED_INSUFFICIENT_RESOURCES = 3;
- FAILED_POKEMON_CANNOT_EVOLVE = 4;
- FAILED_POKEMON_IS_DEPLOYED = 5;
- }
- }*/
-
- var countOfEvolvedUnits = 0;
- var xpCount = 0;
-
- EvolvePokemonOut evolvePokemonOutProto;
- do
- {
- evolvePokemonOutProto = await client.EvolvePokemon(pokemon.Id);
- //todo: someone check whether this still works
-
- if (evolvePokemonOutProto.Result == 1)
- {
- ColoredConsoleWrite(ConsoleColor.Cyan,
- $"Evolved {pokemon.PokemonId} successfully for {evolvePokemonOutProto.ExpAwarded}xp");
-
- countOfEvolvedUnits++;
- xpCount += evolvePokemonOutProto.ExpAwarded;
- }
- else
- {
- var result = evolvePokemonOutProto.Result;
- /*
- ColoredConsoleWrite(ConsoleColor.White, $"Failed to evolve {pokemon.PokemonId}. " +
- $"EvolvePokemonOutProto.Result was {result}");
-
- ColoredConsoleWrite(ConsoleColor.White, $"Due to above error, stopping evolving {pokemon.PokemonId}");
- */
- }
- } while (evolvePokemonOutProto.Result == 1);
- if (countOfEvolvedUnits > 0)
- ColoredConsoleWrite(ConsoleColor.Cyan,
- $"Evolved {countOfEvolvedUnits} pieces of {pokemon.PokemonId} for {xpCount}xp");
-
- await Task.Delay(3000);
- }
- }
-
- private static async void Execute()
- {
- var client = new Client(ClientSettings);
- try
- {
- switch (ClientSettings.AuthType)
- {
- case AuthType.Ptc:
- await client.DoPtcLogin(ClientSettings.PtcUsername, ClientSettings.PtcPassword);
- break;
- case AuthType.Google:
- await client.DoGoogleLogin(ClientSettings.Email, ClientSettings.Password);
- break;
- }
-
- await client.SetServer();
- var profile = await client.GetProfile();
- var settings = await client.GetSettings();
- var mapObjects = await client.GetMapObjects();
- var inventory = await client.GetInventory();
- var pokemons =
- inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.Pokemon)
- .Where(p => p != null && p?.PokemonId > 0);
-
- ConsoleLevelTitle(profile.Profile.Username, client);
-
- // Write the players ingame details
- ColoredConsoleWrite(ConsoleColor.Yellow, "----------------------------");
- if (ClientSettings.AuthType == AuthType.Ptc)
- {
- ColoredConsoleWrite(ConsoleColor.Cyan, "Account: " + ClientSettings.PtcUsername);
- ColoredConsoleWrite(ConsoleColor.Cyan, "Password: " + ClientSettings.PtcPassword + "\n");
- }
- else
- {
- ColoredConsoleWrite(ConsoleColor.Cyan, "Email: " + ClientSettings.Email);
- ColoredConsoleWrite(ConsoleColor.Cyan, "Password: " + ClientSettings.Password + "\n");
- }
- ColoredConsoleWrite(ConsoleColor.DarkGray, "Name: " + profile.Profile.Username);
- ColoredConsoleWrite(ConsoleColor.DarkGray, "Team: " + profile.Profile.Team);
- if (profile.Profile.Currency.ToArray()[0].Amount > 0) // If player has any pokecoins it will show how many they have.
- ColoredConsoleWrite(ConsoleColor.DarkGray, "Pokecoins: " + profile.Profile.Currency.ToArray()[0].Amount);
- ColoredConsoleWrite(ConsoleColor.DarkGray, "Stardust: " + profile.Profile.Currency.ToArray()[1].Amount + "\n");
- ColoredConsoleWrite(ConsoleColor.DarkGray, "Latitude: " + ClientSettings.DefaultLatitude);
- ColoredConsoleWrite(ConsoleColor.DarkGray, "Longitude: " + ClientSettings.DefaultLongitude);
- try
- {
- ColoredConsoleWrite(ConsoleColor.DarkGray, "Area: " + CallAPI("place", ClientSettings.DefaultLatitude, ClientSettings.DefaultLongitude));
- ColoredConsoleWrite(ConsoleColor.DarkGray, "Country: " + CallAPI("country", ClientSettings.DefaultLatitude, ClientSettings.DefaultLongitude));
- }
- catch (Exception)
- {
- ColoredConsoleWrite(ConsoleColor.DarkGray, "Unable to get Country/Place");
- }
-
- ColoredConsoleWrite(ConsoleColor.Yellow, "----------------------------");
-
- // I believe a switch is more efficient and easier to read.
- switch (ClientSettings.TransferType)
- {
- case "leaveStrongest":
- await TransferAllButStrongestUnwantedPokemon(client);
- break;
- case "all":
- await TransferAllGivenPokemons(client, pokemons);
- break;
- case "duplicate":
- await TransferDuplicatePokemon(client);
- break;
- case "cp":
- await TransferAllWeakPokemon(client, ClientSettings.TransferCPThreshold);
- break;
- case "iv":
- await TransferAllGivenPokemons(client, pokemons, ClientSettings.TransferIVThreshold);
- break;
- default:
- ColoredConsoleWrite(ConsoleColor.DarkGray, "Transfering pokemon disabled");
- break;
- }
-
- if (ClientSettings.EvolveAllGivenPokemons)
- await EvolveAllGivenPokemons(client, pokemons);
- if (ClientSettings.Recycler)
- client.RecycleItems(client);
-
- await Task.Delay(5000);
- PrintLevel(client);
- await ExecuteFarmingPokestopsAndPokemons(client);
- ColoredConsoleWrite(ConsoleColor.Red, $"No nearby useful locations found. Please wait 10 seconds.");
- await Task.Delay(10000);
- CheckVersion();
- Execute();
- }
- catch (TaskCanceledException) { ColoredConsoleWrite(ConsoleColor.Red, "Task Canceled Exception - Restarting"); Execute(); }
- catch (UriFormatException) { ColoredConsoleWrite(ConsoleColor.Red, "System URI Format Exception - Restarting"); Execute(); }
- catch (ArgumentOutOfRangeException) { ColoredConsoleWrite(ConsoleColor.Red, "ArgumentOutOfRangeException - Restarting"); Execute(); }
- catch (ArgumentNullException) { ColoredConsoleWrite(ConsoleColor.Red, "Argument Null Refference - Restarting"); Execute(); }
- catch (NullReferenceException) { ColoredConsoleWrite(ConsoleColor.Red, "Null Refference - Restarting"); Execute(); }
- catch (Exception ex) { ColoredConsoleWrite(ConsoleColor.Red, ex.ToString()); Execute(); }
- }
-
- private static string CallAPI(string elem, double lat, double lon)
- {
- using (XmlReader reader = XmlReader.Create(@"http://api.geonames.org/findNearby?lat=" + lat + "&lng=" + lon + "&username=demo"))
- {
- while (reader.Read())
- {
- if (reader.IsStartElement())
- {
- switch (elem)
- {
- case "country":
- if (reader.Name == "countryName")
- {
- return reader.ReadString();
- }
- break;
-
- case "place":
- if (reader.Name == "toponymName")
- {
- return reader.ReadString();
- }
- break;
- default:
- return "N/A";
- break;
- }
- }
- }
- }
- return "Error";
- }
-
- private static async Task ExecuteCatchAllNearbyPokemons(Client client)
- {
- var mapObjects = await client.GetMapObjects();
-
- var pokemons = mapObjects.MapCells.SelectMany(i => i.CatchablePokemons);
-
- var inventory2 = await client.GetInventory();
- var pokemons2 = inventory2.InventoryDelta.InventoryItems
- .Select(i => i.InventoryItemData?.Pokemon)
- .Where(p => p != null && p?.PokemonId > 0)
- .ToArray();
-
- foreach (var pokemon in pokemons)
- {
- var update = await client.UpdatePlayerLocation(pokemon.Latitude, pokemon.Longitude);
- var encounterPokemonResponse = await client.EncounterPokemon(pokemon.EncounterId, pokemon.SpawnpointId);
- var pokemonCP = encounterPokemonResponse?.WildPokemon?.PokemonData?.Cp;
- var pokemonIV = Perfect(encounterPokemonResponse?.WildPokemon?.PokemonData);
- CatchPokemonResponse caughtPokemonResponse;
- do
- {
- if (ClientSettings.RazzBerryMode == "cp")
- if (pokemonCP > ClientSettings.RazzBerrySetting)
- await client.UseRazzBerry(client, pokemon.EncounterId, pokemon.SpawnpointId);
- if (ClientSettings.RazzBerryMode == "probability")
- if (encounterPokemonResponse.CaptureProbability.CaptureProbability_.First() < ClientSettings.RazzBerrySetting)
- await client.UseRazzBerry(client, pokemon.EncounterId, pokemon.SpawnpointId);
- caughtPokemonResponse = await client.CatchPokemon(pokemon.EncounterId, pokemon.SpawnpointId, pokemon.Latitude, pokemon.Longitude, MiscEnums.Item.ITEM_POKE_BALL, pokemonCP); ; //note: reverted from settings because this should not be part of settings but part of logic
- } while (caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchMissed || caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchEscape);
-
- string pokemonName;
- if (ClientSettings.Language == "german")
- {
- string name_english = Convert.ToString(pokemon.PokemonId);
- var request = (HttpWebRequest)WebRequest.Create("http://boosting-service.de/pokemon/index.php?pokeName=" + name_english);
- var response = (HttpWebResponse)request.GetResponse();
- pokemonName = new StreamReader(response.GetResponseStream()).ReadToEnd();
- }
- else
- pokemonName = Convert.ToString(pokemon.PokemonId);
-
- if (caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchSuccess)
- {
- ColoredConsoleWrite(ConsoleColor.Green, $"We caught a {pokemonName} with {pokemonCP} CP and {pokemonIV}% IV");
- foreach (int xp in caughtPokemonResponse.Scores.Xp)
- TotalExperience += xp;
- TotalPokemon += 1;
- }
- else
- ColoredConsoleWrite(ConsoleColor.Red, $"{pokemonName} with {pokemonCP} CP and {pokemonIV}% IV");
-
- if (ClientSettings.TransferType == "leaveStrongest")
- await TransferAllButStrongestUnwantedPokemon(client);
- else if (ClientSettings.TransferType == "all")
- await TransferAllGivenPokemons(client, pokemons2);
- else if (ClientSettings.TransferType == "duplicate")
- await TransferDuplicatePokemon(client);
- else if (ClientSettings.TransferType == "cp")
- await TransferAllWeakPokemon(client, ClientSettings.TransferCPThreshold);
- else if (ClientSettings.TransferType == "iv")
- await TransferAllGivenPokemons(client, pokemons2, ClientSettings.TransferIVThreshold);
-
- await Task.Delay(3000);
- }
- }
-
- private static async Task ExecuteFarmingPokestopsAndPokemons(Client client)
- {
- var mapObjects = await client.GetMapObjects();
-
- var pokeStops = mapObjects.MapCells.SelectMany(i => i.Forts).Where(i => i.Type == FortType.Checkpoint && i.CooldownCompleteTimestampMs < DateTime.UtcNow.ToUnixTime());
-
- foreach (var pokeStop in pokeStops)
- {
- var update = await client.UpdatePlayerLocation(pokeStop.Latitude, pokeStop.Longitude);
- var fortInfo = await client.GetFort(pokeStop.Id, pokeStop.Latitude, pokeStop.Longitude);
- var fortSearch = await client.SearchFort(pokeStop.Id, pokeStop.Latitude, pokeStop.Longitude);
-
- StringWriter PokeStopOutput = new StringWriter();
- PokeStopOutput.Write($"");
- if (fortInfo.Name != string.Empty)
- PokeStopOutput.Write("PokeStop: " + fortInfo.Name);
- if (fortSearch.ExperienceAwarded != 0)
- PokeStopOutput.Write($", XP: {fortSearch.ExperienceAwarded}");
- if (fortSearch.GemsAwarded != 0)
- PokeStopOutput.Write($", Gems: {fortSearch.GemsAwarded}");
- if (fortSearch.PokemonDataEgg != null)
- PokeStopOutput.Write($", Eggs: {fortSearch.PokemonDataEgg}");
- if (GetFriendlyItemsString(fortSearch.ItemsAwarded) != string.Empty)
- PokeStopOutput.Write($", Items: {GetFriendlyItemsString(fortSearch.ItemsAwarded)} ");
- ColoredConsoleWrite(ConsoleColor.Cyan, PokeStopOutput.ToString());
-
- if (fortSearch.ExperienceAwarded != 0)
- TotalExperience += (fortSearch.ExperienceAwarded);
- await Task.Delay(15000);
- await ExecuteCatchAllNearbyPokemons(client);
- }
- }
-
- private static string GetFriendlyItemsString(IEnumerable<FortSearchResponse.Types.ItemAward> items)
- {
- var enumerable = items as IList<FortSearchResponse.Types.ItemAward> ?? items.ToList();
-
- if (!enumerable.Any())
- return string.Empty;
-
- return enumerable.GroupBy(i => i.ItemId)
- .Select(kvp => new { ItemName = kvp.Key.ToString().Substring(4), Amount = kvp.Sum(x => x.ItemCount) })
- .Select(y => $"{y.Amount}x {y.ItemName}")
- .Aggregate((a, b) => $"{a}, {b}");
- }
-
- private static void Main(string[] args)
- {
- Task.Run(() =>
- {
- try
- {
- //ColoredConsoleWrite(ConsoleColor.White, "Coded by Ferox - edited by NecronomiconCoding");
- CheckVersion();
- Execute();
- }
- catch (PtcOfflineException)
- {
- ColoredConsoleWrite(ConsoleColor.Red, "PTC Servers are probably down OR your credentials are wrong. Try google");
- }
- catch (Exception ex)
- {
- ColoredConsoleWrite(ConsoleColor.Red, $"Unhandled exception: {ex}");
- }
- });
- System.Console.ReadLine();
- }
-
- private static async Task TransferAllButStrongestUnwantedPokemon(Client client)
- {
- //ColoredConsoleWrite(ConsoleColor.White, $"Firing up the meat grinder");
-
- var unwantedPokemonTypes = new[]
- {
- PokemonId.Pidgey,
- PokemonId.Rattata,
- PokemonId.Weedle,
- PokemonId.Zubat,
- PokemonId.Caterpie,
- PokemonId.Pidgeotto,
- PokemonId.NidoranFemale,
- PokemonId.Paras,
- PokemonId.Venonat,
- PokemonId.Psyduck,
- PokemonId.Poliwag,
- PokemonId.Slowpoke,
- PokemonId.Drowzee,
- PokemonId.Gastly,
- PokemonId.Goldeen,
- PokemonId.Staryu,
- PokemonId.Magikarp,
- PokemonId.Clefairy,
- PokemonId.Eevee,
- PokemonId.Tentacool,
- PokemonId.Dratini,
- PokemonId.Ekans,
- PokemonId.Jynx,
- PokemonId.Lickitung,
- PokemonId.Spearow,
- PokemonId.NidoranFemale,
- PokemonId.NidoranMale
- };
-
- var inventory = await client.GetInventory();
- var pokemons = inventory.InventoryDelta.InventoryItems
- .Select(i => i.InventoryItemData?.Pokemon)
- .Where(p => p != null && p?.PokemonId > 0)
- .ToArray();
-
- foreach (var unwantedPokemonType in unwantedPokemonTypes)
- {
- var pokemonOfDesiredType = pokemons.Where(p => p.PokemonId == unwantedPokemonType)
- .OrderByDescending(p => p.Cp)
- .ToList();
-
- var unwantedPokemon =
- pokemonOfDesiredType.Skip(1) // keep the strongest one for potential battle-evolving
- .ToList();
-
- //ColoredConsoleWrite(ConsoleColor.White, $"Grinding {unwantedPokemon.Count} pokemons of type {unwantedPokemonType}");
- await TransferAllGivenPokemons(client, unwantedPokemon);
- }
-
- //ColoredConsoleWrite(ConsoleColor.White, $"Finished grinding all the meat");
- }
-
- public static float Perfect(PokemonData poke)
- {
- return ((float)(poke.IndividualAttack + poke.IndividualDefense + poke.IndividualStamina) / (3.0f * 15.0f)) * 100.0f;
- }
-
- private static async Task TransferAllGivenPokemons(Client client, IEnumerable<PokemonData> unwantedPokemons, float keepPerfectPokemonLimit = 80.0f)
- {
- foreach (var pokemon in unwantedPokemons)
- {
- if (Perfect(pokemon) >= keepPerfectPokemonLimit) continue;
- ColoredConsoleWrite(ConsoleColor.White, $"Pokemon {pokemon.PokemonId} with {pokemon.Cp} CP has IV percent less than {keepPerfectPokemonLimit}%");
-
- if (pokemon.Favorite == 0)
- {
- var transferPokemonResponse = await client.TransferPokemon(pokemon.Id);
-
- /*
- ReleasePokemonOutProto.Status {
- UNSET = 0;
- SUCCESS = 1;
- POKEMON_DEPLOYED = 2;
- FAILED = 3;
- ERROR_POKEMON_IS_EGG = 4;
- }*/
- string pokemonName;
- if (ClientSettings.Language == "german")
- {
- ColoredConsoleWrite(ConsoleColor.DarkCyan, "german");
- string name_english = Convert.ToString(pokemon.PokemonId);
- var request = (HttpWebRequest)WebRequest.Create("http://boosting-service.de/pokemon/index.php?pokeName=" + name_english);
- var response = (HttpWebResponse)request.GetResponse();
- pokemonName = new StreamReader(response.GetResponseStream()).ReadToEnd();
- }
- else
- pokemonName = Convert.ToString(pokemon.PokemonId);
- if (transferPokemonResponse.Status == 1)
- {
- ColoredConsoleWrite(ConsoleColor.Magenta, $"Transferred {pokemonName} with {pokemon.Cp} CP");
- }
- else
- {
- var status = transferPokemonResponse.Status;
-
- ColoredConsoleWrite(ConsoleColor.Red, $"Somehow failed to transfer {pokemonName} with {pokemon.Cp} CP. " +
- $"ReleasePokemonOutProto.Status was {status}");
- }
-
- await Task.Delay(3000);
- }
- }
- }
-
- private static async Task TransferDuplicatePokemon(Client client)
- {
-
- //ColoredConsoleWrite(ConsoleColor.White, $"Check for duplicates");
- var inventory = await client.GetInventory();
- var allpokemons =
- inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.Pokemon)
- .Where(p => p != null && p?.PokemonId > 0);
-
- var dupes = allpokemons.OrderBy(x => x.Cp).Select((x, i) => new { index = i, value = x })
- .GroupBy(x => x.value.PokemonId)
- .Where(x => x.Skip(1).Any());
-
- for (var i = 0; i < dupes.Count(); i++)
- {
- for (var j = 0; j < dupes.ElementAt(i).Count() - 1; j++)
- {
- var dubpokemon = dupes.ElementAt(i).ElementAt(j).value;
- if (dubpokemon.Favorite == 0)
- {
- var transfer = await client.TransferPokemon(dubpokemon.Id);
- string pokemonName;
- if (ClientSettings.Language == "german")
- {
- string name_english = Convert.ToString(dubpokemon.PokemonId);
- var request = (HttpWebRequest)WebRequest.Create("http://boosting-service.de/pokemon/index.php?pokeName=" + name_english);
- var response = (HttpWebResponse)request.GetResponse();
- pokemonName = new StreamReader(response.GetResponseStream()).ReadToEnd();
- }
- else
- pokemonName = Convert.ToString(dubpokemon.PokemonId);
- ColoredConsoleWrite(ConsoleColor.DarkGreen,
- $"Transferred {pokemonName} with {dubpokemon.Cp} CP (Highest is {dupes.ElementAt(i).Last().value.Cp})");
-
- }
- }
- }
- }
-
- private static async Task TransferAllWeakPokemon(Client client, int cpThreshold)
- {
- //ColoredConsoleWrite(ConsoleColor.White, $"Firing up the meat grinder");
-
- PokemonId[] doNotTransfer = new[] //these will not be transferred even when below the CP threshold
- { // DO NOT EMPTY THIS ARRAY
- //PokemonId.Pidgey,
- //PokemonId.Rattata,
- //PokemonId.Weedle,
- //PokemonId.Zubat,
- //PokemonId.Caterpie,
- //PokemonId.Pidgeotto,
- //PokemonId.NidoranFemale,
- //PokemonId.Paras,
- //PokemonId.Venonat,
- //PokemonId.Psyduck,
- //PokemonId.Poliwag,
- //PokemonId.Slowpoke,
- //PokemonId.Drowzee,
- //PokemonId.Gastly,
- //PokemonId.Goldeen,
- //PokemonId.Staryu,
- PokemonId.Magikarp,
- PokemonId.Eevee//,
- //PokemonId.Dratini
- };
-
- var inventory = await client.GetInventory();
- var pokemons = inventory.InventoryDelta.InventoryItems
- .Select(i => i.InventoryItemData?.Pokemon)
- .Where(p => p != null && p?.PokemonId > 0)
- .ToArray();
-
- //foreach (var unwantedPokemonType in unwantedPokemonTypes)
- {
- List<PokemonData> pokemonToDiscard;
- if (doNotTransfer.Count() != 0)
- pokemonToDiscard = pokemons.Where(p => !doNotTransfer.Contains(p.PokemonId) && p.Cp < cpThreshold).OrderByDescending(p => p.Cp).ToList();
- else
- pokemonToDiscard = pokemons.Where(p => p.Cp < cpThreshold).OrderByDescending(p => p.Cp).ToList();
-
-
- //var unwantedPokemon = pokemonOfDesiredType.Skip(1) // keep the strongest one for potential battle-evolving
- // .ToList();
- ColoredConsoleWrite(ConsoleColor.Gray, $"Grinding {pokemonToDiscard.Count} pokemon below {cpThreshold} CP.");
- await TransferAllGivenPokemons(client, pokemonToDiscard);
-
- }
-
- ColoredConsoleWrite(ConsoleColor.Gray, $"Finished grinding all the meat");
- }
-
- public static async Task PrintLevel(Client client)
- {
- var inventory = await client.GetInventory();
- var stats = inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.PlayerStats).ToArray();
- foreach (var v in stats)
- if (v != null)
- {
- int XpDiff = GetXpDiff(client, v.Level);
- if (ClientSettings.LevelOutput == "time")
- ColoredConsoleWrite(ConsoleColor.Yellow, $"Current Level: " + v.Level + " (" + (v.Experience - XpDiff) + "/" + (v.NextLevelXp - XpDiff) + ")");
- else if (ClientSettings.LevelOutput == "levelup")
- if (Currentlevel != v.Level)
- {
- Currentlevel = v.Level;
- ColoredConsoleWrite(ConsoleColor.Magenta, $"Current Level: " + v.Level + ". XP needed for next Level: " + (v.NextLevelXp - v.Experience));
- }
- }
- if (ClientSettings.LevelOutput == "levelup")
- await Task.Delay(1000);
- else
- await Task.Delay(ClientSettings.LevelTimeInterval * 1000);
- PrintLevel(client);
- }
-
- // Pulled from NecronomiconCoding
- public static string _getSessionRuntimeInTimeFormat()
- {
- return (DateTime.Now - InitSessionDateTime).ToString(@"dd\.hh\:mm\:ss");
- }
-
- public static async Task ConsoleLevelTitle(string Username, Client client)
- {
- var inventory = await client.GetInventory();
- var stats = inventory.InventoryDelta.InventoryItems.Select(i => i.InventoryItemData?.PlayerStats).ToArray();
- var profile = await client.GetProfile();
- foreach (var v in stats)
- if (v != null)
- {
- int XpDiff = GetXpDiff(client, v.Level);
- System.Console.Title = string.Format(Username + " | Level: {0:0} - ({2:0} / {3:0}) | Runtime {1} | Stardust: {4:0}", v.Level, _getSessionRuntimeInTimeFormat(), (v.Experience - v.PrevLevelXp - XpDiff), (v.NextLevelXp - v.PrevLevelXp - XpDiff), profile.Profile.Currency.ToArray()[1].Amount) + " | XP/Hour: " + Math.Round(TotalExperience / GetRuntime()) + " | Pokemon/Hour: " + Math.Round(TotalPokemon / GetRuntime());
- }
- await Task.Delay(1000);
- ConsoleLevelTitle(Username, client);
- }
-
- public static int GetXpDiff(Client client, int Level)
- {
- switch (Level)
- {
- case 1:
- return 0;
- case 2:
- return 1000;
- case 3:
- return 2000;
- case 4:
- return 3000;
- case 5:
- return 4000;
- case 6:
- return 5000;
- case 7:
- return 6000;
- case 8:
- return 7000;
- case 9:
- return 8000;
- case 10:
- return 9000;
- case 11:
- return 10000;
- case 12:
- return 10000;
- case 13:
- return 10000;
- case 14:
- return 10000;
- case 15:
- return 15000;
- case 16:
- return 20000;
- case 17:
- return 20000;
- case 18:
- return 20000;
- case 19:
- return 25000;
- case 20:
- return 25000;
- case 21:
- return 50000;
- case 22:
- return 75000;
- case 23:
- return 100000;
- case 24:
- return 125000;
- case 25:
- return 150000;
- case 26:
- return 190000;
- case 27:
- return 200000;
- case 28:
- return 250000;
- case 29:
- return 300000;
- case 30:
- return 350000;
- case 31:
- return 500000;
- case 32:
- return 500000;
- case 33:
- return 750000;
- case 34:
- return 1000000;
- case 35:
- return 1250000;
- case 36:
- return 1500000;
- case 37:
- return 2000000;
- case 38:
- return 2500000;
- case 39:
- return 1000000;
- case 40:
- return 1000000;
- }
- return 0;
- }
- }
-}
diff --git a/PokemonGo/RocketAPI/Console/Properties/AssemblyInfo.cs b/PokemonGo/RocketAPI/Console/Properties/AssemblyInfo.cs
deleted file mode 100644
index 291154c..0000000
--- a/PokemonGo/RocketAPI/Console/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-#region
-
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-#endregion
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-
-[assembly: AssemblyTitle("PokemonGoRocketAPI.Console")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("PokemonGoRocketAPI.Console")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-
-[assembly: Guid("1fea147e-f704-497b-a538-00b053b5f672")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-
-[assembly: AssemblyVersion("1.2.2.7")]
-[assembly: AssemblyFileVersion("1.2.2.7")]
diff --git a/PokemonGo/RocketAPI/Console/Settings.cs b/PokemonGo/RocketAPI/Console/Settings.cs
deleted file mode 100644
index 78dddbb..0000000
--- a/PokemonGo/RocketAPI/Console/Settings.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-#region
-
-using System.Configuration;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using PokemonGo.RocketAPI.Enums;
-using System.Collections.Generic;
-using AllEnum;
-using System;
-
-#endregion
-
-namespace PokemonGo.RocketAPI.Console
-{
- public class Settings : ISettings
- {
- /// <summary>
- /// Don't touch. User settings are in Console/App.config
- /// </summary>
- public string TransferType => GetSetting() != string.Empty ? GetSetting() : "none";
- public int TransferCPThreshold => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 0;
- public int TransferIVThreshold => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 0;
- public int TravelSpeed => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 60;
- public bool EvolveAllGivenPokemons => GetSetting() != string.Empty ? System.Convert.ToBoolean(GetSetting(), CultureInfo.InvariantCulture) : false;
- public bool CatchPokemon => GetSetting() != string.Empty ? System.Convert.ToBoolean(GetSetting(), CultureInfo.InvariantCulture) : false;
-
-
- public AuthType AuthType => (GetSetting() != string.Empty ? GetSetting() : "Ptc") == "Ptc" ? AuthType.Ptc : AuthType.Google;
- public string PtcUsername => GetSetting() != string.Empty ? GetSetting() : "username";
- public string PtcPassword => GetSetting() != string.Empty ? GetSetting() : "password";
- public string Email => GetSetting() != string.Empty ? GetSetting() : "Email";
- public string Password => GetSetting() != string.Empty ? GetSetting() : "Password";
-
- public double DefaultLatitude
- {
- get { return GetSetting() != string.Empty ? double.Parse(GetSetting(), CultureInfo.InvariantCulture) : 51.22640; }
- set { SetSetting(value); }
- }
-
-
- public double DefaultLongitude
- {
- get { return GetSetting() != string.Empty ? double.Parse(GetSetting(), CultureInfo.InvariantCulture) : 6.77874; }
- set { SetSetting(value); }
- }
-
-
- public string LevelOutput => GetSetting() != string.Empty ? GetSetting() : "time";
-
- public int LevelTimeInterval => GetSetting() != string.Empty ? System.Convert.ToInt16(GetSetting()) : 600;
-
- public bool Recycler => GetSetting() != string.Empty ? System.Convert.ToBoolean(GetSetting(), CultureInfo.InvariantCulture) : false;
-
- ICollection<KeyValuePair<ItemId, int>> ISettings.ItemRecycleFilter
- {
- get
- {
- //Type and amount to keep
- return new[]
- {
- new KeyValuePair<ItemId, int>(ItemId.ItemPokeBall, 20),
- new KeyValuePair<ItemId, int>(ItemId.ItemGreatBall, 50),
- new KeyValuePair<ItemId, int>(ItemId.ItemUltraBall, 100),
- new KeyValuePair<ItemId, int>(ItemId.ItemMasterBall, 200),
- new KeyValuePair<ItemId, int>(ItemId.ItemRazzBerry, 20),
- new KeyValuePair<ItemId, int>(ItemId.ItemRevive, 20),
- new KeyValuePair<ItemId, int>(ItemId.ItemMaxRevive, 40),
- new KeyValuePair<ItemId, int>(ItemId.ItemPotion, 0),
- new KeyValuePair<ItemId, int>(ItemId.ItemSuperPotion, 0),
- new KeyValuePair<ItemId, int>(ItemId.ItemHyperPotion, 50)
- };
- }
- }
-
- public int RecycleItemsInterval => GetSetting() != string.Empty ? Convert.ToInt16(GetSetting()) : 60;
-
- public string Language => GetSetting() != string.Empty ? GetSetting() : "english";
-
- public string RazzBerryMode => GetSetting() != string.Empty ? GetSetting() : "cp";
-
- public double RazzBerrySetting => GetSetting() != string.Empty ? double.Parse(GetSetting(), CultureInfo.InvariantCulture) : 500;
-
- public string GoogleRefreshToken
- {
- get { return GetSetting() != string.Empty ? GetSetting() : string.Empty; }
- set { SetSetting(value); }
- }
-
- private string GetSetting([CallerMemberName] string key = null)
- {
- return ConfigurationManager.AppSettings[key];
- }
-
- private void SetSetting(string value, [CallerMemberName] string key = null)
- {
- var configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
- if (key != null) configFile.AppSettings.Settings[key].Value = value;
- configFile.Save();
- }
-
- private void SetSetting(double value, [CallerMemberName] string key = null)
- {
- CultureInfo customCulture = (CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
- customCulture.NumberFormat.NumberDecimalSeparator = ".";
- System.Threading.Thread.CurrentThread.CurrentCulture = customCulture;
- var configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
- if (key != null) configFile.AppSettings.Settings[key].Value = value.ToString();
- configFile.Save();
- }
- }
-}
diff --git a/PokemonGo/RocketAPI/Console/packages.config b/PokemonGo/RocketAPI/Console/packages.config
deleted file mode 100644
index cb70682..0000000
--- a/PokemonGo/RocketAPI/Console/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
-</packages>
\ No newline at end of file
diff --git a/PokemonGo/RocketAPI/ISettings.cs b/PokemonGo/RocketAPI/ISettings.cs
index be51673..edec062 100644
--- a/PokemonGo/RocketAPI/ISettings.cs
+++ b/PokemonGo/RocketAPI/ISettings.cs
@@ -25,6 +25,7 @@ namespace PokemonGo.RocketAPI
int TransferCPThreshold { get; }
int TransferIVThreshold { get; }
int TravelSpeed { get; }
+ int ImageSize { get; }
bool Recycler { get; }
ICollection<KeyValuePair<AllEnum.ItemId, int>> ItemRecycleFilter { get; }
int RecycleItemsInterval { get; }
diff --git a/PokemonGo/RocketAPI/Window/App.config b/PokemonGo/RocketAPI/Window/App.config
index 754e03d..a3cf5c7 100644
--- a/PokemonGo/RocketAPI/Window/App.config
+++ b/PokemonGo/RocketAPI/Window/App.config
@@ -49,6 +49,8 @@
<!--transfer pokemon with IV less than this value if iv transfer type is selected. Whitelist in Program.cs-->
<add key="TravelSpeed" value="60"/>
<!--The speed to travel in km/h-->
+ <add key="ImageSize" value="50"/>
+ <!--PokeUi image size-->
<add key="CatchPokemon" value="true"/>
<!--Only visit pokestop and collect items-->
<add key="EvolveAllGivenPokemons" value="false" />
diff --git a/PokemonGo/RocketAPI/Window/MainForm.Designer.cs b/PokemonGo/RocketAPI/Window/MainForm.Designer.cs
index a41b76d..2c3859c 100644
--- a/PokemonGo/RocketAPI/Window/MainForm.Designer.cs
+++ b/PokemonGo/RocketAPI/Window/MainForm.Designer.cs
@@ -33,7 +33,7 @@
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
- this.startBotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.startStopBotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.todoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pokemonToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
@@ -79,7 +79,7 @@
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.startBotToolStripMenuItem,
+ this.startStopBotToolStripMenuItem,
this.mapToolStripMenuItem,
this.todoToolStripMenuItem,
this.pokemonToolStripMenuItem2,
@@ -93,10 +93,10 @@
//
// startBotToolStripMenuItem
//
- this.startBotToolStripMenuItem.Name = "startBotToolStripMenuItem";
- this.startBotToolStripMenuItem.Size = new System.Drawing.Size(64, 20);
- this.startBotToolStripMenuItem.Text = "Start Bot";
- this.startBotToolStripMenuItem.Click += new System.EventHandler(this.startBotToolStripMenuItem_Click);
+ this.startStopBotToolStripMenuItem.Name = "startStopBotToolStripMenuItem";
+ this.startStopBotToolStripMenuItem.Size = new System.Drawing.Size(64, 20);
+ this.startStopBotToolStripMenuItem.Text = "Start Bot";
+ this.startStopBotToolStripMenuItem.Click += new System.EventHandler(this.startStopBotToolStripMenuItem_Click);
//
// mapToolStripMenuItem
//
@@ -173,7 +173,7 @@
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem todoToolStripMenuItem;
private System.Windows.Forms.ToolStripStatusLabel statusLabel;
- private System.Windows.Forms.ToolStripMenuItem startBotToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem startStopBotToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem showAllToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem showAllToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem pokemonToolStripMenuItem2;
diff --git a/PokemonGo/RocketAPI/Window/MainForm.cs b/PokemonGo/RocketAPI/Window/MainForm.cs
index 5d5f26d..67fd3eb 100644
--- a/PokemonGo/RocketAPI/Window/MainForm.cs
+++ b/PokemonGo/RocketAPI/Window/MainForm.cs
@@ -38,12 +38,13 @@ namespace PokemonGo.RocketAPI.Window
private static int Currentlevel = -1;
private static int TotalExperience = 0;
private static int TotalPokemon = 0;
+ private static bool Stopping = false;
private static bool ForceUnbanning = false;
private static bool FarmingStops = false;
private static bool FarmingPokemons = false;
private static DateTime TimeStarted = DateTime.Now;
public static DateTime InitSessionDateTime = DateTime.Now;
-
+
Client client;
LocationManager locationManager;
@@ -110,6 +111,17 @@ namespace PokemonGo.RocketAPI.Window
}
}
+ public void ConsoleClear()
+ {
+ if (InvokeRequired)
+ {
+ Invoke(new Action(ConsoleClear));
+ return;
+ }
+
+ logTextBox.Clear();
+ }
+
public void SetStatusText(string text)
{
if (InvokeRequired)
@@ -196,9 +208,6 @@ namespace PokemonGo.RocketAPI.Window
break;
case AuthType.Google:
ColoredConsoleWrite(Color.Green, "Login Type: Google");
- ColoredConsoleWrite(Color.Green, "Authenticating...\n");
- ColoredConsoleWrite(Color.Green, "Logging in to Google account.");
-
await client.DoGoogleLogin(ClientSettings.Email, ClientSettings.Password);
break;
@@ -217,16 +226,17 @@ namespace PokemonGo.RocketAPI.Window
// Write the players ingame details
ColoredConsoleWrite(Color.Yellow, "----------------------------");
- if (ClientSettings.AuthType == AuthType.Ptc)
- {
- ColoredConsoleWrite(Color.Cyan, "Account: " + ClientSettings.PtcUsername);
- ColoredConsoleWrite(Color.Cyan, "Password: " + ClientSettings.PtcPassword + "\n");
- }
- else
- {
- ColoredConsoleWrite(Color.Cyan, "Email: " + ClientSettings.Email);
- ColoredConsoleWrite(Color.Cyan, "Password: " + ClientSettings.Password + "\n");
- }
+ /*// dont actually want to display info but keeping here incase people want to \O_O/
+ * if (ClientSettings.AuthType == AuthType.Ptc)
+ {
+ ColoredConsoleWrite(Color.Cyan, "Account: " + ClientSettings.PtcUsername);
+ ColoredConsoleWrite(Color.Cyan, "Password: " + ClientSettings.PtcPassword + "\n");
+ }
+ else
+ {
+ ColoredConsoleWrite(Color.Cyan, "Email: " + ClientSettings.Email);
+ ColoredConsoleWrite(Color.Cyan, "Password: " + ClientSettings.Password + "\n");
+ }*/
ColoredConsoleWrite(Color.DarkGray, "Name: " + profile.Profile.Username);
ColoredConsoleWrite(Color.DarkGray, "Team: " + profile.Profile.Team);
if (profile.Profile.Currency.ToArray()[0].Amount > 0) // If player has any pokecoins it will show how many they have.
@@ -286,17 +296,27 @@ namespace PokemonGo.RocketAPI.Window
await Task.Delay(25);
// await ForceUnban(client);
- ColoredConsoleWrite(Color.Red, $"No nearby useful locations found. Please wait 10 seconds.");
- await Task.Delay(10000);
- CheckVersion();
- Execute();
+ if (!Stopping)
+ {
+ ColoredConsoleWrite(Color.Red, $"No nearby useful locations found. Please wait 10 seconds.");
+ await Task.Delay(10000);
+ CheckVersion();
+ Execute();
+ } else
+ {
+ ConsoleClear();
+ ColoredConsoleWrite(Color.Red, $"Bot successfully stopped.");
+ startStopBotToolStripMenuItem.Text = "Start";
+ Stopping = false;
+ bot_started = false;
+ }
}
- catch (TaskCanceledException) { ColoredConsoleWrite(Color.Red, "Task Canceled Exception - Restarting"); Execute(); }
- catch (UriFormatException) { ColoredConsoleWrite(Color.Red, "System URI Format Exception - Restarting"); Execute(); }
- catch (ArgumentOutOfRangeException) { ColoredConsoleWrite(Color.Red, "ArgumentOutOfRangeException - Restarting"); Execute(); }
- catch (ArgumentNullException) { ColoredConsoleWrite(Color.Red, "Argument Null Refference - Restarting"); Execute(); }
- catch (NullReferenceException) { ColoredConsoleWrite(Color.Red, "Null Refference - Restarting"); Execute(); }
- catch (Exception ex) { ColoredConsoleWrite(Color.Red, ex.ToString()); Execute(); }
+ catch (TaskCanceledException) { ColoredConsoleWrite(Color.Red, "Task Canceled Exception - Restarting"); if (!Stopping) Execute();}
+ catch (UriFormatException) { ColoredConsoleWrite(Color.Red, "System URI Format Exception - Restarting"); if (!Stopping) Execute(); }
+ catch (ArgumentOutOfRangeException) { ColoredConsoleWrite(Color.Red, "ArgumentOutOfRangeException - Restarting"); if (!Stopping) Execute(); }
+ catch (ArgumentNullException) { ColoredConsoleWrite(Color.Red, "Argument Null Refference - Restarting"); if (!Stopping) Execute(); }
+ catch (NullReferenceException) { ColoredConsoleWrite(Color.Red, "Null Refference - Restarting"); if (!Stopping) Execute(); }
+ catch (Exception ex) { ColoredConsoleWrite(Color.Red, ex.ToString()); if (!Stopping) Execute(); }
}
private static string CallAPI(string elem, double lat, double lon)
@@ -344,7 +364,7 @@ namespace PokemonGo.RocketAPI.Window
foreach (var pokemon in pokemons)
{
- if (ForceUnbanning)
+ if (ForceUnbanning || Stopping)
break;
FarmingPokemons = true;
@@ -427,11 +447,11 @@ namespace PokemonGo.RocketAPI.Window
}
HashSet<FortData> pokeStopSet = new HashSet<FortData>(pokeStops);
IEnumerable<FortData> nextPokeStopList = null;
- if (!ForceUnbanning)
+ if (!ForceUnbanning && !Stopping)
ColoredConsoleWrite(Color.Cyan, $"Visiting {pokeStops.Count()} PokeStops");
foreach (var pokeStop in pokeStops)
{
- if (ForceUnbanning)
+ if (ForceUnbanning || Stopping)
break;
FarmingStops = true;
@@ -488,7 +508,7 @@ namespace PokemonGo.RocketAPI.Window
private async Task ForceUnban(Client client)
{
- if (!ForceUnbanning)
+ if (!ForceUnbanning && !Stopping)
{
ColoredConsoleWrite(Color.LightGreen, "Waiting for last farming action to be complete...");
ForceUnbanning = true;
@@ -497,7 +517,7 @@ namespace PokemonGo.RocketAPI.Window
{
await Task.Delay(25);
}
-
+
ColoredConsoleWrite(Color.LightGreen, "Starting force unban...");
var mapObjects = await client.GetMapObjects();
@@ -534,14 +554,14 @@ namespace PokemonGo.RocketAPI.Window
if (!done)
ColoredConsoleWrite(Color.LightGreen, "Force unban failed, please try again.");
-
+
ForceUnbanning = false;
break;
}
}
else
{
- ColoredConsoleWrite(Color.Red, "A force unban attempt is in action... Please wait.");
+ ColoredConsoleWrite(Color.Red, "A action is in play... Please wait.");
}
@@ -947,26 +967,41 @@ namespace PokemonGo.RocketAPI.Window
settingsForm.Show();
}
- private void startBotToolStripMenuItem_Click(object sender, EventArgs e)
+ private static bool bot_started = false;
+ private void startStopBotToolStripMenuItem_Click(object sender, EventArgs e)
{
- startBotToolStripMenuItem.Enabled = false;
- Task.Run(() =>
+ if (!bot_started)
{
- try
+ bot_started = true;
+ startStopBotToolStripMenuItem.Text = "Stop Bot";
+ Task.Run(() =>
{
- //ColoredConsoleWrite(ConsoleColor.White, "Coded by Ferox - edited by NecronomiconCoding");
- CheckVersion();
- Execute();
- }
- catch (PtcOfflineException)
+ try
+ {
+ //ColoredConsoleWrite(ConsoleColor.White, "Coded by Ferox - edited by NecronomiconCoding");
+ CheckVersion();
+ Execute();
+ }
+ catch (PtcOfflineException)
+ {
+ ColoredConsoleWrite(Color.Red, "PTC Servers are probably down OR your credentials are wrong. Try google");
+ }
+ catch (Exception ex)
+ {
+ ColoredConsoleWrite(Color.Red, $"Unhandled exception: {ex}");
+ }
+ });
+ } else
+ {
+ if (!ForceUnbanning)
{
- ColoredConsoleWrite(Color.Red, "PTC Servers are probably down OR your credentials are wrong. Try google");
- }
- catch (Exception ex)
+ Stopping = true;
+ ColoredConsoleWrite(Color.Red, $"Stopping the bot.. Waiting for the last action to be complete.");
+ } else
{
- ColoredConsoleWrite(Color.Red, $"Unhandled exception: {ex}");
+ ColoredConsoleWrite(Color.Red, $"An action is in play, please wait until it's done.");
}
- });
+ }
}
private void showAllToolStripMenuItem3_Click(object sender, EventArgs e)
diff --git a/PokemonGo/RocketAPI/Window/PokeUi.cs b/PokemonGo/RocketAPI/Window/PokeUi.cs
index 5fda9aa..3ee7962 100644
--- a/PokemonGo/RocketAPI/Window/PokeUi.cs
+++ b/PokemonGo/RocketAPI/Window/PokeUi.cs
@@ -32,9 +32,9 @@ namespace PokemonGo.RocketAPI.Window
private async void Execute()
{
- EnabledButton(false);
+ EnabledButton(false);
- client = new Client(ClientSettings);
+ client = new Client(ClientSettings);
try
{
@@ -47,7 +47,6 @@ namespace PokemonGo.RocketAPI.Window
await client.DoGoogleLogin(ClientSettings.Email, ClientSettings.Password);
break;
}
- //
await client.SetServer();
var profile = await client.GetProfile();
var inventory = await client.GetInventory();
@@ -63,10 +62,15 @@ namespace PokemonGo.RocketAPI.Window
+ var imageSize = ClientSettings.ImageSize;
- var imageList = new ImageList { ImageSize = new Size(50, 50) };
+ if ((imageSize > 96) || (imageSize < 1)) // no bigger than orig size and no smaller than 1x1
+ imageSize = 50;
+
+ var imageList = new ImageList { ImageSize = new Size(imageSize, imageSize) };
+ //var imageList = new ImageList { ImageSize = new Size(96, 96) };
listView1.ShowItemToolTips = true;
-
+
foreach (var pokemon in pokemons)
{
Bitmap pokemonImage = null;
@@ -97,13 +101,13 @@ namespace PokemonGo.RocketAPI.Window
this.listView1.Items.Add(listViewItem);
-
+
}
- this.Text = "PokeUi " + pokemons.Count<PokemonData>() + "/" + profile.Profile.PokeStorage;
- EnabledButton(true);
+ this.Text = "PokeUi " + pokemons.Count<PokemonData>() + "/" + profile.Profile.PokeStorage;
+ EnabledButton(true);
- }
+ }
catch (TaskCanceledException) { Execute(); }
catch (UriFormatException) { Execute(); }
catch (ArgumentOutOfRangeException) { Execute(); }
@@ -112,13 +116,13 @@ namespace PokemonGo.RocketAPI.Window
catch (Exception ex) { Execute(); }
}
- private void EnabledButton(bool enabled)
- {
- button1.Enabled = enabled;
- button2.Enabled = enabled;
- button3.Enabled = enabled;
- btnUpgrade.Enabled = enabled;
- }
+ private void EnabledButton(bool enabled)
+ {
+ button1.Enabled = enabled;
+ button2.Enabled = enabled;
+ button3.Enabled = enabled;
+ btnUpgrade.Enabled = enabled;
+ }
private static Bitmap GetPokemonImage(int pokemonId)
{
@@ -263,48 +267,48 @@ namespace PokemonGo.RocketAPI.Window
catch (Exception ex) { await transferPokemon(pokemon); }
}
- private async void btnUpgrade_Click(object sender, EventArgs e)
- {
- var selectedItems = listView1.SelectedItems;
-
- foreach (ListViewItem selectedItem in selectedItems)
- {
- await PowerUp((PokemonData)selectedItem.Tag);
- }
-
- listView1.Clear();
- Execute();
- }
-
- private static async Task PowerUp(PokemonData pokemon)
- {
- try
- {
- var evolvePokemonResponse = await client.PowerUp(pokemon.Id);
- string message = "";
- string caption = "";
- MessageBoxButtons buttons = MessageBoxButtons.OK;
- DialogResult result;
-
- if (evolvePokemonResponse.Result == 1)
- {
- message = $"{pokemon.PokemonId} successfully upgraded.";
- caption = $"{pokemon.PokemonId} upgraded";
- }
- else
- {
- message = $"{pokemon.PokemonId} could not be upgraded";
- caption = $"Upgrade {pokemon.PokemonId} failed";
- }
-
- result = MessageBox.Show(message, caption, buttons, MessageBoxIcon.Information);
- }
- catch (TaskCanceledException) { await PowerUp(pokemon); }
- catch (UriFormatException) { await PowerUp(pokemon); }
- catch (ArgumentOutOfRangeException) { await PowerUp(pokemon); }
- catch (ArgumentNullException) { await PowerUp(pokemon); }
- catch (NullReferenceException) { await PowerUp(pokemon); }
- catch (Exception ex) { await PowerUp(pokemon); }
- }
- }
+ private async void btnUpgrade_Click(object sender, EventArgs e)
+ {
+ var selectedItems = listView1.SelectedItems;
+
+ foreach (ListViewItem selectedItem in selectedItems)
+ {
+ await PowerUp((PokemonData)selectedItem.Tag);
+ }
+
+ listView1.Clear();
+ Execute();
+ }
+
+ private static async Task PowerUp(PokemonData pokemon)
+ {
+ try
+ {
+ var evolvePokemonResponse = await client.PowerUp(pokemon.Id);
+ string message = "";
+ string caption = "";
+ MessageBoxButtons buttons = MessageBoxButtons.OK;
+ DialogResult result;
+
+ if (evolvePokemonResponse.Result == 1)
+ {
+ message = $"{pokemon.PokemonId} successfully upgraded.";
+ caption = $"{pokemon.PokemonId} upgraded";
+ }
+ else
+ {
+ message = $"{pokemon.PokemonId} could not be upgraded";
+ caption = $"Upgrade {pokemon.PokemonId} failed";
+ }
+
+ result = MessageBox.Show(message, caption, buttons, MessageBoxIcon.Information);
+ }
+ catch (TaskCanceledException) { await PowerUp(pokemon); }
+ catch (UriFormatException) { await PowerUp(pokemon); }
+ catch (ArgumentOutOfRangeException) { await PowerUp(pokemon); }
+ catch (ArgumentNullException) { await PowerUp(pokemon); }
+ catch (NullReferenceException) { await PowerUp(pokemon); }
+ catch (Exception ex) { await PowerUp(pokemon); }
+ }
+ }
}
diff --git a/PokemonGo/RocketAPI/Window/Settings.cs b/PokemonGo/RocketAPI/Window/Settings.cs
index 949297d..9f238c2 100644
--- a/PokemonGo/RocketAPI/Window/Settings.cs
+++ b/PokemonGo/RocketAPI/Window/Settings.cs
@@ -47,6 +47,7 @@ namespace PokemonGo.RocketAPI.Window
public int TransferCPThreshold => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 0;
public int TransferIVThreshold => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 0;
public int TravelSpeed => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 60;
+ public int ImageSize => GetSetting() != string.Empty ? int.Parse(GetSetting(), CultureInfo.InvariantCulture) : 50;
public bool EvolveAllGivenPokemons => GetSetting() != string.Empty && Convert.ToBoolean(GetSetting(), CultureInfo.InvariantCulture);
public bool CatchPokemon => GetSetting() != string.Empty && Convert.ToBoolean(GetSetting(), CultureInfo.InvariantCulture);
diff --git a/PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs b/PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs
index 0501dce..9d34f6d 100644
--- a/PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs
+++ b/PokemonGo/RocketAPI/Window/SettingsForm.Designer.cs
@@ -65,6 +65,8 @@
this.EmailPasswordText = new System.Windows.Forms.Label();
this.EmailLoginBox = new System.Windows.Forms.TextBox();
this.EmailPasswordBox = new System.Windows.Forms.TextBox();
+ this.label7 = new System.Windows.Forms.Label();
+ this.ImageSizeBox = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
this.panel1.SuspendLayout();
@@ -344,6 +346,8 @@
//
// panel1
//
+ this.panel1.Controls.Add(this.label7);
+ this.panel1.Controls.Add(this.ImageSizeBox);
this.panel1.Controls.Add(this.EmailLoginText);
this.panel1.Controls.Add(this.CatchPokemonBox);
this.panel1.Controls.Add(this.EmailPasswordText);
@@ -404,7 +408,7 @@
//
// transferIVThresText
//
- this.transferIVThresText.Location = new System.Drawing.Point(104, 246);
+ this.transferIVThresText.Location = new System.Drawing.Point(104, 220);
this.transferIVThresText.Name = "transferIVThresText";
this.transferIVThresText.Size = new System.Drawing.Size(100, 20);
this.transferIVThresText.TabIndex = 24;
@@ -430,7 +434,7 @@
// label6
//
this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(3, 246);
+ this.label6.Location = new System.Drawing.Point(3, 220);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(70, 13);
this.label6.TabIndex = 21;
@@ -469,6 +473,22 @@
this.EmailPasswordBox.Size = new System.Drawing.Size(136, 20);
this.EmailPasswordBox.TabIndex = 30;
//
+ // label7
+ //
+ this.label7.AutoSize = true;
+ this.label7.Location = new System.Drawing.Point(3, 249);
+ this.label7.Name = "label7";
+ this.label7.Size = new System.Drawing.Size(100, 13);
+ this.label7.TabIndex = 32;
+ this.label7.Text = "PokeUi Image Size:";
+ //
+ // ImageSizeBox
+ //
+ this.ImageSizeBox.Location = new System.Drawing.Point(104, 246);
+ this.ImageSizeBox.Name = "ImageSizeBox";
+ this.ImageSizeBox.Size = new System.Drawing.Size(100, 20);
+ this.ImageSizeBox.TabIndex = 31;
+ //
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -533,5 +553,7 @@
private System.Windows.Forms.Label EmailPasswordText;
private System.Windows.Forms.TextBox EmailLoginBox;
private System.Windows.Forms.TextBox EmailPasswordBox;
+ private System.Windows.Forms.Label label7;
+ private System.Windows.Forms.TextBox ImageSizeBox;
}
}
diff --git a/PokemonGo/RocketAPI/Window/SettingsForm.cs b/PokemonGo/RocketAPI/Window/SettingsForm.cs
index 70bc0f8..808d322 100644
--- a/PokemonGo/RocketAPI/Window/SettingsForm.cs
+++ b/PokemonGo/RocketAPI/Window/SettingsForm.cs
@@ -22,6 +22,7 @@ namespace PokemonGo.RocketAPI.Window
private void SettingsForm_Load(object sender, EventArgs e)
{
+
authTypeCb.Text = Settings.Instance.AuthType.ToString();
ptcUserText.Text = Settings.Instance.PtcUsername.ToString();
ptcPassText.Text = Settings.Instance.PtcPassword.ToString();
@@ -37,6 +38,7 @@ namespace PokemonGo.RocketAPI.Window
evolveAllChk.Checked = Settings.Instance.EvolveAllGivenPokemons;
CatchPokemonBox.Checked = Settings.Instance.CatchPokemon;
TravelSpeedBox.Text = Settings.Instance.TravelSpeed.ToString();
+ ImageSizeBox.Text = Settings.Instance.ImageSize.ToString();
// Initialize map:
//use google provider
gMapControl1.MapProvider = GoogleMapProvider.Instance;
@@ -62,16 +64,16 @@ namespace PokemonGo.RocketAPI.Window
trackBar.Value = 10;
//set zoom
- gMapControl1.Zoom = trackBar.Value;
+ gMapControl1.Zoom = trackBar.Value;
}
private void saveBtn_Click(object sender, EventArgs e)
{
Settings.Instance.SetSetting(authTypeCb.Text, "AuthType");
- Settings.Instance.SetSetting(EmailLoginBox.Text, "Email");
- Settings.Instance.SetSetting(EmailPasswordBox.Text, "Password");
- Settings.Instance.SetSetting(ptcUserText.Text, "PtcUsername");
- Settings.Instance.SetSetting(ptcPassText.Text, "PtcPassword");
+ Settings.Instance.SetSetting(EmailLoginBox.Text, "Email");
+ Settings.Instance.SetSetting(EmailPasswordBox.Text, "Password");
+ Settings.Instance.SetSetting(ptcUserText.Text, "PtcUsername");
+ Settings.Instance.SetSetting(ptcPassText.Text, "PtcPassword");
Settings.Instance.SetSetting(latitudeText.Text.Replace(',', '.'), "DefaultLatitude");
Settings.Instance.SetSetting(longitudeText.Text.Replace(',', '.'), "DefaultLongitude");
@@ -87,6 +89,7 @@ namespace PokemonGo.RocketAPI.Window
Settings.Instance.SetSetting(transferCpThresText.Text, "TransferCPThreshold");
Settings.Instance.SetSetting(transferIVThresText.Text, "TransferIVThreshold");
Settings.Instance.SetSetting(TravelSpeedBox.Text, "TravelSpeed");
+ Settings.Instance.SetSetting(ImageSizeBox.Text, "ImageSize");
Settings.Instance.SetSetting(evolveAllChk.Checked ? "true" : "false", "EvolveAllGivenPokemons");
Settings.Instance.SetSetting(CatchPokemonBox.Checked ? "true" : "false", "CatchPokemon");
Settings.Instance.Reload();
@@ -128,13 +131,13 @@ namespace PokemonGo.RocketAPI.Window
{
gMapControl1.Zoom += 5;
}
-
+
double X = Math.Round(gMapControl1.Position.Lng, 6);
double Y = Math.Round(gMapControl1.Position.Lat, 6);
string longitude = X.ToString();
string latitude = Y.ToString();
latitudeText.Text = latitude;
- longitudeText.Text = longitude;
+ longitudeText.Text = longitude;
}
private void trackBar_Scroll(object sender, EventArgs e)
diff --git a/README.md b/README.md
index 54403be..74a65a8 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,14 @@
# Pokemon-Go-Rocket-API
+# Discusion not controlled by me but by user 1461748123
+* Discord channel for user and developer discussions.
+* https://discord.gg/y6EU2qY
+
#Window
![alt tag](https://github.com/DetectiveSquirrel/Pokemon-Go-Rocket-API/blob/master/MainWindow.png)
![alt tag](https://github.com/DetectiveSquirrel/Pokemon-Go-Rocket-API/blob/master/MainPokeUi.png)
![alt tag](https://github.com/DetectiveSquirrel/Pokemon-Go-Rocket-API/blob/master/MainSettings2.png)
-#Console
-![alt tag](https://github.com/DetectiveSquirrel/Pokemon-Go-Rocket-API/blob/master/screenshot.png)
-
A Pokémon Go bot in C#
@@ -30,20 +31,27 @@ A Pokémon Go bot in C#
* Logs everything into Logs.txt
## Getting Started
-
-Go to PokemonGo\RocketAPI\Console\App.config -> Edit the Settings you like -> Build and Run (CTRL+F5)
+Build and Run (CTRL+F5)
# Settings
## AuthType
-* *Google* - Google login via oauth2
-* *Ptc* - Pokémon Trainer Club login with username/password combination
+* *google* - Google login
+* *ptc* - Pokémon Trainer Club
## PtcUsername
-* *username* for PTC account. No need for when using Google.
-* *password* for PTC account. No need for when using Google.
+* *username* - for PTC account. No need for when using Google.
+
+## PtcPassword
+* *password* - for PTC account. No need for when using Google.
+
+## Email
+* *email@gmail.com* - for Google account. No need for when using PTC.
+
+## Password
+* *password* - for Google account. No need for when using PTC.
## GoogleRefreshToken
-* *GoogleRefreshToken* - You get this code when you connect the application with your Google account. You do not need to enter it.
+* *token* - for Google account. No need for wen using PTC. (Obsolete)
## DefaultLatitude
* *12.345678* - Latitude of your location you want to use the bot in. Number between -90 and +90. Doesn't matter how many numbers stand after the comma.
@@ -74,7 +82,8 @@ Go to PokemonGo\RocketAPI\Console\App.config -> Edit the Settings you like -> Bu
* *probability* - Use RazzBerry when Pokémon catch chance is under a specific percentage.
## RazzBerrySetting
-* *value* - CP: Use RazzBerry when Pokémon is over this value | Probability Mode: Use Razzberry when % of catching is under this value
+* *cp value* - If RazzBerryMode is cp. Use RazzBerry when Pokémon is over this value
+* *probability value* - If RazzBerryMode is probability. Use Razzberry when % of catching is under this value. Between 0 and 1.
## TransferType
* *none* - disables transferring
@@ -86,6 +95,19 @@ Go to PokemonGo\RocketAPI\Console\App.config -> Edit the Settings you like -> Bu
## TransferCPThreshold
* *CP* - transfers all Pokémon with less CP than this value.
+## TransferIVThreshold
+* *IV* - transfers all Pokémon with less IV than this value. Between 0 and 1.
+
+## TravelSpeed
+* *Speed* - Travel speed in km/h
+
+## ImageSize
+* *px* - Pixel size for Pokémon Thumbnails
+
+## CatchPokemon
+* *true* - Catch Pokémon and get Items from PokéStops
+* *false* - Don't catch Pokémon and get Items from PokéStops
+
## EvolveAllGivenPokemons
* *false* - Evolves no Pokémon.
* *true* - Evolves all Pokémon.
\ No newline at end of file
You may download the files in Public Git.