From e321b25a97e8c6a0879fac6f5f2ad4c6d3801ac0 Mon Sep 17 00:00:00 2001 From: Maxim Podolskiy Date: Sun, 31 Jul 2016 12:33:54 +0300 Subject: [PATCH 01/45] initial --- .gitmodules | 9 +- Catchem/App.config | 27 + Catchem/App.xaml | 9 + Catchem/App.xaml.cs | 17 + Catchem/Catchem.csproj | 644 +++++++ Catchem/Extensions.cs | 524 ++++++ Catchem/MainWindow.xaml | 195 ++ Catchem/MainWindow.xaml.cs | 336 ++++ Catchem/Properties/AssemblyInfo.cs | 55 + Catchem/Properties/Resources.Designer.cs | 1623 +++++++++++++++++ Catchem/Properties/Resources.resx | 589 ++++++ Catchem/Properties/Settings.Designer.cs | 30 + Catchem/Properties/Settings.settings | 7 + Catchem/Resources/1.png | Bin 0 -> 1374 bytes Catchem/Resources/10.png | Bin 0 -> 1283 bytes Catchem/Resources/100.png | Bin 0 -> 1537 bytes Catchem/Resources/101.png | Bin 0 -> 1780 bytes Catchem/Resources/102.png | Bin 0 -> 1543 bytes Catchem/Resources/103.png | Bin 0 -> 1803 bytes Catchem/Resources/104.png | Bin 0 -> 1672 bytes Catchem/Resources/105.png | Bin 0 -> 1771 bytes Catchem/Resources/106.png | Bin 0 -> 1538 bytes Catchem/Resources/107.png | Bin 0 -> 1672 bytes Catchem/Resources/108.png | Bin 0 -> 2065 bytes Catchem/Resources/109.png | Bin 0 -> 1687 bytes Catchem/Resources/11.png | Bin 0 -> 1294 bytes Catchem/Resources/110.png | Bin 0 -> 1806 bytes Catchem/Resources/111.png | Bin 0 -> 2017 bytes Catchem/Resources/112.png | Bin 0 -> 2057 bytes Catchem/Resources/113.png | Bin 0 -> 1907 bytes Catchem/Resources/114.png | Bin 0 -> 2183 bytes Catchem/Resources/115.png | Bin 0 -> 2003 bytes Catchem/Resources/116.png | Bin 0 -> 1515 bytes Catchem/Resources/117.png | Bin 0 -> 1852 bytes Catchem/Resources/118.png | Bin 0 -> 1497 bytes Catchem/Resources/119.png | Bin 0 -> 2068 bytes Catchem/Resources/12.png | Bin 0 -> 2344 bytes Catchem/Resources/120.png | Bin 0 -> 1558 bytes Catchem/Resources/121.png | Bin 0 -> 2040 bytes Catchem/Resources/122.png | Bin 0 -> 1944 bytes Catchem/Resources/123.png | Bin 0 -> 1732 bytes Catchem/Resources/124.png | Bin 0 -> 2013 bytes Catchem/Resources/125.png | Bin 0 -> 2095 bytes Catchem/Resources/126.png | Bin 0 -> 2070 bytes Catchem/Resources/127.png | Bin 0 -> 1986 bytes Catchem/Resources/128.png | Bin 0 -> 2143 bytes Catchem/Resources/129.png | Bin 0 -> 1625 bytes Catchem/Resources/13.png | Bin 0 -> 1293 bytes Catchem/Resources/130.png | Bin 0 -> 1887 bytes Catchem/Resources/131.png | Bin 0 -> 1620 bytes Catchem/Resources/132.png | Bin 0 -> 1724 bytes Catchem/Resources/133.png | Bin 0 -> 1460 bytes Catchem/Resources/134.png | Bin 0 -> 1567 bytes Catchem/Resources/135.png | Bin 0 -> 1792 bytes Catchem/Resources/136.png | Bin 0 -> 1580 bytes Catchem/Resources/137.png | Bin 0 -> 1650 bytes Catchem/Resources/138.png | Bin 0 -> 1747 bytes Catchem/Resources/139.png | Bin 0 -> 1891 bytes Catchem/Resources/14.png | Bin 0 -> 1370 bytes Catchem/Resources/140.png | Bin 0 -> 1341 bytes Catchem/Resources/141.png | Bin 0 -> 1799 bytes Catchem/Resources/142.png | Bin 0 -> 1475 bytes Catchem/Resources/143.png | Bin 0 -> 2014 bytes Catchem/Resources/144.png | Bin 0 -> 2007 bytes Catchem/Resources/145.png | Bin 0 -> 2174 bytes Catchem/Resources/146.png | Bin 0 -> 1532 bytes Catchem/Resources/147.png | Bin 0 -> 1439 bytes Catchem/Resources/148.png | Bin 0 -> 1347 bytes Catchem/Resources/149.png | Bin 0 -> 1700 bytes Catchem/Resources/15.png | Bin 0 -> 1990 bytes Catchem/Resources/150.png | Bin 0 -> 1825 bytes Catchem/Resources/151.png | Bin 0 -> 1497 bytes Catchem/Resources/16.png | Bin 0 -> 1436 bytes Catchem/Resources/17.png | Bin 0 -> 1533 bytes Catchem/Resources/18.png | Bin 0 -> 1794 bytes Catchem/Resources/19.png | Bin 0 -> 1330 bytes Catchem/Resources/2.png | Bin 0 -> 1730 bytes Catchem/Resources/20.png | Bin 0 -> 1916 bytes Catchem/Resources/21.png | Bin 0 -> 1484 bytes Catchem/Resources/22.png | Bin 0 -> 1402 bytes Catchem/Resources/23.png | Bin 0 -> 1327 bytes Catchem/Resources/24.png | Bin 0 -> 1873 bytes Catchem/Resources/25.png | Bin 0 -> 1715 bytes Catchem/Resources/26.png | Bin 0 -> 1709 bytes Catchem/Resources/27.png | Bin 0 -> 1807 bytes Catchem/Resources/28.png | Bin 0 -> 2023 bytes Catchem/Resources/29.png | Bin 0 -> 1346 bytes Catchem/Resources/3.png | Bin 0 -> 2143 bytes Catchem/Resources/30.png | Bin 0 -> 1824 bytes Catchem/Resources/31.png | Bin 0 -> 1899 bytes Catchem/Resources/32.png | Bin 0 -> 1555 bytes Catchem/Resources/33.png | Bin 0 -> 1808 bytes Catchem/Resources/34.png | Bin 0 -> 2174 bytes Catchem/Resources/35.png | Bin 0 -> 1781 bytes Catchem/Resources/36.png | Bin 0 -> 2135 bytes Catchem/Resources/37.png | Bin 0 -> 1814 bytes Catchem/Resources/38.png | Bin 0 -> 2104 bytes Catchem/Resources/39.png | Bin 0 -> 2049 bytes Catchem/Resources/4.png | Bin 0 -> 1489 bytes Catchem/Resources/40.png | Bin 0 -> 2153 bytes Catchem/Resources/41.png | Bin 0 -> 1453 bytes Catchem/Resources/42.png | Bin 0 -> 1441 bytes Catchem/Resources/43.png | Bin 0 -> 1480 bytes Catchem/Resources/44.png | Bin 0 -> 1918 bytes Catchem/Resources/45.png | Bin 0 -> 1706 bytes Catchem/Resources/46.png | Bin 0 -> 1724 bytes Catchem/Resources/47.png | Bin 0 -> 2048 bytes Catchem/Resources/48.png | Bin 0 -> 1821 bytes Catchem/Resources/49.png | Bin 0 -> 1858 bytes Catchem/Resources/5.png | Bin 0 -> 1668 bytes Catchem/Resources/50.png | Bin 0 -> 1398 bytes Catchem/Resources/51.png | Bin 0 -> 1714 bytes Catchem/Resources/52.png | Bin 0 -> 1948 bytes Catchem/Resources/53.png | Bin 0 -> 1940 bytes Catchem/Resources/54.png | Bin 0 -> 1706 bytes Catchem/Resources/55.png | Bin 0 -> 2042 bytes Catchem/Resources/56.png | Bin 0 -> 1789 bytes Catchem/Resources/57.png | Bin 0 -> 1866 bytes Catchem/Resources/58.png | Bin 0 -> 1865 bytes Catchem/Resources/59.png | Bin 0 -> 2023 bytes Catchem/Resources/6.png | Bin 0 -> 1923 bytes Catchem/Resources/60.png | Bin 0 -> 1994 bytes Catchem/Resources/61.png | Bin 0 -> 1830 bytes Catchem/Resources/62.png | Bin 0 -> 1931 bytes Catchem/Resources/63.png | Bin 0 -> 1475 bytes Catchem/Resources/64.png | Bin 0 -> 2074 bytes Catchem/Resources/65.png | Bin 0 -> 2233 bytes Catchem/Resources/66.png | Bin 0 -> 1477 bytes Catchem/Resources/67.png | Bin 0 -> 1829 bytes Catchem/Resources/68.png | Bin 0 -> 1869 bytes Catchem/Resources/69.png | Bin 0 -> 1510 bytes Catchem/Resources/7.png | Bin 0 -> 1685 bytes Catchem/Resources/70.png | Bin 0 -> 1496 bytes Catchem/Resources/71.png | Bin 0 -> 1712 bytes Catchem/Resources/72.png | Bin 0 -> 1349 bytes Catchem/Resources/73.png | Bin 0 -> 1634 bytes Catchem/Resources/74.png | Bin 0 -> 1229 bytes Catchem/Resources/75.png | Bin 0 -> 1708 bytes Catchem/Resources/76.png | Bin 0 -> 1999 bytes Catchem/Resources/77.png | Bin 0 -> 1361 bytes Catchem/Resources/78.png | Bin 0 -> 1602 bytes Catchem/Resources/79.png | Bin 0 -> 1665 bytes Catchem/Resources/8.png | Bin 0 -> 1895 bytes Catchem/Resources/80.png | Bin 0 -> 1994 bytes Catchem/Resources/81.png | Bin 0 -> 1469 bytes Catchem/Resources/82.png | Bin 0 -> 1767 bytes Catchem/Resources/83.png | Bin 0 -> 1580 bytes Catchem/Resources/84.png | Bin 0 -> 1381 bytes Catchem/Resources/85.png | Bin 0 -> 1412 bytes Catchem/Resources/86.png | Bin 0 -> 1380 bytes Catchem/Resources/87.png | Bin 0 -> 1702 bytes Catchem/Resources/88.png | Bin 0 -> 1671 bytes Catchem/Resources/89.png | Bin 0 -> 1519 bytes Catchem/Resources/9.png | Bin 0 -> 2103 bytes Catchem/Resources/90.png | Bin 0 -> 1745 bytes Catchem/Resources/91.png | Bin 0 -> 2124 bytes Catchem/Resources/92.png | Bin 0 -> 2053 bytes Catchem/Resources/93.png | Bin 0 -> 2002 bytes Catchem/Resources/94.png | Bin 0 -> 2152 bytes Catchem/Resources/95.png | Bin 0 -> 1679 bytes Catchem/Resources/96.png | Bin 0 -> 1883 bytes Catchem/Resources/97.png | Bin 0 -> 1788 bytes Catchem/Resources/98.png | Bin 0 -> 1689 bytes Catchem/Resources/99.png | Bin 0 -> 1786 bytes Catchem/Resources/force_move.png | Bin 0 -> 1653 bytes Catchem/Resources/no_name.png | Bin 0 -> 5132 bytes Catchem/Resources/pstop.png | Bin 0 -> 1541 bytes Catchem/Resources/pstop_lured.png | Bin 0 -> 2144 bytes Catchem/Resources/trainer.png | Bin 0 -> 11748 bytes Catchem/WpfLogger.cs | 124 ++ Catchem/packages.config | 7 + Catchem/unnamed.ico | Bin 0 -> 370070 bytes PoGo.PokeMobBot.CLI/ConsoleLogger.cs | 5 + .../PoGo.PokeMobBot.CLI.csproj | 2 +- PoGo.PokeMobBot.Logic/Logging/ILogger.cs | 2 + .../PoGo.PokeMobBot.Logic.csproj | 2 +- PoGo.PokeMobBot.Logic/Settings.cs | 54 + PokeMobBot.sln | 10 +- Pokemon-Go-Rocket-API => PokemonGoAPI | 0 179 files changed, 4261 insertions(+), 10 deletions(-) create mode 100644 Catchem/App.config create mode 100644 Catchem/App.xaml create mode 100644 Catchem/App.xaml.cs create mode 100644 Catchem/Catchem.csproj create mode 100644 Catchem/Extensions.cs create mode 100644 Catchem/MainWindow.xaml create mode 100644 Catchem/MainWindow.xaml.cs create mode 100644 Catchem/Properties/AssemblyInfo.cs create mode 100644 Catchem/Properties/Resources.Designer.cs create mode 100644 Catchem/Properties/Resources.resx create mode 100644 Catchem/Properties/Settings.Designer.cs create mode 100644 Catchem/Properties/Settings.settings create mode 100644 Catchem/Resources/1.png create mode 100644 Catchem/Resources/10.png create mode 100644 Catchem/Resources/100.png create mode 100644 Catchem/Resources/101.png create mode 100644 Catchem/Resources/102.png create mode 100644 Catchem/Resources/103.png create mode 100644 Catchem/Resources/104.png create mode 100644 Catchem/Resources/105.png create mode 100644 Catchem/Resources/106.png create mode 100644 Catchem/Resources/107.png create mode 100644 Catchem/Resources/108.png create mode 100644 Catchem/Resources/109.png create mode 100644 Catchem/Resources/11.png create mode 100644 Catchem/Resources/110.png create mode 100644 Catchem/Resources/111.png create mode 100644 Catchem/Resources/112.png create mode 100644 Catchem/Resources/113.png create mode 100644 Catchem/Resources/114.png create mode 100644 Catchem/Resources/115.png create mode 100644 Catchem/Resources/116.png create mode 100644 Catchem/Resources/117.png create mode 100644 Catchem/Resources/118.png create mode 100644 Catchem/Resources/119.png create mode 100644 Catchem/Resources/12.png create mode 100644 Catchem/Resources/120.png create mode 100644 Catchem/Resources/121.png create mode 100644 Catchem/Resources/122.png create mode 100644 Catchem/Resources/123.png create mode 100644 Catchem/Resources/124.png create mode 100644 Catchem/Resources/125.png create mode 100644 Catchem/Resources/126.png create mode 100644 Catchem/Resources/127.png create mode 100644 Catchem/Resources/128.png create mode 100644 Catchem/Resources/129.png create mode 100644 Catchem/Resources/13.png create mode 100644 Catchem/Resources/130.png create mode 100644 Catchem/Resources/131.png create mode 100644 Catchem/Resources/132.png create mode 100644 Catchem/Resources/133.png create mode 100644 Catchem/Resources/134.png create mode 100644 Catchem/Resources/135.png create mode 100644 Catchem/Resources/136.png create mode 100644 Catchem/Resources/137.png create mode 100644 Catchem/Resources/138.png create mode 100644 Catchem/Resources/139.png create mode 100644 Catchem/Resources/14.png create mode 100644 Catchem/Resources/140.png create mode 100644 Catchem/Resources/141.png create mode 100644 Catchem/Resources/142.png create mode 100644 Catchem/Resources/143.png create mode 100644 Catchem/Resources/144.png create mode 100644 Catchem/Resources/145.png create mode 100644 Catchem/Resources/146.png create mode 100644 Catchem/Resources/147.png create mode 100644 Catchem/Resources/148.png create mode 100644 Catchem/Resources/149.png create mode 100644 Catchem/Resources/15.png create mode 100644 Catchem/Resources/150.png create mode 100644 Catchem/Resources/151.png create mode 100644 Catchem/Resources/16.png create mode 100644 Catchem/Resources/17.png create mode 100644 Catchem/Resources/18.png create mode 100644 Catchem/Resources/19.png create mode 100644 Catchem/Resources/2.png create mode 100644 Catchem/Resources/20.png create mode 100644 Catchem/Resources/21.png create mode 100644 Catchem/Resources/22.png create mode 100644 Catchem/Resources/23.png create mode 100644 Catchem/Resources/24.png create mode 100644 Catchem/Resources/25.png create mode 100644 Catchem/Resources/26.png create mode 100644 Catchem/Resources/27.png create mode 100644 Catchem/Resources/28.png create mode 100644 Catchem/Resources/29.png create mode 100644 Catchem/Resources/3.png create mode 100644 Catchem/Resources/30.png create mode 100644 Catchem/Resources/31.png create mode 100644 Catchem/Resources/32.png create mode 100644 Catchem/Resources/33.png create mode 100644 Catchem/Resources/34.png create mode 100644 Catchem/Resources/35.png create mode 100644 Catchem/Resources/36.png create mode 100644 Catchem/Resources/37.png create mode 100644 Catchem/Resources/38.png create mode 100644 Catchem/Resources/39.png create mode 100644 Catchem/Resources/4.png create mode 100644 Catchem/Resources/40.png create mode 100644 Catchem/Resources/41.png create mode 100644 Catchem/Resources/42.png create mode 100644 Catchem/Resources/43.png create mode 100644 Catchem/Resources/44.png create mode 100644 Catchem/Resources/45.png create mode 100644 Catchem/Resources/46.png create mode 100644 Catchem/Resources/47.png create mode 100644 Catchem/Resources/48.png create mode 100644 Catchem/Resources/49.png create mode 100644 Catchem/Resources/5.png create mode 100644 Catchem/Resources/50.png create mode 100644 Catchem/Resources/51.png create mode 100644 Catchem/Resources/52.png create mode 100644 Catchem/Resources/53.png create mode 100644 Catchem/Resources/54.png create mode 100644 Catchem/Resources/55.png create mode 100644 Catchem/Resources/56.png create mode 100644 Catchem/Resources/57.png create mode 100644 Catchem/Resources/58.png create mode 100644 Catchem/Resources/59.png create mode 100644 Catchem/Resources/6.png create mode 100644 Catchem/Resources/60.png create mode 100644 Catchem/Resources/61.png create mode 100644 Catchem/Resources/62.png create mode 100644 Catchem/Resources/63.png create mode 100644 Catchem/Resources/64.png create mode 100644 Catchem/Resources/65.png create mode 100644 Catchem/Resources/66.png create mode 100644 Catchem/Resources/67.png create mode 100644 Catchem/Resources/68.png create mode 100644 Catchem/Resources/69.png create mode 100644 Catchem/Resources/7.png create mode 100644 Catchem/Resources/70.png create mode 100644 Catchem/Resources/71.png create mode 100644 Catchem/Resources/72.png create mode 100644 Catchem/Resources/73.png create mode 100644 Catchem/Resources/74.png create mode 100644 Catchem/Resources/75.png create mode 100644 Catchem/Resources/76.png create mode 100644 Catchem/Resources/77.png create mode 100644 Catchem/Resources/78.png create mode 100644 Catchem/Resources/79.png create mode 100644 Catchem/Resources/8.png create mode 100644 Catchem/Resources/80.png create mode 100644 Catchem/Resources/81.png create mode 100644 Catchem/Resources/82.png create mode 100644 Catchem/Resources/83.png create mode 100644 Catchem/Resources/84.png create mode 100644 Catchem/Resources/85.png create mode 100644 Catchem/Resources/86.png create mode 100644 Catchem/Resources/87.png create mode 100644 Catchem/Resources/88.png create mode 100644 Catchem/Resources/89.png create mode 100644 Catchem/Resources/9.png create mode 100644 Catchem/Resources/90.png create mode 100644 Catchem/Resources/91.png create mode 100644 Catchem/Resources/92.png create mode 100644 Catchem/Resources/93.png create mode 100644 Catchem/Resources/94.png create mode 100644 Catchem/Resources/95.png create mode 100644 Catchem/Resources/96.png create mode 100644 Catchem/Resources/97.png create mode 100644 Catchem/Resources/98.png create mode 100644 Catchem/Resources/99.png create mode 100644 Catchem/Resources/force_move.png create mode 100644 Catchem/Resources/no_name.png create mode 100644 Catchem/Resources/pstop.png create mode 100644 Catchem/Resources/pstop_lured.png create mode 100644 Catchem/Resources/trainer.png create mode 100644 Catchem/WpfLogger.cs create mode 100644 Catchem/packages.config create mode 100644 Catchem/unnamed.ico rename Pokemon-Go-Rocket-API => PokemonGoAPI (100%) diff --git a/.gitmodules b/.gitmodules index 38dd190..50fdbc6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "FeroxRev"] - path = FeroxRev - url = https://github.com/yamashi/Pokemon-Go-Rocket-API -[submodule "Pokemon-Go-Rocket-API"] - path = Pokemon-Go-Rocket-API - url = https://github.com/yamashi/Pokemon-Go-Rocket-API/ +[submodule "PokemonGoAPI"] + path = PokemonGoAPI + url = https://github.com/Lunat1q/PokemonGoAPI diff --git a/Catchem/App.config b/Catchem/App.config new file mode 100644 index 0000000..cb9f05f --- /dev/null +++ b/Catchem/App.config @@ -0,0 +1,27 @@ + + + + +
+ + + + + + + + + False + + + proxy.com:1234 + + + pLogin + + + pPass + + + + \ No newline at end of file diff --git a/Catchem/App.xaml b/Catchem/App.xaml new file mode 100644 index 0000000..1a1c2ab --- /dev/null +++ b/Catchem/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/Catchem/App.xaml.cs b/Catchem/App.xaml.cs new file mode 100644 index 0000000..c1a9996 --- /dev/null +++ b/Catchem/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace PokeBot +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/Catchem/Catchem.csproj b/Catchem/Catchem.csproj new file mode 100644 index 0000000..c3ec74e --- /dev/null +++ b/Catchem/Catchem.csproj @@ -0,0 +1,644 @@ + + + + + Debug + AnyCPU + {354AF35C-1CA5-4043-A502-D19292F6FD33} + WinExe + Properties + PokeBot + PokeBot + v4.5.2 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + true + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + unnamed.ico + + + + ..\packages\AjaxMin.5.14.5506.26202\lib\net40\AjaxMin.dll + True + + + ..\packages\GMap.NET.Presentation.1.7.1\lib\net40\GMap.NET.Core.dll + True + + + ..\packages\GMap.NET.Presentation.1.7.1\lib\net40\GMap.NET.WindowsPresentation.dll + True + + + ..\packages\Google.Protobuf.3.0.0-beta4\lib\net45\Google.Protobuf.dll + True + + + ..\packages\POGOProtos.1.3.0\lib\net45\POGOProtos.dll + True + + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + {05d2da44-1b8e-4cf7-94ed-4d52451cd095} + PokemonGo.RocketAPI + + + {0739e40d-c589-4aeb-93e5-ee8cd6773c60} + PoGo.NecroBot.Logic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + Microsoft .NET Framework 4.5.2 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + + \ No newline at end of file diff --git a/Catchem/Extensions.cs b/Catchem/Extensions.cs new file mode 100644 index 0000000..9607769 --- /dev/null +++ b/Catchem/Extensions.cs @@ -0,0 +1,524 @@ +using POGOProtos.Enums; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Media; +using System.Windows.Media.Imaging; + +namespace PokeBot +{ + public static class Extensions + { + public static void AppendText(this RichTextBox box, string text, System.Windows.Media.Color color) + { + BrushConverter bc = new BrushConverter(); + TextRange tr = new TextRange(box.Document.ContentEnd, box.Document.ContentEnd); + tr.Text = text; + try + { + tr.ApplyPropertyValue(TextElement.ForegroundProperty, color); + } + catch (FormatException) { } + } + + public static System.Windows.Controls.Image ToImage(this PokemonId pid) + { + System.Windows.Controls.Image img = new System.Windows.Controls.Image(); + img.Source = pid.ToBitmap().loadBitmap(); + return img; + } + + public static System.Windows.Controls.Image ToImage(this System.Drawing.Bitmap source) + { + System.Windows.Controls.Image img = new System.Windows.Controls.Image(); + img.Source = source.loadBitmap(); + return img; + } + + [DllImport("gdi32")] + static extern int DeleteObject(IntPtr o); + + public static BitmapSource loadBitmap(this System.Drawing.Bitmap source) + { + IntPtr ip = source.GetHbitmap(); + BitmapSource bs = null; + try + { + bs = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(ip, + IntPtr.Zero, Int32Rect.Empty, + System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions()); + } + finally + { + DeleteObject(ip); + } + + return bs; + } + + public static Bitmap ToBitmap(this PokemonId pid) + { + switch (pid) + { + case PokemonId.Missingno: + return Properties.Resources.no_name; + case PokemonId.Bulbasaur: + return Properties.Resources._1; + case PokemonId.Ivysaur: + return Properties.Resources._2; + case PokemonId.Venusaur: + return Properties.Resources._3; + case PokemonId.Charmander: + return Properties.Resources._4; + case PokemonId.Charmeleon: + return Properties.Resources._5 + ; + case PokemonId.Charizard: + return Properties.Resources._6 + ; + case PokemonId.Squirtle: + return Properties.Resources._7 + ; + case PokemonId.Wartortle: + return Properties.Resources._8 + ; + case PokemonId.Blastoise: + return Properties.Resources._9 + ; + case PokemonId.Caterpie: + return Properties.Resources._10 + ; + case PokemonId.Metapod: + return Properties.Resources._11 + ; + case PokemonId.Butterfree: + return Properties.Resources._12 + ; + case PokemonId.Weedle: + return Properties.Resources._13 + ; + case PokemonId.Kakuna: + return Properties.Resources._14 + ; + case PokemonId.Beedrill: + return Properties.Resources._15 + ; + case PokemonId.Pidgey: + return Properties.Resources._16 + ; + case PokemonId.Pidgeotto: + return Properties.Resources._17 + ; + case PokemonId.Pidgeot: + return Properties.Resources._18 + ; + case PokemonId.Rattata: + return Properties.Resources._19 + ; + case PokemonId.Raticate: + return Properties.Resources._20 + ; + case PokemonId.Spearow: + return Properties.Resources._21 + ; + case PokemonId.Fearow: + return Properties.Resources._22 + ; + case PokemonId.Ekans: + return Properties.Resources._23 + ; + case PokemonId.Arbok: + return Properties.Resources._24 + ; + case PokemonId.Pikachu: + return Properties.Resources._25 + ; + case PokemonId.Raichu: + return Properties.Resources._26 + ; + case PokemonId.Sandshrew: + return Properties.Resources._27 + ; + case PokemonId.Sandslash: + return Properties.Resources._28 + ; + case PokemonId.NidoranFemale: + return Properties.Resources._29 + ; + case PokemonId.Nidorina: + return Properties.Resources._30 + ; + case PokemonId.Nidoqueen: + return Properties.Resources._31 + ; + case PokemonId.NidoranMale: + return Properties.Resources._32 + ; + case PokemonId.Nidorino: + return Properties.Resources._33 + ; + case PokemonId.Nidoking: + return Properties.Resources._34 + ; + case PokemonId.Clefairy: + return Properties.Resources._35 + ; + case PokemonId.Clefable: + return Properties.Resources._36 + ; + case PokemonId.Vulpix: + return Properties.Resources._37 + ; + case PokemonId.Ninetales: + return Properties.Resources._38 + ; + case PokemonId.Jigglypuff: + return Properties.Resources._39 + ; + case PokemonId.Wigglytuff: + return Properties.Resources._40 + ; + case PokemonId.Zubat: + return Properties.Resources._41 + ; + case PokemonId.Golbat: + return Properties.Resources._42 + ; + case PokemonId.Oddish: + return Properties.Resources._43 + ; + case PokemonId.Gloom: + return Properties.Resources._44 + ; + case PokemonId.Vileplume: + return Properties.Resources._45 + ; + case PokemonId.Paras: + return Properties.Resources._46 + ; + case PokemonId.Parasect: + return Properties.Resources._47 + ; + case PokemonId.Venonat: + return Properties.Resources._48 + ; + case PokemonId.Venomoth: + return Properties.Resources._49 + ; + case PokemonId.Diglett: + return Properties.Resources._50 + ; + case PokemonId.Dugtrio: + return Properties.Resources._51 + ; + case PokemonId.Meowth: + return Properties.Resources._52 + ; + case PokemonId.Persian: + return Properties.Resources._53 + ; + case PokemonId.Psyduck: + return Properties.Resources._54 + ; + case PokemonId.Golduck: + return Properties.Resources._55 + ; + case PokemonId.Mankey: + return Properties.Resources._56 + ; + case PokemonId.Primeape: + return Properties.Resources._57 + ; + case PokemonId.Growlithe: + return Properties.Resources._58 + ; + case PokemonId.Arcanine: + return Properties.Resources._59 + ; + case PokemonId.Poliwag: + return Properties.Resources._60 + ; + case PokemonId.Poliwhirl: + return Properties.Resources._61 + ; + case PokemonId.Poliwrath: + return Properties.Resources._62 + ; + case PokemonId.Abra: + return Properties.Resources._63 + ; + case PokemonId.Kadabra: + return Properties.Resources._64 + ; + case PokemonId.Alakazam: + return Properties.Resources._65 + ; + case PokemonId.Machop: + return Properties.Resources._66 + ; + case PokemonId.Machoke: + return Properties.Resources._67 + ; + case PokemonId.Machamp: + return Properties.Resources._68 + ; + case PokemonId.Bellsprout: + return Properties.Resources._69 + ; + case PokemonId.Weepinbell: + return Properties.Resources._70 + ; + case PokemonId.Victreebel: + return Properties.Resources._71 + ; + case PokemonId.Tentacool: + return Properties.Resources._72 + ; + case PokemonId.Tentacruel: + return Properties.Resources._73 + ; + case PokemonId.Geodude: + return Properties.Resources._74 + ; + case PokemonId.Graveler: + return Properties.Resources._75 + ; + case PokemonId.Golem: + return Properties.Resources._76 + ; + case PokemonId.Ponyta: + return Properties.Resources._77 + ; + case PokemonId.Rapidash: + return Properties.Resources._78 + ; + case PokemonId.Slowpoke: + return Properties.Resources._79 + ; + case PokemonId.Slowbro: + return Properties.Resources._80 + ; + case PokemonId.Magnemite: + return Properties.Resources._81 + ; + case PokemonId.Magneton: + return Properties.Resources._82 + ; + case PokemonId.Farfetchd: + return Properties.Resources._83 + ; + case PokemonId.Doduo: + return Properties.Resources._84 + ; + case PokemonId.Dodrio: + return Properties.Resources._85 + ; + case PokemonId.Seel: + return Properties.Resources._86 + ; + case PokemonId.Dewgong: + return Properties.Resources._87 + ; + case PokemonId.Grimer: + return Properties.Resources._88 + ; + case PokemonId.Muk: + return Properties.Resources._89 + ; + case PokemonId.Shellder: + return Properties.Resources._90 + ; + case PokemonId.Cloyster: + return Properties.Resources._91 + ; + case PokemonId.Gastly: + return Properties.Resources._92 + ; + case PokemonId.Haunter: + return Properties.Resources._93 + ; + case PokemonId.Gengar: + return Properties.Resources._94 + ; + case PokemonId.Onix: + return Properties.Resources._95 + ; + case PokemonId.Drowzee: + return Properties.Resources._96 + ; + case PokemonId.Hypno: + return Properties.Resources._97 + ; + case PokemonId.Krabby: + return Properties.Resources._98 + ; + case PokemonId.Kingler: + return Properties.Resources._99 + ; + case PokemonId.Voltorb: + return Properties.Resources._100 + ; + case PokemonId.Electrode: + return Properties.Resources._101 + ; + case PokemonId.Exeggcute: + return Properties.Resources._102 + ; + case PokemonId.Exeggutor: + return Properties.Resources._103 + ; + case PokemonId.Cubone: + return Properties.Resources._104 + ; + case PokemonId.Marowak: + return Properties.Resources._105 + ; + case PokemonId.Hitmonlee: + return Properties.Resources._106 + ; + case PokemonId.Hitmonchan: + return Properties.Resources._107 + ; + case PokemonId.Lickitung: + return Properties.Resources._108 + ; + case PokemonId.Koffing: + return Properties.Resources._109 + ; + case PokemonId.Weezing: + return Properties.Resources._110 + ; + case PokemonId.Rhyhorn: + return Properties.Resources._111 + ; + case PokemonId.Rhydon: + return Properties.Resources._112 + ; + case PokemonId.Chansey: + return Properties.Resources._113 + ; + case PokemonId.Tangela: + return Properties.Resources._114 + ; + case PokemonId.Kangaskhan: + return Properties.Resources._115 + ; + case PokemonId.Horsea: + return Properties.Resources._116 + ; + case PokemonId.Seadra: + return Properties.Resources._117 + ; + case PokemonId.Goldeen: + return Properties.Resources._118 + ; + case PokemonId.Seaking: + return Properties.Resources._119 + ; + case PokemonId.Staryu: + return Properties.Resources._120 + ; + case PokemonId.Starmie: + return Properties.Resources._121 + ; + case PokemonId.MrMime: + return Properties.Resources._122 + ; + case PokemonId.Scyther: + return Properties.Resources._123 + ; + case PokemonId.Jynx: + return Properties.Resources._124 + ; + case PokemonId.Electabuzz: + return Properties.Resources._125 + ; + case PokemonId.Magmar: + return Properties.Resources._126 + ; + case PokemonId.Pinsir: + return Properties.Resources._127 + ; + case PokemonId.Tauros: + return Properties.Resources._128 + ; + case PokemonId.Magikarp: + return Properties.Resources._129 + ; + case PokemonId.Gyarados: + return Properties.Resources._130 + ; + case PokemonId.Lapras: + return Properties.Resources._131 + ; + case PokemonId.Ditto: + return Properties.Resources._132 + ; + case PokemonId.Eevee: + return Properties.Resources._133 + ; + case PokemonId.Vaporeon: + return Properties.Resources._134 + ; + case PokemonId.Jolteon: + return Properties.Resources._135 + ; + case PokemonId.Flareon: + return Properties.Resources._136 + ; + case PokemonId.Porygon: + return Properties.Resources._137 + ; + case PokemonId.Omanyte: + return Properties.Resources._138 + ; + case PokemonId.Omastar: + return Properties.Resources._139 + ; + case PokemonId.Kabuto: + return Properties.Resources._140 + ; + case PokemonId.Kabutops: + return Properties.Resources._141 + ; + case PokemonId.Aerodactyl: + return Properties.Resources._142 + ; + case PokemonId.Snorlax: + return Properties.Resources._143 + ; + case PokemonId.Articuno: + return Properties.Resources._144 + ; + case PokemonId.Zapdos: + return Properties.Resources._145 + ; + case PokemonId.Moltres: + return Properties.Resources._146 + ; + case PokemonId.Dratini: + return Properties.Resources._147 + ; + case PokemonId.Dragonair: + return Properties.Resources._148 + ; + case PokemonId.Dragonite: + return Properties.Resources._149 + ; + case PokemonId.Mewtwo: + return Properties.Resources._150 + ; + case PokemonId.Mew: + return Properties.Resources._151; + } + return Properties.Resources.no_name; + } + } +} diff --git a/Catchem/MainWindow.xaml b/Catchem/MainWindow.xaml new file mode 100644 index 0000000..cb564bd --- /dev/null +++ b/Catchem/MainWindow.xaml @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Catchem/MainWindow.xaml.cs b/Catchem/MainWindow.xaml.cs index 998724d..bec283d 100644 --- a/Catchem/MainWindow.xaml.cs +++ b/Catchem/MainWindow.xaml.cs @@ -1,8 +1,11 @@ using GMap.NET; using GMap.NET.WindowsPresentation; using PoGo.PokeMobBot.Logic; +using PoGo.PokeMobBot.Logic.Common; +using PoGo.PokeMobBot.Logic.Event; using PoGo.PokeMobBot.Logic.Logging; using PoGo.PokeMobBot.Logic.State; +using PoGo.PokeMobBot.Logic.Utils; using POGOProtos.Enums; using PokemonGo.RocketAPI.Enums; using System; @@ -21,7 +24,7 @@ using System.Windows.Navigation; using System.Windows.Shapes; -namespace PokeBot +namespace Catchem { /// /// Interaction logic for MainWindow.xaml @@ -30,11 +33,25 @@ public partial class MainWindow : Window { public static MainWindow botWindow; private bool windowClosing = false; - private BotWindowData bot = null; string subPath = "Profiles"; - List settings = new List(); private Dictionary openedSessions = new Dictionary(); //may be not session... but some uniq obj for every running bot + private ISession curSession = null; + + private BotWindowData bot + { + get + { + if (curSession != null) + { + if (openedSessions.ContainsKey(curSession)) + { + return openedSessions[curSession]; + } + } + return null; + } + } //string Async Queues Queue> logQueue = new Queue>(); @@ -110,7 +127,7 @@ void InitBots() { if (item != subPath + "\\Logs") { - settings.Add(GlobalSettings.Load(item)); + initBot(GlobalSettings.Load(item)); } } } @@ -215,12 +232,29 @@ private class BotWindowData { public List> log = new List>(); public Dictionary mapMarkers = new Dictionary(); - public double Lat = 55.754853; + public StateMachine machine = null; + public Statistics stats = null; + public StatisticsAggregator aggregator = null; + public WpfEventListener listener = null; + public ClientSettings settings = null; + public LogicSettings logic = null; + + public double Lat = 55.43213; public double Lng = 37.633987; public bool gotNewCoord = false; public bool moveRequired = false; public double _lat, _lng; public double _latStep = 0, _lngStep = 0; + + public BotWindowData(StateMachine sm, Statistics st, StatisticsAggregator sa, WpfEventListener wel, ClientSettings cs, LogicSettings l) + { + machine = sm; + stats = st; + aggregator = sa; + listener = wel; + settings = cs; + logic = l; + } } internal class NewMapObject @@ -290,11 +324,45 @@ private void YesButton_Click(object sender, RoutedEventArgs e) String input = InputTextBox.Text; var dir = Directory.CreateDirectory(subPath + "\\" + input); - settings.Add(GlobalSettings.Load(dir.FullName)); + var settings = GlobalSettings.Load(dir.FullName); + // Clear InputBox. InputTextBox.Text = String.Empty; } + private void initBot(GlobalSettings settings) + { + var newBot = CreateBowWindowData(settings); + + var session = new Session(newBot.settings, newBot.logic); + session.Client.ApiFailure = new ApiFailureStrategy(session); + + session.EventDispatcher.EventReceived += evt => newBot.listener.Listen(evt, session); + session.EventDispatcher.EventReceived += evt => newBot.aggregator.Listen(evt, session); + + session.Navigation.UpdatePositionEvent += + (lat, lng) => session.EventDispatcher.Send(new UpdatePositionEvent { Latitude = lat, Longitude = lng }); + + newBot.machine.SetFailureState(new LoginState()); + + openedSessions.Add(session, CreateBowWindowData(settings)); + } + + private BotWindowData CreateBowWindowData(GlobalSettings _s) + { + var stats = new Statistics(); + //stats.DirtyEvent += + // () => + // Console.Title = + // stats.GetTemplatedStats( + // session.Translation.GetTranslation(TranslationString.StatsTemplateString), + // session.Translation.GetTranslation(TranslationString.StatsXpTemplateString)); + + return new BotWindowData(new StateMachine(), stats, new StatisticsAggregator(stats), + new WpfEventListener(), new ClientSettings(_s), new LogicSettings(_s)); + + } + private void NoButton_Click(object sender, RoutedEventArgs e) { // NoButton Clicked! Let's hide our InputBox. diff --git a/Catchem/Properties/Resources.Designer.cs b/Catchem/Properties/Resources.Designer.cs index 1ce1f84..65fbd26 100644 --- a/Catchem/Properties/Resources.Designer.cs +++ b/Catchem/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace PokeBot.Properties { +namespace Catchem.Properties { using System; @@ -39,7 +39,7 @@ internal Resources() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PokeBot.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Catchem.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/Catchem/Properties/Settings.Designer.cs b/Catchem/Properties/Settings.Designer.cs index 5ca8cb1..cca2ff7 100644 --- a/Catchem/Properties/Settings.Designer.cs +++ b/Catchem/Properties/Settings.Designer.cs @@ -8,21 +8,17 @@ // //------------------------------------------------------------------------------ -namespace PokeBot.Properties -{ - - +namespace Catchem.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/Catchem/WpfEventListener.cs b/Catchem/WpfEventListener.cs new file mode 100644 index 0000000..dc7385f --- /dev/null +++ b/Catchem/WpfEventListener.cs @@ -0,0 +1,251 @@ +using PoGo.PokeMobBot.Logic.Common; +using PoGo.PokeMobBot.Logic.Event; +using PoGo.PokeMobBot.Logic.Logging; +using PoGo.PokeMobBot.Logic.State; +using POGOProtos.Enums; +using POGOProtos.Inventory.Item; +using POGOProtos.Networking.Responses; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Catchem +{ + public class WpfEventListener + { + public void HandleEvent(ProfileEvent evt, ISession session) + { + Logger.Write(session.Translation.GetTranslation(TranslationString.EventProfileLogin, + evt.Profile.PlayerData.Username ?? "")); + } + + public void HandleEvent(ErrorEvent evt, ISession session) + { + Logger.Write(evt.ToString(), LogLevel.Error); + } + + public void HandleEvent(NoticeEvent evt, ISession session) + { + Logger.Write(evt.ToString()); + } + + public void HandleEvent(WarnEvent evt, ISession session) + { + Logger.Write(evt.ToString(), LogLevel.Warning); + + if (evt.RequireInput) + { + Logger.Write(session.Translation.GetTranslation(TranslationString.RequireInputText)); + Console.ReadKey(); + } + } + + public void HandleEvent(UseLuckyEggEvent evt, ISession session) + { + Logger.Write(session.Translation.GetTranslation(TranslationString.EventUsedLuckyEgg, evt.Count), + LogLevel.Egg); + } + + public void HandleEvent(PokemonEvolveEvent evt, ISession session) + { + Logger.Write(evt.Result == EvolvePokemonResponse.Types.Result.Success + ? session.Translation.GetTranslation(TranslationString.EventPokemonEvolvedSuccess, evt.Id, evt.Exp) + : session.Translation.GetTranslation(TranslationString.EventPokemonEvolvedFailed, evt.Id, evt.Result, + evt.Id), + LogLevel.Evolve); + } + + public void HandleEvent(TransferPokemonEvent evt, ISession session) + { + Logger.Write( + session.Translation.GetTranslation(TranslationString.EventPokemonTransferred, evt.Id, evt.Cp, + evt.Perfection.ToString("0.00"), evt.BestCp, evt.BestPerfection.ToString("0.00"), evt.FamilyCandies), + LogLevel.Transfer); + } + + public void HandleEvent(ItemRecycledEvent evt, ISession session) + { + Logger.Write(session.Translation.GetTranslation(TranslationString.EventItemRecycled, evt.Count, evt.Id), + LogLevel.Recycling); + } + + public void HandleEvent(EggIncubatorStatusEvent evt, ISession session) + { + Logger.Write(evt.WasAddedNow + ? session.Translation.GetTranslation(TranslationString.IncubatorPuttingEgg, evt.KmRemaining) + : session.Translation.GetTranslation(TranslationString.IncubatorStatusUpdate, evt.KmRemaining), + LogLevel.Egg); + } + + public void HandleEvent(EggHatchedEvent evt, ISession session) + { + Logger.Write(session.Translation.GetTranslation(TranslationString.IncubatorEggHatched, + evt.PokemonId.ToString(), evt.Level, evt.Cp, evt.MaxCp, evt.Perfection), + LogLevel.Egg); + } + + public void HandleEvent(FortUsedEvent evt, ISession session) + { + var itemString = evt.InventoryFull + ? session.Translation.GetTranslation(TranslationString.InvFullPokestopLooting) + : evt.Items; + Logger.Write( + session.Translation.GetTranslation(TranslationString.EventFortUsed, evt.Name, evt.Exp, evt.Gems, + itemString), + LogLevel.Pokestop); + } + + public void HandleEvent(FortFailedEvent evt, ISession session) + { + Logger.Write( + session.Translation.GetTranslation(TranslationString.EventFortFailed, evt.Name, evt.Try, evt.Max), + LogLevel.Pokestop, ConsoleColor.DarkRed); + } + + public void HandleEvent(FortTargetEvent evt, ISession session) + { + Logger.Write( + session.Translation.GetTranslation(TranslationString.EventFortTargeted, evt.Name, + Math.Round(evt.Distance)), + LogLevel.Info, ConsoleColor.DarkRed); + } + + public void HandleEvent(PokemonCaptureEvent evt, ISession session) + { + Func returnRealBallName = a => + { + switch (a) + { + case ItemId.ItemPokeBall: + return session.Translation.GetTranslation(TranslationString.Pokeball); + case ItemId.ItemGreatBall: + return session.Translation.GetTranslation(TranslationString.GreatPokeball); + case ItemId.ItemUltraBall: + return session.Translation.GetTranslation(TranslationString.UltraPokeball); + case ItemId.ItemMasterBall: + return session.Translation.GetTranslation(TranslationString.MasterPokeball); + default: + return session.Translation.GetTranslation(TranslationString.CommonWordUnknown); + } + }; + + var catchType = evt.CatchType; + + string strStatus; + switch (evt.Status) + { + case CatchPokemonResponse.Types.CatchStatus.CatchError: + strStatus = session.Translation.GetTranslation(TranslationString.CatchStatusError); + break; + case CatchPokemonResponse.Types.CatchStatus.CatchEscape: + strStatus = session.Translation.GetTranslation(TranslationString.CatchStatusEscape); + break; + case CatchPokemonResponse.Types.CatchStatus.CatchFlee: + strStatus = session.Translation.GetTranslation(TranslationString.CatchStatusFlee); + break; + case CatchPokemonResponse.Types.CatchStatus.CatchMissed: + strStatus = session.Translation.GetTranslation(TranslationString.CatchStatusMissed); + break; + case CatchPokemonResponse.Types.CatchStatus.CatchSuccess: + strStatus = session.Translation.GetTranslation(TranslationString.CatchStatusSuccess); + break; + default: + strStatus = evt.Status.ToString(); + break; + } + + var catchStatus = evt.Attempt > 1 + ? session.Translation.GetTranslation(TranslationString.CatchStatusAttempt, strStatus, evt.Attempt) + : session.Translation.GetTranslation(TranslationString.CatchStatus, strStatus); + + var familyCandies = evt.FamilyCandies > 0 + ? session.Translation.GetTranslation(TranslationString.Candies, evt.FamilyCandies) + : ""; + + Logger.Write( + session.Translation.GetTranslation(TranslationString.EventPokemonCapture, catchStatus, catchType, evt.Id, + evt.Level, evt.Cp, evt.MaxCp, evt.Perfection.ToString("0.00"), evt.Probability, + evt.Distance.ToString("F2"), + returnRealBallName(evt.Pokeball), evt.BallAmount, familyCandies), LogLevel.Caught); + } + + public void HandleEvent(NoPokeballEvent evt, ISession session) + { + Logger.Write(session.Translation.GetTranslation(TranslationString.EventNoPokeballs, evt.Id, evt.Cp), + LogLevel.Caught); + } + + public void HandleEvent(UseBerryEvent evt, ISession session) + { + Logger.Write(session.Translation.GetTranslation(TranslationString.EventNoPokeballs, evt.Count), + LogLevel.Berry); + } + + public void HandleEvent(SnipeScanEvent evt, ISession session) + { + Logger.Write(evt.PokemonId == PokemonId.Missingno + ? session.Translation.GetTranslation(TranslationString.SnipeScan, + $"{evt.Bounds.Latitude},{evt.Bounds.Longitude}") + : session.Translation.GetTranslation(TranslationString.SnipeScanEx, evt.PokemonId, + evt.Iv > 0 ? evt.Iv.ToString(CultureInfo.InvariantCulture) : "unknown", + $"{evt.Bounds.Latitude},{evt.Bounds.Longitude}")); + } + + public void HandleEvent(DisplayHighestsPokemonEvent evt, ISession session) + { + string strHeader; + //PokemonData | CP | IV | Level | MOVE1 | MOVE2 + switch (evt.SortedBy) + { + case "Level": + strHeader = session.Translation.GetTranslation(TranslationString.DisplayHighestsLevelHeader); + break; + case "IV": + strHeader = session.Translation.GetTranslation(TranslationString.DisplayHighestsPerfectHeader); + break; + case "CP": + strHeader = session.Translation.GetTranslation(TranslationString.DisplayHighestsCpHeader); + break; + case "MOVE1": + strHeader = session.Translation.GetTranslation(TranslationString.DisplayHighestMove1Header); + break; + case "MOVE2": + strHeader = session.Translation.GetTranslation(TranslationString.DisplayHighestMove2Header); + break; + default: + strHeader = session.Translation.GetTranslation(TranslationString.DisplayHighestsHeader); + break; + } + var strPerfect = session.Translation.GetTranslation(TranslationString.CommonWordPerfect); + var strName = session.Translation.GetTranslation(TranslationString.CommonWordName).ToUpper(); + + Logger.Write($"====== {strHeader} ======", LogLevel.Info, ConsoleColor.Yellow); + foreach (var pokemon in evt.PokemonList) + Logger.Write( + $"# CP {pokemon.Item1.Cp.ToString().PadLeft(4, ' ')}/{pokemon.Item2.ToString().PadLeft(4, ' ')} | ({pokemon.Item3.ToString("0.00")}% {strPerfect})\t| Lvl {pokemon.Item4.ToString("00")}\t {strName}: {pokemon.Item1.PokemonId.ToString().PadRight(10, ' ')}\t MOVE1: {pokemon.Item5.ToString().PadRight(20, ' ')} MOVE2: {pokemon.Item6}", + LogLevel.Info, ConsoleColor.Yellow); + } + + public void HandleEvent(UpdateEvent evt, ISession session) + { + Logger.Write(evt.ToString(), LogLevel.Update); + } + + public void Listen(IEvent evt, ISession session) + { + dynamic eve = evt; + + try + { + HandleEvent(eve, session); + } + // ReSharper disable once EmptyGeneralCatchClause + catch + { + } + } + } +} diff --git a/Catchem/WpfLogger.cs b/Catchem/WpfLogger.cs index 77f6ccc..dc80982 100644 --- a/Catchem/WpfLogger.cs +++ b/Catchem/WpfLogger.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using System.Windows.Media; -namespace PokeBot +namespace Catchem { public class WpfLogger : ILogger { diff --git a/PoGo.PokeMobBot.Logic/State/VersionCheckState.cs b/PoGo.PokeMobBot.Logic/State/VersionCheckState.cs index e63bf9a..b2ea982 100644 --- a/PoGo.PokeMobBot.Logic/State/VersionCheckState.cs +++ b/PoGo.PokeMobBot.Logic/State/VersionCheckState.cs @@ -21,7 +21,7 @@ namespace PoGo.PokeMobBot.Logic.State public class VersionCheckState : IState { public const string VersionUri = - "https://raw.githubusercontent.com/PocketMobsters/PokeMobBot/master/PoGo.PokeMobBot.Logic/Properties/AssemblyInfo.cs"; + "https://raw.githubusercontent.com/Lunat1q/Catchem/Catchem/PoGo.PokeMobBot.Logic/Properties/AssemblyInfo.cs"; public const string LatestReleaseApi = "https://api.github.com/repos/PocketMobsters/PokeMobBot/releases/latest"; From 97549565ad8e7ad07b7f712d99f8a1c6807f9cbd Mon Sep 17 00:00:00 2001 From: Lunat1q Date: Mon, 1 Aug 2016 11:23:39 +0300 Subject: [PATCH 05/45] userPanels_Example --- Catchem/MainWindow.xaml | 79 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/Catchem/MainWindow.xaml b/Catchem/MainWindow.xaml index 09066d1..a38e398 100644 --- a/Catchem/MainWindow.xaml +++ b/Catchem/MainWindow.xaml @@ -148,7 +148,84 @@