diff --git a/.gitmodules b/.gitmodules
index 3261a2304..f1bbb6257 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -2,3 +2,7 @@
path = FeroxRev
url = https://github.com/NoxxDev/NecroBot-Rocket-API.git
branch = master
+[submodule "POGOProtos"]
+ path = POGOProtos
+ url = https://github.com/NoxxDev/POGOProtos-0.35.0.git
+ branch = master
\ No newline at end of file
diff --git a/FeroxRev b/FeroxRev
index 8daf040cc..9bdf8d91b 160000
--- a/FeroxRev
+++ b/FeroxRev
@@ -1 +1 @@
-Subproject commit 8daf040cc61f8de0662448a898975b46d7e2086e
+Subproject commit 9bdf8d91bba7adaf10e2299a7215ae93473d89a2
diff --git a/NecroBot for Pokemon Go.sln b/NecroBot for Pokemon Go.sln
index 7aacabab2..0ca20f796 100644
--- a/NecroBot for Pokemon Go.sln
+++ b/NecroBot for Pokemon Go.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
-VisualStudioVersion = 14.0.24720.0
+VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PoGo.NecroBot.CLI", "PoGo.NecroBot.CLI\PoGo.NecroBot.CLI.csproj", "{1FEA147E-F704-497B-A538-00B053B5F672}"
EndProject
@@ -9,24 +9,48 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PoGo.NecroBot.Logic", "PoGo
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PokemonGo.RocketAPI", "FeroxRev\PokemonGo.RocketAPI\PokemonGo.RocketAPI.csproj", "{05D2DA44-1B8E-4CF7-94ED-4D52451CD095}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POGOProtos", "POGOProtos\POGOProtos\POGOProtos.csproj", "{A03A7BB2-4F0B-467B-84B2-9A76E6AAE6FB}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {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}.Debug|x86.ActiveCfg = Debug|x86
{1FEA147E-F704-497B-A538-00B053B5F672}.Debug|x86.Build.0 = Debug|x86
+ {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
{1FEA147E-F704-497B-A538-00B053B5F672}.Release|x86.ActiveCfg = Release|x86
{1FEA147E-F704-497B-A538-00B053B5F672}.Release|x86.Build.0 = Release|x86
+ {0739E40D-C589-4AEB-93E5-EE8CD6773C60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0739E40D-C589-4AEB-93E5-EE8CD6773C60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0739E40D-C589-4AEB-93E5-EE8CD6773C60}.Debug|x86.ActiveCfg = Debug|x86
{0739E40D-C589-4AEB-93E5-EE8CD6773C60}.Debug|x86.Build.0 = Debug|x86
+ {0739E40D-C589-4AEB-93E5-EE8CD6773C60}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0739E40D-C589-4AEB-93E5-EE8CD6773C60}.Release|Any CPU.Build.0 = Release|Any CPU
{0739E40D-C589-4AEB-93E5-EE8CD6773C60}.Release|x86.ActiveCfg = Release|x86
{0739E40D-C589-4AEB-93E5-EE8CD6773C60}.Release|x86.Build.0 = Release|x86
+ {05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Debug|x86.ActiveCfg = Debug|x86
{05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Debug|x86.Build.0 = Debug|x86
+ {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
{05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Release|x86.ActiveCfg = Release|x86
{05D2DA44-1B8E-4CF7-94ED-4D52451CD095}.Release|x86.Build.0 = Release|x86
+ {A03A7BB2-4F0B-467B-84B2-9A76E6AAE6FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A03A7BB2-4F0B-467B-84B2-9A76E6AAE6FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A03A7BB2-4F0B-467B-84B2-9A76E6AAE6FB}.Debug|x86.ActiveCfg = Debug|x86
+ {A03A7BB2-4F0B-467B-84B2-9A76E6AAE6FB}.Debug|x86.Build.0 = Debug|x86
+ {A03A7BB2-4F0B-467B-84B2-9A76E6AAE6FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A03A7BB2-4F0B-467B-84B2-9A76E6AAE6FB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A03A7BB2-4F0B-467B-84B2-9A76E6AAE6FB}.Release|x86.ActiveCfg = Release|x86
+ {A03A7BB2-4F0B-467B-84B2-9A76E6AAE6FB}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.ca.json b/PoGo.NecroBot.CLI/Config/Translations/translation.ca.json
index 304818596..52638e3dd 100644
--- a/PoGo.NecroBot.CLI/Config/Translations/translation.ca.json
+++ b/PoGo.NecroBot.CLI/Config/Translations/translation.ca.json
@@ -78,7 +78,7 @@
},
{
"Key": "eventFortUsed",
- "Value": "Nom: {0} XP: {1}, Gemmes: {2}, Objectes: {3}, Lat: {4}, Long: {5}"
+ "Value": "Nom: {0} XP: {1}, Gemmes: {2}, Objectes: {3}, Lat: {4}, Long: {5}, Alt: {6}"
},
{
"Key": "eventFortFailed",
diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.es.json b/PoGo.NecroBot.CLI/Config/Translations/translation.es.json
index 99a5552c3..79487a9ee 100644
--- a/PoGo.NecroBot.CLI/Config/Translations/translation.es.json
+++ b/PoGo.NecroBot.CLI/Config/Translations/translation.es.json
@@ -78,7 +78,7 @@
},
{
"Key": "eventFortUsed",
- "Value": "Nombre: {0} Exp: {1}, Gemas: {2}, Objetos: {3}, Lat: {4}, Long: {5}"
+ "Value": "Nombre: {0} Exp: {1}, Gemas: {2}, Objetos: {3}, Lat: {4}, Long: {5}, Alt: {6}"
},
{
"Key": "eventFortFailed",
diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.id.json b/PoGo.NecroBot.CLI/Config/Translations/translation.id.json
index d1d4ac94b..3c362c003 100644
--- a/PoGo.NecroBot.CLI/Config/Translations/translation.id.json
+++ b/PoGo.NecroBot.CLI/Config/Translations/translation.id.json
@@ -2,43 +2,43 @@
"TranslationStrings": [
{
"Key": "HumanWalkSnipeNotEnoughtBalls",
- "Value": "(HUMAN WALK) Not enought balls to activate catch Em-All mode. ({0})/{1}"
+ "Value": "(Sambil jalan) Jumlah PokeBall untuk mengaktifkan mode 'Sapu-Bersih' tidak cukup: ({0})/{1}"
},
{
"Key": "HumanWalkSnipe",
- "Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
+ "Value": "(Sambil jalan) {0} terlihat! | Koordinat: {1}, {2}, jarak {3:0.00} m, berakhir dalam {4:00} mnt {5:00} dtk | Waktu tempuh : {6:00} mnt {7:00} dtk | Sambil singgah di PokeStop: {8} | Sambil tangkap Pokemon lain: {9}"
},
{
"Key": "HumanWalkSnipeUpdate",
- "Value": "(HUMAN WALK) Found {0} pokemon matched with you filters. Human walking sniper won't catch em all, but try to catch as many as possible"
+ "Value": "(Sambil jalan) Ada {0} pokemon cocok dengan filtermu. Tidak akan dapat semua, tapi mencoba yang terbaik."
},
{
"Key": "HumanWalkSnipeAddedPokestop",
- "Value": "(HUMAN WALK) You are {0:0.00m} away from nearest pokestop. Restart farming at this place with {1} pokestops"
+ "Value": "(Sambil jalan) Kamu {0:0.00} m jauhnya dari PokeStop terdekat. Mulai panen di lokasi ini dengan {1} PokeStop."
},
{
"Key": "HumanWalkSnipeDestinationReached",
- "Value": "(HUMAN WALK) destination reached | lat: {0}, lng: {1}"
+ "Value": "(Sambil jalan) Sampai di lokasi | Koordinat: {0}, {1}"
},
{
"Key": "SniperCount",
- "Value": "Sniper count {0}"
+ "Value": "Jumlah bidikan {0}"
},
{
"Key": "SnipeExceeds",
- "Value": "Sniper need to take a rest before your account is banned"
+ "Value": "Sniper harus diistirahatkan sebelum akun kamu kena Ban"
},
{
"Key": "CatchExceeds",
- "Value": "You are catching too fast. Your cannot catch another one until {0} seconds later"
+ "Value": "Kamu menangkap terlalu cepat. Kamu tidak akan dapat menangkap hingga {0} detik lagi"
},
{
"Key": "PokeStopExceeds",
- "Value": "You are visiting pokestops too fast. Your cannot visit another one until {0} seconds later"
+ "Value": "Kamu singgah di PokeStop terlalu cepat. Kamu tidak akan dapat singgah hingga {0} detik lagi"
},
{
"Key": "Only10kmEggs",
- "Value": "Player below level 20, saving this 10 km Egg for later"
+ "Value": "Masih di bawah level 20, simpan dulu telur 10 km"
},
{
"Key": "GoogleAPIWarning",
@@ -78,7 +78,7 @@
},
{
"Key": "eventFortUsed",
- "Value": "Nama {0} | Dapat {1}xp, gem: {2}, barang: {3}, koordinat: {4}, {5}"
+ "Value": "Nama {0} | Dapat {1}xp, gem: {2}, barang: {3}, koordinat: {4}, {5}, {6}"
},
{
"Key": "eventFortFailed",
diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.nl-NL.json b/PoGo.NecroBot.CLI/Config/Translations/translation.nl-NL.json
index 28688f60d..e5e9c34a5 100644
--- a/PoGo.NecroBot.CLI/Config/Translations/translation.nl-NL.json
+++ b/PoGo.NecroBot.CLI/Config/Translations/translation.nl-NL.json
@@ -74,7 +74,7 @@
},
{
"Key": "eventFortUsed",
- "Value": "Naam: {0} XP: {1}, Gems: {2}, Items: {3}, Lat: {4}, Long: {5}"
+ "Value": "Naam: {0} XP: {1}, Gems: {2}, Items: {3}, Lat: {4}, Long: {5}, Alt: {6}"
},
{
diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.pl.json b/PoGo.NecroBot.CLI/Config/Translations/translation.pl.json
index 1a5de3207..9053ec4ad 100644
--- a/PoGo.NecroBot.CLI/Config/Translations/translation.pl.json
+++ b/PoGo.NecroBot.CLI/Config/Translations/translation.pl.json
@@ -2,11 +2,11 @@
"TranslationStrings": [
{
"Key": "HumanWalkSnipeNotEnoughtBalls",
- "Value": "(HUMAN WALK) Not enought balls to activate catch Em-All mode. ({0})/{1}"
+ "Value": "(HUMAN WALK) Niewystarczająca ilość piłem do aktywacji catch Em-All mode. ({0})/{1}"
},
{
"Key": "HumanWalkSnipe",
- "Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
+ "Value": "(HUMAN WALK) Znaleziono {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9}"
},
{
"Key": "HumanWalkSnipeUpdate",
@@ -26,7 +26,7 @@
},
{
"Key": "SnipeExceeds",
- "Value": "Sniper need to take a rest before your account is banned"
+ "Value": "Sniper musi zrobić sobie przerwę bo inaczej konto może zostać zablokowane"
},
{
"Key": "CatchExceeds",
@@ -38,11 +38,11 @@
},
{
"Key": "Only10kmEggs",
- "Value": "Player below level 20, saving this 10 km Egg for later"
+ "Value": "Gracz poniżej 20 poziomu, oszczędza 10 km Egg na potem"
},
{
"Key": "GoogleAPIWarning",
- "Value": "Without a Google Api, you will have 2500 free quota limit, if you reach the maximum quota, try to change your IP. To configure \"GoogleAPIKey\", get API Key in link: https://developers.google.com/maps/documentation/directions/get-api-key"
+ "Value": "Bez API Google, trzeba będzie 2500 bezpłatny limit przydziału, jeśli osiągnie maksymalny limit, spróbuj zmienić swój adres IP. Do konfiguracji \"GoogleAPIKey\", weź API Key z link: https://developers.google.com/maps/documentation/directions/get-api-key"
},
{
"Key": "pokeball",
diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.pt-br.json b/PoGo.NecroBot.CLI/Config/Translations/translation.pt-br.json
index f6f5082d7..52a8ad7ed 100644
--- a/PoGo.NecroBot.CLI/Config/Translations/translation.pt-br.json
+++ b/PoGo.NecroBot.CLI/Config/Translations/translation.pt-br.json
@@ -78,7 +78,7 @@
},
{
"Key": "eventFortUsed",
- "Value": "Nome: {0} XP: {1}, Gemas: {2}, Itens: {3}, Lat: {4}, Long: {5}"
+ "Value": "Nome: {0} XP: {1}, Gemas: {2}, Itens: {3}, Lat: {4}, Long: {5}, Alt: {6}"
},
{
"Key": "eventFortFailed",
diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.ro.json b/PoGo.NecroBot.CLI/Config/Translations/translation.ro.json
index 2c12a9cc8..2c156a137 100644
--- a/PoGo.NecroBot.CLI/Config/Translations/translation.ro.json
+++ b/PoGo.NecroBot.CLI/Config/Translations/translation.ro.json
@@ -78,7 +78,7 @@
},
{
"Key": "eventFortUsed",
- "Value": "Nume: {0} XP: {1} Gemuri: {2} Obiecte: {3} Lat: {4} Long: {5}"
+ "Value": "Nume: {0} XP: {1} Gemuri: {2} Obiecte: {3} Lat: {4} Long: {5}, Alt: {6}"
},
{
"Key": "eventFortFailed",
diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.vi.json b/PoGo.NecroBot.CLI/Config/Translations/translation.vi.json
index 5eaeace64..fe561b384 100644
--- a/PoGo.NecroBot.CLI/Config/Translations/translation.vi.json
+++ b/PoGo.NecroBot.CLI/Config/Translations/translation.vi.json
@@ -78,7 +78,7 @@
},
{
"Key": "eventFortUsed",
- "Value": "Tên: {0} XP: {1}, Gems: {2}, Items: {3}, Lat: {4}, Long: {5}"
+ "Value": "Tên: {0} XP: {1}, Gems: {2}, Items: {3}, Lat: {4}, Long: {5}, Alt: {6}"
},
{
"Key": "eventFortFailed",
diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.zh-CN.json b/PoGo.NecroBot.CLI/Config/Translations/translation.zh-CN.json
index d78446f57..7841fcd69 100644
--- a/PoGo.NecroBot.CLI/Config/Translations/translation.zh-CN.json
+++ b/PoGo.NecroBot.CLI/Config/Translations/translation.zh-CN.json
@@ -78,7 +78,7 @@
},
{
"Key": "eventFortUsed",
- "Value": "补给站:{0} 经验+{1},宝石+{2},获得:{3},坐标{4},{5}\t\t\t"
+ "Value": "补给站:{0} 经验+{1},宝石+{2},获得:{3},坐标{4},{5},{6}\t\t\t"
},
{
"Key": "eventFortFailed",
diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.zh-CN_pp.json b/PoGo.NecroBot.CLI/Config/Translations/translation.zh-CN_pp.json
index fa02730bd..d7642f755 100644
--- a/PoGo.NecroBot.CLI/Config/Translations/translation.zh-CN_pp.json
+++ b/PoGo.NecroBot.CLI/Config/Translations/translation.zh-CN_pp.json
@@ -78,7 +78,7 @@
},
{
"Key": "eventFortUsed",
- "Value": "补给站:{0} 经验+{1},晶石+{2},获得:{3},坐标{4},{5}\t\t\t"
+ "Value": "补给站:{0} 经验+{1},晶石+{2},获得:{3},坐标{4},{5},{6}\t\t\t"
},
{
"Key": "eventFortFailed",
diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.zh-TW.json b/PoGo.NecroBot.CLI/Config/Translations/translation.zh-TW.json
index 8a403f08d..6b944db77 100644
--- a/PoGo.NecroBot.CLI/Config/Translations/translation.zh-TW.json
+++ b/PoGo.NecroBot.CLI/Config/Translations/translation.zh-TW.json
@@ -2,47 +2,47 @@
"TranslationStrings": [
{
"Key": "HumanWalkSnipeNotEnoughtBalls",
- "Value": "(HUMAN WALK) Not enought balls to activate catch Em-All mode. ({0})/{1}"
+ "Value": "(仿人行走) 沒有足夠的寶貝球以啟動catch Em-All(收服所有神奇寶貝)模式 ({0})/{1}"
},
{
"Key": "HumanWalkSnipe",
- "Value": "(HUMAN WALK) Found {0} spawning | lat: {1}, lng: {2}, dist {3:0.00}m , expired in {4:00} min {5:00} sec | Walk time est : {6:00} min {7:00} sec | Spin: {8} | Catch : {9} | Speed : {10:0.00}km/h"
+ "Value": "(仿人行走) 發現一隻{0} | 緯度:{1}, 經度:{2}, 距離{3:0.00}公尺 , 在{4:00}分 {5:00}秒後消失 | 估計行走時間: {6:00}分 {7:00}秒 | 轉牌: {8} | 捕捉: {9}"
},
{
"Key": "HumanWalkSnipeUpdate",
- "Value": "(HUMAN WALK) Found {0} pokemon matched with you filters. Human walking sniper won't catch em all, but try to catch as many as possible"
+ "Value": "(仿人行走) 發現{0}隻神奇寶貝符合你的狙擊設定。仿人行走狙擊沒辦法捕捉所有的神奇寶貝,但會盡可能的捕捉"
},
{
"Key": "HumanWalkSnipeAddedPokestop",
- "Value": "(HUMAN WALK) You are {0:0.00m} away from nearest pokestop. Restart farming at this place with {1} pokestops"
+ "Value": "(仿人行走) 距離最近驛站{0:0.00m}。此處擁有{1}個驛站,將在此處重新開始掛機"
},
{
"Key": "HumanWalkSnipeDestinationReached",
- "Value": "(HUMAN WALK) destination reached | lat: {0}, lng: {1}"
+ "Value": "(仿人行走) 到達目的地 | 緯度: {0}, 經度: {1}"
},
{
"Key": "SniperCount",
- "Value": "Sniper count {0}"
+ "Value": "狙擊計數: {0} 次"
},
{
"Key": "SnipeExceeds",
- "Value": "Sniper need to take a rest before your account is banned"
+ "Value": "狙擊需要休息一會,以降低被ban機率"
},
{
"Key": "CatchExceeds",
- "Value": "You are catching too fast. Your cannot catch another one until {0} seconds later"
+ "Value": "短時間捕捉過多神奇寶貝。在 {0} 秒後能捕捉新的神奇寶貝"
},
{
"Key": "PokeStopExceeds",
- "Value": "You are visiting pokestops too fast. Your cannot visit another one until {0} seconds later"
+ "Value": "短時間拜訪過多驛站。在 {0} 秒後能拜訪新的驛站"
},
{
"Key": "Only10kmEggs",
- "Value": "Player below level 20, saving this 10 km Egg for later"
+ "Value": "玩家低於等級20,暫時保留10公里的蛋之後再用"
},
{
"Key": "GoogleAPIWarning",
- "Value": "Without a Google Api, you will have 2500 free quota limit, if you reach the maximum quota, try to change your IP. To configure \"GoogleAPIKey\", get API Key in link: https://developers.google.com/maps/documentation/directions/get-api-key"
+ "Value": "沒有Google Api,你每天將只有2500次的共享限制。如果你達到次數上限,可試著更換你的IP。或者去設定 \"GoogleAPIKey\",在以下網址可取得API Key:https://developers.google.com/maps/documentation/directions/get-api-key"
},
{
"Key": "pokeball",
@@ -50,11 +50,11 @@
},
{
"Key": "greatPokeball",
- "Value": "高級球"
+ "Value": "超級球"
},
{
"Key": "ultraPokeball",
- "Value": "超級球"
+ "Value": "高級球"
},
{
"Key": "masterPokeball",
@@ -78,7 +78,7 @@
},
{
"Key": "eventFortUsed",
- "Value": "名稱:{0} 經驗值:{1},金幣:{2},物品:{3},座標:{4},{5}\t\t\t\t"
+ "Value": "名稱:{0} 經驗值:{1},金幣:{2},物品:{3},座標:{4},{5},{6}\t\t\t\t"
},
{
"Key": "eventFortFailed",
@@ -370,7 +370,7 @@
},
{
"Key": "currentPokeballInv",
- "Value": "寶貝球:{0} | 高級球:{1} | 超級球:{2} | 大師球:{3}\t\t\t\t"
+ "Value": "寶貝球:{0} | 超級球:{1} | 高級球:{2} | 大師球:{3}\t\t\t\t"
},
{
"Key": "CurrentPotionInv",
@@ -446,7 +446,7 @@
},
{
"Key": "catchStatusMissed",
- "Value": "錯過"
+ "Value": "丟失"
},
{
"Key": "catchStatusSuccess",
@@ -743,7 +743,7 @@
},
{
"Key": "AccountBanned",
- "Value": "Probably Permanent Ban!"
+ "Value": "此帳號可能已被永久停權!"
}
],
"PokemonStrings": [
diff --git a/PoGo.NecroBot.CLI/ConsoleEventListener.cs b/PoGo.NecroBot.CLI/ConsoleEventListener.cs
index c9917c213..8c03df5bc 100644
--- a/PoGo.NecroBot.CLI/ConsoleEventListener.cs
+++ b/PoGo.NecroBot.CLI/ConsoleEventListener.cs
@@ -98,7 +98,7 @@ private static void HandleEvent(FortUsedEvent fortUsedEvent, ISession session)
: fortUsedEvent.Items;
Logger.Write(
session.Translation.GetTranslation(TranslationString.EventFortUsed, fortUsedEvent.Name, fortUsedEvent.Exp, fortUsedEvent.Gems,
- itemString, fortUsedEvent.Latitude, fortUsedEvent.Longitude),
+ itemString, fortUsedEvent.Latitude, fortUsedEvent.Longitude, fortUsedEvent.Altitude),
LogLevel.Pokestop);
}
@@ -390,7 +390,7 @@ private static void HandleEvent(HumanWalkSnipeEvent ev, ISession session)
Logger.Write(session.Translation.GetTranslation(TranslationString.HumanWalkSnipeUpdate, ev.Pokemons.Count, 2, 3), LogLevel.Sniper, ConsoleColor.DarkMagenta);
break;
case HumanWalkSnipeEventTypes.PokestopUpdated:
- Logger.Write(session.Translation.GetTranslation(TranslationString.HumanWalkSnipeAddedPokestop, ev.NearestDistane, ev.Pokestops.Count), LogLevel.Sniper, ConsoleColor.Yellow);
+ Logger.Write(session.Translation.GetTranslation(TranslationString.HumanWalkSnipeAddedPokestop, ev.NearestDistance, ev.Pokestops.Count), LogLevel.Sniper, ConsoleColor.Yellow);
break;
case HumanWalkSnipeEventTypes.NotEnoughtPalls:
diff --git a/PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj b/PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj
index 686c17a36..2a7507682 100644
--- a/PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj
+++ b/PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj
@@ -111,10 +111,6 @@
$(SolutionDir)\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll
True
-
- ..\packages\POGOProtos.1.7.0\lib\net45\POGOProtos.dll
- True
-
$(SolutionDir)\packages\S2Geometry.1.0.3\lib\portable-net45+wp8+win8\S2Geometry.dll
True
@@ -402,6 +398,10 @@
{0739E40D-C589-4AEB-93E5-EE8CD6773C60}
PoGo.NecroBot.Logic
+
+ {a03a7bb2-4f0b-467b-84b2-9a76e6aae6fb}
+ POGOProtos
+
diff --git a/PoGo.NecroBot.CLI/Program.cs b/PoGo.NecroBot.CLI/Program.cs
index 59b2938d2..7282df1f5 100644
--- a/PoGo.NecroBot.CLI/Program.cs
+++ b/PoGo.NecroBot.CLI/Program.cs
@@ -258,7 +258,7 @@ private static void Main(string[] args)
ProgressBar.fill(100);
- machine.AsyncStart(new VersionCheckState(), session);
+ machine.AsyncStart(new VersionCheckState(), session, subPath);
try
{ Console.Clear(); }
diff --git a/PoGo.NecroBot.CLI/packages.config b/PoGo.NecroBot.CLI/packages.config
index 3e08d3777..d38625864 100644
--- a/PoGo.NecroBot.CLI/packages.config
+++ b/PoGo.NecroBot.CLI/packages.config
@@ -9,7 +9,6 @@
-
diff --git a/PoGo.NecroBot.Logic/Common/Translations.cs b/PoGo.NecroBot.Logic/Common/Translations.cs
index aff647257..ffab9a97f 100644
--- a/PoGo.NecroBot.Logic/Common/Translations.cs
+++ b/PoGo.NecroBot.Logic/Common/Translations.cs
@@ -243,7 +243,7 @@ public class Translation : ITranslation
new KeyValuePair(TranslationString.FarmPokestopsNoUsableFound,
"No usable PokeStops found in your area. Is your maximum distance too small?"),
new KeyValuePair(TranslationString.EventFortUsed,
- "Name: {0} XP: {1}, Gems: {2}, Items: {3}, Lat: {4}, Long: {5}"),
+ "Name: {0} XP: {1}, Gems: {2}, Items: {3}, Lat: {4}, Long: {5}, Alt: {6}"),
new KeyValuePair(TranslationString.EventFortFailed,
"Name: {0} INFO: Looting failed, possible softban. Unban in: {1}/{2}"),
new KeyValuePair(TranslationString.EventFortTargeted,
diff --git a/PoGo.NecroBot.Logic/Event/FortUsedEvent.cs b/PoGo.NecroBot.Logic/Event/FortUsedEvent.cs
index 488dfa561..120518293 100644
--- a/PoGo.NecroBot.Logic/Event/FortUsedEvent.cs
+++ b/PoGo.NecroBot.Logic/Event/FortUsedEvent.cs
@@ -9,6 +9,7 @@ public class FortUsedEvent : IEvent
public string Items;
public double Latitude;
public double Longitude;
+ public double Altitude;
public string Name;
}
}
\ No newline at end of file
diff --git a/PoGo.NecroBot.Logic/Event/HumanWalkSnipeEvent.cs b/PoGo.NecroBot.Logic/Event/HumanWalkSnipeEvent.cs
index 80b1035ea..d55545c44 100644
--- a/PoGo.NecroBot.Logic/Event/HumanWalkSnipeEvent.cs
+++ b/PoGo.NecroBot.Logic/Event/HumanWalkSnipeEvent.cs
@@ -41,7 +41,7 @@ public class HumanWalkSnipeEvent : IEvent
public HumanWalkSnipeFilter Setting { get; internal set; }
public bool SpinPokeStop { get; set; }
public bool CatchPokemon { get; set; }
- public double NearestDistane { get; internal set; }
+ public double NearestDistance { get; internal set; }
public List Pokestops { get; internal set; }
public int CurrentBalls { get; internal set; }
public int MinBallsToSnipe { get; internal set; }
diff --git a/PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs b/PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs
index 306518f77..51e83448a 100644
--- a/PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs
+++ b/PoGo.NecroBot.Logic/Interfaces/Configuration/ILogicSettings.cs
@@ -134,6 +134,7 @@ public interface ILogicSettings
bool UseSnipeLimit { get; }
bool UsePokeStopLimit { get; }
bool UseCatchLimit { get; }
+ bool UseNearActionRandom { get; }
ICollection> ItemRecycleFilter { get; }
ICollection PokemonsToEvolve { get; }
diff --git a/PoGo.NecroBot.Logic/Inventory.cs b/PoGo.NecroBot.Logic/Inventory.cs
index dc88490c3..839d7667f 100644
--- a/PoGo.NecroBot.Logic/Inventory.cs
+++ b/PoGo.NecroBot.Logic/Inventory.cs
@@ -18,6 +18,7 @@
using POGOProtos.Inventory.Item;
using POGOProtos.Networking.Responses;
using POGOProtos.Settings.Master;
+using Caching;
#endregion
@@ -43,6 +44,8 @@ public Inventory(Client client, ILogicSettings logicSettings)
_logicSettings = logicSettings;
}
+ private Caching.LRUCache pokeballCache = new Caching.LRUCache(capacity: 10);
+
private readonly List _pokeballs = new List
{
ItemId.ItemPokeBall,
@@ -59,6 +62,19 @@ public Inventory(Client client, ILogicSettings logicSettings)
ItemId.ItemMaxPotion
};
+ public async Task GetCachedPokeballCount(ItemId pokeballId)
+ {
+ int pokeballCount;
+ if (!pokeballCache.TryGetValue(pokeballId, out pokeballCount))
+ {
+ await RefreshCachedInventory();
+ pokeballCount = await GetItemAmountByType(pokeballId);
+ pokeballCache.Add(pokeballId, pokeballCount);
+ }
+
+ return pokeballCount;
+ }
+
public async Task DeletePokemonFromInvById(ulong id)
{
var inventory = await GetCachedInventory();
diff --git a/PoGo.NecroBot.Logic/Model/Settings/ClientSettings.cs b/PoGo.NecroBot.Logic/Model/Settings/ClientSettings.cs
index 27c7c39b2..d8e1b85c8 100644
--- a/PoGo.NecroBot.Logic/Model/Settings/ClientSettings.cs
+++ b/PoGo.NecroBot.Logic/Model/Settings/ClientSettings.cs
@@ -202,9 +202,9 @@ double ISettings.DefaultAltitude
get
{
return
- LocationUtils.getElevation(_settings.LocationConfig.DefaultLatitude, _settings.LocationConfig.DefaultLongitude) +
+ LocationUtils.getElevation(null, _settings.LocationConfig.DefaultLatitude, _settings.LocationConfig.DefaultLongitude) +
_rand.NextDouble() *
- ((double)5 / Math.Cos(LocationUtils.getElevation(_settings.LocationConfig.DefaultLatitude, _settings.LocationConfig.DefaultLongitude)));
+ ((double)5 / Math.Cos(LocationUtils.getElevation(null, _settings.LocationConfig.DefaultLatitude, _settings.LocationConfig.DefaultLongitude)));
}
diff --git a/PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs b/PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs
index 86368295c..7ae1ed7f6 100644
--- a/PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs
+++ b/PoGo.NecroBot.Logic/Model/Settings/LogicSettings.cs
@@ -90,6 +90,7 @@ public LogicSettings(GlobalSettings settings)
public int ForceExcellentThrowOverCp => _settings.CustomCatchConfig.ForceExcellentThrowOverCp;
public int DelayBetweenPokemonCatch => _settings.PokemonConfig.DelayBetweenPokemonCatch;
public int DelayBetweenPlayerActions => _settings.PlayerConfig.DelayBetweenPlayerActions;
+ public bool UseNearActionRandom => _settings.PlayerConfig.UseNearActionRandom;
public bool UsePokemonToNotCatchFilter => _settings.PokemonConfig.UsePokemonToNotCatchFilter;
public bool UsePokemonSniperFilterOnly => _settings.PokemonConfig.UsePokemonSniperFilterOnly;
public int KeepMinDuplicatePokemon => _settings.PokemonConfig.KeepMinDuplicatePokemon;
diff --git a/PoGo.NecroBot.Logic/Model/Settings/PlayerConfig.cs b/PoGo.NecroBot.Logic/Model/Settings/PlayerConfig.cs
index ec615d826..433f6091b 100644
--- a/PoGo.NecroBot.Logic/Model/Settings/PlayerConfig.cs
+++ b/PoGo.NecroBot.Logic/Model/Settings/PlayerConfig.cs
@@ -3,5 +3,6 @@ namespace PoGo.NecroBot.Logic.Model.Settings
public class PlayerConfig
{
public int DelayBetweenPlayerActions = 5000;
+ public bool UseNearActionRandom = true;
}
}
\ No newline at end of file
diff --git a/PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj b/PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj
index 06be44893..fd686ee2a 100644
--- a/PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj
+++ b/PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj
@@ -69,12 +69,12 @@
$(SolutionDir)\packages\Google.Protobuf.3.0.0-beta4\lib\net45\Google.Protobuf.dll
True
-
- $(SolutionDir)\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll
+
+ ..\packages\LRUCache.0.1.0\lib\Net20\LRUCache.dll
True
-
- ..\packages\POGOProtos.1.7.0\lib\net45\POGOProtos.dll
+
+ $(SolutionDir)\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll
True
@@ -209,7 +209,11 @@
+
+
+
+
@@ -225,6 +229,7 @@
+
@@ -292,6 +297,10 @@
{05d2da44-1b8e-4cf7-94ed-4d52451cd095}
PokemonGo.RocketAPI
+
+ {a03a7bb2-4f0b-467b-84b2-9a76e6aae6fb}
+ POGOProtos
+
diff --git a/PoGo.NecroBot.Logic/Service/Elevation/BaseElevationService.cs b/PoGo.NecroBot.Logic/Service/Elevation/BaseElevationService.cs
new file mode 100644
index 000000000..027ab607b
--- /dev/null
+++ b/PoGo.NecroBot.Logic/Service/Elevation/BaseElevationService.cs
@@ -0,0 +1,74 @@
+using Caching;
+using GeoCoordinatePortable;
+using PoGo.NecroBot.Logic.State;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PoGo.NecroBot.Logic.Service.Elevation
+{
+ public abstract class BaseElevationService
+ {
+ protected ISession _session;
+ protected LRUCache _cache;
+ protected string _apiKey;
+
+ public abstract double GetElevationFromWebService(double lat, double lng);
+
+ public BaseElevationService(ISession session, LRUCache cache)
+ {
+ _session = session;
+ _cache = cache;
+ }
+
+ public string GetCacheKey(double lat, double lng)
+ {
+ return Math.Round(lat, 3) + "," + Math.Round(lng, 3);
+ }
+
+ public string GetCacheKey(GeoCoordinate position)
+ {
+ return GetCacheKey(position.Latitude, position.Longitude);
+ }
+
+ public double GetElevation(double lat, double lng)
+ {
+ string cacheKey = GetCacheKey(lat, lng);
+ double elevation;
+ bool success = _cache.TryGetValue(cacheKey, out elevation);
+ if (!success)
+ {
+ elevation = GetElevationFromWebService(lat, lng);
+ if (elevation == 0)
+ {
+ // Error getting elevation so just return 0.
+ return 0;
+ }
+ else
+ {
+ _cache.Add(cacheKey, elevation);
+ }
+ }
+
+ // Always return a slightly random elevation.
+ return GetRandomElevation(elevation);
+ }
+
+ public void UpdateElevation(ref GeoCoordinate position)
+ {
+ double elevation = GetElevation(position.Latitude, position.Longitude);
+ // Only update the position elevation if we got a non-zero elevation.
+ if (elevation != 0)
+ {
+ position.Altitude = elevation;
+ }
+ }
+
+ public double GetRandomElevation(double elevation)
+ {
+ return elevation + (new Random().NextDouble() * 5);
+ }
+ }
+}
diff --git a/PoGo.NecroBot.Logic/Service/Elevation/ElevationService.cs b/PoGo.NecroBot.Logic/Service/Elevation/ElevationService.cs
new file mode 100644
index 000000000..56f0ecc62
--- /dev/null
+++ b/PoGo.NecroBot.Logic/Service/Elevation/ElevationService.cs
@@ -0,0 +1,40 @@
+using Caching;
+using PoGo.NecroBot.Logic.State;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PoGo.NecroBot.Logic.Service.Elevation
+{
+ public class ElevationService
+ {
+ private MapQuestElevationService mapQuestService;
+ private GoogleElevationService googleService;
+ private ISession _session;
+ LRUCache cache = new LRUCache(capacity: 500);
+
+ public ElevationService(ISession session)
+ {
+ _session = session;
+ mapQuestService = new MapQuestElevationService(session, cache);
+ googleService = new GoogleElevationService(session, cache);
+ }
+
+ public double GetElevation(double lat, double lng)
+ {
+ // First try Google service
+ double elevation = googleService.GetElevation(lat, lng);
+ if (elevation == 0)
+ {
+ // Fallback to MapQuest service
+ elevation = mapQuestService.GetElevation(lat, lng);
+ }
+
+ return elevation;
+ }
+ }
+
+
+}
diff --git a/PoGo.NecroBot.Logic/Service/Elevation/GoogleElevationService.cs b/PoGo.NecroBot.Logic/Service/Elevation/GoogleElevationService.cs
new file mode 100644
index 000000000..35f05fd90
--- /dev/null
+++ b/PoGo.NecroBot.Logic/Service/Elevation/GoogleElevationService.cs
@@ -0,0 +1,75 @@
+using Caching;
+using GeoCoordinatePortable;
+using Newtonsoft.Json;
+using PoGo.NecroBot.Logic.State;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net;
+
+namespace PoGo.NecroBot.Logic.Service.Elevation
+{
+ public class GoogleResponse
+ {
+ public List results { get; set; }
+ }
+
+ public class GoogleElevationResults
+ {
+ public double elevation { get; set; }
+ public double resolution { get; set; }
+ public GoogleLocation location { get; set; }
+ }
+
+ public class GoogleLocation
+ {
+ public double lat { get; set; }
+ public double lng { get; set; }
+ }
+
+ public class GoogleElevationService : BaseElevationService
+ {
+ public GoogleElevationService(ISession session, LRUCache cache) : base(session, cache)
+ {
+ if (!string.IsNullOrEmpty(session.LogicSettings.GoogleApiKey))
+ _apiKey = session.LogicSettings.GoogleApiKey;
+ }
+
+ public override double GetElevationFromWebService(double lat, double lng)
+ {
+ if (string.IsNullOrEmpty(_apiKey))
+ return 0;
+
+ try
+ {
+ string url = $"https://maps.googleapis.com/maps/api/elevation/json?key={_apiKey}&locations={lat},{lng}";
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+ request.Credentials = CredentialCache.DefaultCredentials;
+ request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2";
+ request.ContentType = "application/json";
+ request.ReadWriteTimeout = 2000;
+ string responseFromServer = "";
+
+ using (WebResponse response = request.GetResponse())
+ {
+ using (Stream dataStream = response.GetResponseStream())
+ using (StreamReader reader = new StreamReader(dataStream))
+ {
+ responseFromServer = reader.ReadToEnd();
+ GoogleResponse googleResponse = JsonConvert.DeserializeObject(responseFromServer);
+ if (googleResponse.results != null && 0 < googleResponse.results.Count)
+ {
+ return googleResponse.results[0].elevation;
+ }
+ }
+ }
+ }
+ catch(Exception)
+ {
+ // If we get here for any reason, then just drop down and return 0.
+ }
+
+ return 0;
+ }
+ }
+}
diff --git a/PoGo.NecroBot.Logic/Service/Elevation/MapQuestElevationService.cs b/PoGo.NecroBot.Logic/Service/Elevation/MapQuestElevationService.cs
new file mode 100644
index 000000000..b9c00e0dd
--- /dev/null
+++ b/PoGo.NecroBot.Logic/Service/Elevation/MapQuestElevationService.cs
@@ -0,0 +1,73 @@
+using Caching;
+using GeoCoordinatePortable;
+using Newtonsoft.Json;
+using PoGo.NecroBot.Logic.State;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net;
+
+namespace PoGo.NecroBot.Logic.Service.Elevation
+{
+ public class MapQuestResponse
+ {
+ public List elevationProfile { get; set; }
+ }
+
+ public class ElevationProfiles
+ {
+ public double distance { get; set; }
+ public double height { get; set; }
+ }
+
+ public class MapQuestElevationService : BaseElevationService
+ {
+ private string mapQuestDemoApiKey = $"Kmjtd|luua2qu7n9,7a=o5-lzbgq";
+
+ public MapQuestElevationService(ISession session, LRUCache cache) : base(session, cache)
+ {
+ if (!string.IsNullOrEmpty(mapQuestDemoApiKey))
+ _apiKey = mapQuestDemoApiKey;
+ }
+
+ public override double GetElevationFromWebService(double lat, double lng)
+ {
+ if (string.IsNullOrEmpty(_apiKey))
+ return 0;
+
+ try
+ {
+ string url = $"https://open.mapquestapi.com/elevation/v1/profile?key={_apiKey}&callback=handleHelloWorldResponse&shapeFormat=raw&latLngCollection={lat},{lng}";
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+ request.Credentials = CredentialCache.DefaultCredentials;
+ request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2";
+ request.ContentType = "application/json";
+ request.Referer = "https://open.mapquestapi.com/elevation/";
+ request.ReadWriteTimeout = 2000;
+ string responseFromServer = "";
+
+ using (WebResponse response = request.GetResponse())
+ {
+ using (Stream dataStream = response.GetResponseStream())
+ using (StreamReader reader = new StreamReader(dataStream))
+ {
+ responseFromServer = reader.ReadToEnd();
+ responseFromServer = responseFromServer.Replace("handleHelloWorldResponse(", "");
+ responseFromServer = responseFromServer.Replace("]}});", "]}}");
+ MapQuestResponse mapQuestResponse = JsonConvert.DeserializeObject(responseFromServer);
+ if (mapQuestResponse.elevationProfile != null && 0 < mapQuestResponse.elevationProfile.Count)
+ {
+ return mapQuestResponse.elevationProfile[0].height;
+ }
+ }
+ }
+ }
+ catch(Exception)
+ {
+ // If we get here for any reason, then just drop down and return 0.
+ }
+
+ return 0;
+ }
+ }
+}
diff --git a/PoGo.NecroBot.Logic/State/FarmState.cs b/PoGo.NecroBot.Logic/State/FarmState.cs
index 31d48de64..baf28f837 100644
--- a/PoGo.NecroBot.Logic/State/FarmState.cs
+++ b/PoGo.NecroBot.Logic/State/FarmState.cs
@@ -14,59 +14,41 @@ public class FarmState : IState
public async Task Execute(ISession session, CancellationToken cancellationToken)
{
- if (session.LogicSettings.EvolveAllPokemonAboveIv || session.LogicSettings.EvolveAllPokemonWithEnoughCandy
- || session.LogicSettings.UseLuckyEggsWhileEvolving || session.LogicSettings.KeepPokemonsThatCanEvolve)
+ if (session.LogicSettings.UseNearActionRandom)
{
- await EvolvePokemonTask.Execute(session, cancellationToken);
+ await HumanRandomActionTask.Execute(session, cancellationToken);
}
-
- if (session.LogicSettings.UseEggIncubators)
- {
- await UseIncubatorsTask.Execute(session, cancellationToken);
- }
-
- if (session.LogicSettings.TransferDuplicatePokemon)
- {
- await TransferDuplicatePokemonTask.Execute(session, cancellationToken);
- }
-
- if (session.LogicSettings.UseLuckyEggConstantly)
- {
- await UseLuckyEggConstantlyTask.Execute(session, cancellationToken);
- }
-
- if (session.LogicSettings.UseIncenseConstantly)
+ else
{
- await UseIncenseConstantlyTask.Execute(session, cancellationToken);
- }
-
- await GetPokeDexCount.Execute(session, cancellationToken);
+ if (session.LogicSettings.EvolveAllPokemonAboveIv || session.LogicSettings.EvolveAllPokemonWithEnoughCandy
+ || session.LogicSettings.UseLuckyEggsWhileEvolving || session.LogicSettings.KeepPokemonsThatCanEvolve)
+ await EvolvePokemonTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.UseEggIncubators)
+ await UseIncubatorsTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.TransferDuplicatePokemon)
+ await TransferDuplicatePokemonTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.UseLuckyEggConstantly)
+ await UseLuckyEggConstantlyTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.UseIncenseConstantly)
+ await UseIncenseConstantlyTask.Execute(session, cancellationToken);
- if (session.LogicSettings.RenamePokemon)
- {
- await RenamePokemonTask.Execute(session, cancellationToken);
- }
+ await GetPokeDexCount.Execute(session, cancellationToken);
- if (session.LogicSettings.AutoFavoritePokemon)
- {
- await FavoritePokemonTask.Execute(session, cancellationToken);
- }
+ if (session.LogicSettings.RenamePokemon)
+ await RenamePokemonTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.AutoFavoritePokemon)
+ await FavoritePokemonTask.Execute(session, cancellationToken);
- await RecycleItemsTask.Execute(session, cancellationToken);
+ await RecycleItemsTask.Execute(session, cancellationToken);
- if (session.LogicSettings.AutomaticallyLevelUpPokemon)
- {
- await LevelUpPokemonTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.AutomaticallyLevelUpPokemon)
+ await LevelUpPokemonTask.Execute(session, cancellationToken);
}
if (session.LogicSettings.UseGpxPathing)
- {
await FarmPokestopsGpxTask.Execute(session, cancellationToken);
- }
else
- {
await FarmPokestopsTask.Execute(session, cancellationToken);
- }
return this;
}
diff --git a/PoGo.NecroBot.Logic/State/Session.cs b/PoGo.NecroBot.Logic/State/Session.cs
index 0f985fcc9..acb0a37d9 100644
--- a/PoGo.NecroBot.Logic/State/Session.cs
+++ b/PoGo.NecroBot.Logic/State/Session.cs
@@ -6,6 +6,7 @@
using PoGo.NecroBot.Logic.Service;
using PokemonGo.RocketAPI;
using POGOProtos.Networking.Responses;
+using PoGo.NecroBot.Logic.Service.Elevation;
#endregion
@@ -23,6 +24,7 @@ public interface ISession
IEventDispatcher EventDispatcher { get; }
TelegramService Telegram { get; set; }
SessionStats Stats { get; }
+ ElevationService ElevationService { get; }
}
@@ -34,9 +36,16 @@ public Session(ISettings settings, ILogicSettings logicSettings) : this(settings
public Session(ISettings settings, ILogicSettings logicSettings, ITranslation translation)
{
- Settings = settings;
- LogicSettings = logicSettings;
EventDispatcher = new EventDispatcher();
+ LogicSettings = logicSettings;
+
+ ElevationService = new ElevationService(this);
+
+ // Update current altitude before assigning settings.
+ settings.DefaultAltitude = ElevationService.GetElevation(settings.DefaultLatitude, settings.DefaultLongitude);
+
+ Settings = settings;
+
Translation = translation;
Reset(settings, LogicSettings);
Stats = new SessionStats();
@@ -61,6 +70,8 @@ public Session(ISettings settings, ILogicSettings logicSettings, ITranslation tr
public SessionStats Stats { get; set; }
+ public ElevationService ElevationService { get; }
+
public void Reset(ISettings settings, ILogicSettings logicSettings)
{
ApiFailureStrategy _apiStrategy = new ApiFailureStrategy(this);
diff --git a/PoGo.NecroBot.Logic/State/StateMachine.cs b/PoGo.NecroBot.Logic/State/StateMachine.cs
index 307fbccd4..1682a5a0b 100644
--- a/PoGo.NecroBot.Logic/State/StateMachine.cs
+++ b/PoGo.NecroBot.Logic/State/StateMachine.cs
@@ -17,10 +17,10 @@ public class StateMachine
{
private IState _initialState;
- public Task AsyncStart(IState initialState, Session session,
+ public Task AsyncStart(IState initialState, Session session, string subPath,
CancellationToken cancellationToken = default(CancellationToken))
{
- return Task.Run(() => Start(initialState, session, cancellationToken), cancellationToken);
+ return Task.Run(() => Start(initialState, session, subPath, cancellationToken), cancellationToken);
}
public void SetFailureState(IState state)
@@ -28,11 +28,11 @@ public void SetFailureState(IState state)
_initialState = state;
}
- public async Task Start(IState initialState, Session session,
+ public async Task Start(IState initialState, Session session, string subPath,
CancellationToken cancellationToken = default(CancellationToken))
{
var state = initialState;
- var profilePath = Path.Combine(Directory.GetCurrentDirectory(), "");
+ var profilePath = Path.Combine(Directory.GetCurrentDirectory(), subPath);
var profileConfigPath = Path.Combine(profilePath, "config");
FileSystemWatcher configWatcher = new FileSystemWatcher();
@@ -44,7 +44,7 @@ public async Task Start(IState initialState, Session session,
{
if (e.ChangeType == WatcherChangeTypes.Changed)
{
- session.LogicSettings = new LogicSettings(GlobalSettings.Load(""));
+ session.LogicSettings = new LogicSettings(GlobalSettings.Load(subPath));
configWatcher.EnableRaisingEvents = !configWatcher.EnableRaisingEvents;
configWatcher.EnableRaisingEvents = !configWatcher.EnableRaisingEvents;
Logger.Write(" ##### config.json ##### ", LogLevel.Info);
diff --git a/PoGo.NecroBot.Logic/Strategies/Walk/BaseWalkStrategy.cs b/PoGo.NecroBot.Logic/Strategies/Walk/BaseWalkStrategy.cs
index d773c4335..b6fef84a7 100644
--- a/PoGo.NecroBot.Logic/Strategies/Walk/BaseWalkStrategy.cs
+++ b/PoGo.NecroBot.Logic/Strategies/Walk/BaseWalkStrategy.cs
@@ -113,10 +113,10 @@ public async Task DoWalk(List points, ISess
var previousLocation = currentLocation; //store the current location for comparison and correction purposes
var requestSendDateTime = DateTime.Now;
- result = await _client.Player.UpdatePlayerLocation(waypoint.Latitude, waypoint.Longitude, waypoint.Altitude);
+ result = await LocationUtils.UpdatePlayerLocationWithAltitude(session, waypoint);
var realDistanceToTarget = LocationUtils.CalculateDistanceInMeters(currentLocation, targetLocation);
- if (realDistanceToTarget < 10)
+ if (realDistanceToTarget < 30)
break;
do
@@ -163,7 +163,7 @@ public async Task DoWalk(List points, ISess
previousLocation = currentLocation; //store the current location for comparison and correction purposes
requestSendDateTime = DateTime.Now;
- result = await _client.Player.UpdatePlayerLocation(waypoint.Latitude, waypoint.Longitude, waypoint.Altitude);
+ result = await LocationUtils.UpdatePlayerLocationWithAltitude(session, waypoint);
UpdatePositionEvent?.Invoke(waypoint.Latitude, waypoint.Longitude);
diff --git a/PoGo.NecroBot.Logic/Strategies/Walk/FlyStrategy.cs b/PoGo.NecroBot.Logic/Strategies/Walk/FlyStrategy.cs
index b3fcefaa2..77e6a14d6 100644
--- a/PoGo.NecroBot.Logic/Strategies/Walk/FlyStrategy.cs
+++ b/PoGo.NecroBot.Logic/Strategies/Walk/FlyStrategy.cs
@@ -35,10 +35,7 @@ public async Task Walk(GeoCoordinate targetLocation, Func<
var waypoint = LocationUtils.CreateWaypoint(curLocation, nextWaypointDistance, nextWaypointBearing);
var sentTime = DateTime.Now;
- var result =
- await
- _client.Player.UpdatePlayerLocation(waypoint.Latitude, waypoint.Longitude,
- waypoint.Altitude);
+ var result = await LocationUtils.UpdatePlayerLocationWithAltitude(session, waypoint);
UpdatePositionEvent?.Invoke(waypoint.Latitude, waypoint.Longitude);
do
@@ -61,11 +58,7 @@ public async Task Walk(GeoCoordinate targetLocation, Func<
nextWaypointBearing = LocationUtils.DegreeBearing(curLocation, targetLocation);
waypoint = LocationUtils.CreateWaypoint(curLocation, nextWaypointDistance, nextWaypointBearing);
sentTime = DateTime.Now;
- result =
- await
- _client.Player.UpdatePlayerLocation(waypoint.Latitude, waypoint.Longitude,
- waypoint.Altitude);
-
+ result = await LocationUtils.UpdatePlayerLocationWithAltitude(session, waypoint);
UpdatePositionEvent?.Invoke(waypoint.Latitude, waypoint.Longitude);
@@ -76,10 +69,7 @@ public async Task Walk(GeoCoordinate targetLocation, Func<
}
else
{
- var result =
- await
- _client.Player.UpdatePlayerLocation(targetLocation.Latitude, targetLocation.Longitude,
- LocationUtils.getElevation(targetLocation.Latitude, targetLocation.Longitude));
+ var result = await LocationUtils.UpdatePlayerLocationWithAltitude(session, targetLocation);
UpdatePositionEvent?.Invoke(targetLocation.Latitude, targetLocation.Longitude);
if (functionExecutedWhileWalking != null)
await functionExecutedWhileWalking(); // look for pokemon
diff --git a/PoGo.NecroBot.Logic/Strategies/Walk/HumanPathWalkingStrategy.cs b/PoGo.NecroBot.Logic/Strategies/Walk/HumanPathWalkingStrategy.cs
index cede9e3c9..df7a76dc3 100644
--- a/PoGo.NecroBot.Logic/Strategies/Walk/HumanPathWalkingStrategy.cs
+++ b/PoGo.NecroBot.Logic/Strategies/Walk/HumanPathWalkingStrategy.cs
@@ -41,7 +41,7 @@ public async Task Walk(GeoCoordinate targetLocation, Func<
var requestSendDateTime = DateTime.Now;
var requestVariantDateTime = DateTime.Now;
- var result = await _client.Player.UpdatePlayerLocation(waypoint.Latitude, waypoint.Longitude, waypoint.Altitude);
+ var result = await LocationUtils.UpdatePlayerLocationWithAltitude(session, waypoint);
double SpeedVariantSec = rw.Next(1000, 10000);
UpdatePositionEvent?.Invoke(waypoint.Latitude, waypoint.Longitude);
@@ -78,7 +78,7 @@ public async Task Walk(GeoCoordinate targetLocation, Func<
waypoint = LocationUtils.CreateWaypoint(sourceLocation, nextWaypointDistance, nextWaypointBearing);
requestSendDateTime = DateTime.Now;
- result = await _client.Player.UpdatePlayerLocation(waypoint.Latitude, waypoint.Longitude, waypoint.Altitude);
+ result = await LocationUtils.UpdatePlayerLocationWithAltitude(session, waypoint);
UpdatePositionEvent?.Invoke(waypoint.Latitude, waypoint.Longitude);
diff --git a/PoGo.NecroBot.Logic/Strategies/Walk/HumanStrategy.cs b/PoGo.NecroBot.Logic/Strategies/Walk/HumanStrategy.cs
index d6c1a9ba9..ba3736e7b 100644
--- a/PoGo.NecroBot.Logic/Strategies/Walk/HumanStrategy.cs
+++ b/PoGo.NecroBot.Logic/Strategies/Walk/HumanStrategy.cs
@@ -44,7 +44,7 @@ public async Task Walk(GeoCoordinate targetLocation, Func<
var requestSendDateTime = DateTime.Now;
var requestVariantDateTime = DateTime.Now;
- var result = await _client.Player.UpdatePlayerLocation(waypoint.Latitude, waypoint.Longitude, waypoint.Altitude);
+ var result = await LocationUtils.UpdatePlayerLocationWithAltitude(session, waypoint);
double SpeedVariantSec = rw.Next(1000, 10000);
UpdatePositionEvent?.Invoke(waypoint.Latitude, waypoint.Longitude);
@@ -80,7 +80,7 @@ public async Task Walk(GeoCoordinate targetLocation, Func<
waypoint = LocationUtils.CreateWaypoint(sourceLocation, nextWaypointDistance, nextWaypointBearing);
requestSendDateTime = DateTime.Now;
- result = await _client.Player.UpdatePlayerLocation(waypoint.Latitude, waypoint.Longitude, waypoint.Altitude);
+ result = await LocationUtils.UpdatePlayerLocationWithAltitude(session, waypoint);
UpdatePositionEvent?.Invoke(waypoint.Latitude, waypoint.Longitude);
diff --git a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs
index 29d4f8fcc..974e185fe 100644
--- a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs
+++ b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs
@@ -22,7 +22,6 @@ namespace PoGo.NecroBot.Logic.Tasks
public static class CatchPokemonTask
{
public static int AmountOfBerries;
-
private static Random Random => new Random((int)DateTime.Now.Ticks);
private static bool CatchThresholdExceeds(ISession session)
@@ -300,8 +299,15 @@ encounter is EncounterResponse || encounter is IncenseEncounterResponse
session.EventDispatcher.Send(evt);
attemptCounter++;
+
if (session.LogicSettings.TransferDuplicatePokemonOnCapture && session.LogicSettings.TransferDuplicatePokemon)
- await TransferDuplicatePokemonTask.Execute(session, cancellationToken);
+ {
+ if (session.LogicSettings.UseNearActionRandom)
+ await HumanRandomActionTask.TransferRandom(session, cancellationToken);
+ else
+ await TransferDuplicatePokemonTask.Execute(session, cancellationToken);
+ }
+
DelayingUtils.Delay(session.LogicSettings.DelayBetweenPokemonCatch, 0);
} while (caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchMissed ||
caughtPokemonResponse.Status == CatchPokemonResponse.Types.CatchStatus.CatchEscape);
diff --git a/PoGo.NecroBot.Logic/Tasks/Farm.cs b/PoGo.NecroBot.Logic/Tasks/Farm.cs
index 04ee9e74b..826379d42 100644
--- a/PoGo.NecroBot.Logic/Tasks/Farm.cs
+++ b/PoGo.NecroBot.Logic/Tasks/Farm.cs
@@ -24,61 +24,41 @@ public Farm(ISession session)
public void Run(CancellationToken cancellationToken)
{
- if (_session.LogicSettings.EvolveAllPokemonAboveIv || _session.LogicSettings.EvolveAllPokemonWithEnoughCandy
- || _session.LogicSettings.UseLuckyEggsWhileEvolving || _session.LogicSettings.KeepPokemonsThatCanEvolve)
+ if (_session.LogicSettings.UseNearActionRandom)
{
- EvolvePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
+ HumanRandomActionTask.Execute(_session, cancellationToken).Wait(cancellationToken);
}
- if (_session.LogicSettings.AutomaticallyLevelUpPokemon)
- {
- LevelUpPokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
- }
- if (_session.LogicSettings.UseLuckyEggConstantly)
- {
- UseLuckyEggConstantlyTask.Execute(_session, cancellationToken).Wait(cancellationToken);
- }
- if (_session.LogicSettings.UseIncenseConstantly)
- {
- UseIncenseConstantlyTask.Execute(_session, cancellationToken).Wait(cancellationToken);
- }
-
- if (_session.LogicSettings.TransferDuplicatePokemon)
- {
- TransferDuplicatePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
- }
-
- if (_session.LogicSettings.TransferWeakPokemon)
- {
- TransferWeakPokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
- }
-
- if (_session.LogicSettings.RenamePokemon)
- {
- RenamePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
- }
-
- if (_session.LogicSettings.AutoFavoritePokemon)
+ else
{
- FavoritePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
- }
+ if (_session.LogicSettings.EvolveAllPokemonAboveIv || _session.LogicSettings.EvolveAllPokemonWithEnoughCandy
+ || _session.LogicSettings.UseLuckyEggsWhileEvolving || _session.LogicSettings.KeepPokemonsThatCanEvolve)
+ EvolvePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
+ if (_session.LogicSettings.AutomaticallyLevelUpPokemon)
+ LevelUpPokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
+ if (_session.LogicSettings.UseLuckyEggConstantly)
+ UseLuckyEggConstantlyTask.Execute(_session, cancellationToken).Wait(cancellationToken);
+ if (_session.LogicSettings.UseIncenseConstantly)
+ UseIncenseConstantlyTask.Execute(_session, cancellationToken).Wait(cancellationToken);
+ if (_session.LogicSettings.TransferDuplicatePokemon)
+ TransferDuplicatePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
+ if (_session.LogicSettings.TransferWeakPokemon)
+ TransferWeakPokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
+ if (_session.LogicSettings.RenamePokemon)
+ RenamePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
+ if (_session.LogicSettings.AutoFavoritePokemon)
+ FavoritePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken);
- RecycleItemsTask.Execute(_session, cancellationToken).Wait(cancellationToken);
+ RecycleItemsTask.Execute(_session, cancellationToken).Wait(cancellationToken);
+ GetPokeDexCount.Execute(_session, cancellationToken).Wait(cancellationToken);
- if (_session.LogicSettings.UseEggIncubators)
- {
- UseIncubatorsTask.Execute(_session, cancellationToken).Wait(cancellationToken);
+ if (_session.LogicSettings.UseEggIncubators)
+ UseIncubatorsTask.Execute(_session, cancellationToken).Wait(cancellationToken);
}
if (_session.LogicSettings.UseGpxPathing)
- {
FarmPokestopsGpxTask.Execute(_session, cancellationToken).Wait(cancellationToken);
- }
else
- {
FarmPokestopsTask.Execute(_session, cancellationToken).Wait(cancellationToken);
- }
-
- GetPokeDexCount.Execute(_session, cancellationToken).Wait(cancellationToken);
}
}
}
\ No newline at end of file
diff --git a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs
index 4f832ba34..8864ad924 100644
--- a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs
+++ b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs
@@ -44,7 +44,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
await session.Navigation.Move(new GeoCoordinate(
session.Settings.DefaultLatitude,
session.Settings.DefaultLongitude,
- LocationUtils.getElevation(session.Settings.DefaultLatitude,
+ LocationUtils.getElevation(session, session.Settings.DefaultLatitude,
session.Settings.DefaultLongitude)),
null,
session,
diff --git a/PoGo.NecroBot.Logic/Tasks/HumanRandomActionTask.cs b/PoGo.NecroBot.Logic/Tasks/HumanRandomActionTask.cs
new file mode 100644
index 000000000..e239bfdbf
--- /dev/null
+++ b/PoGo.NecroBot.Logic/Tasks/HumanRandomActionTask.cs
@@ -0,0 +1,81 @@
+using PoGo.NecroBot.Logic.State;
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace PoGo.NecroBot.Logic.Tasks
+{
+ public class HumanRandomActionTask
+ {
+ private static Random ActionRandom = new Random();
+
+ public static async Task Execute(ISession session, CancellationToken cancellationToken)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ var randomCommand = Enumerable.Range(1, 9).OrderBy(x => ActionRandom.Next()).Take(9).ToList();
+ for (int i = 0; i < 9; i++)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ switch (randomCommand[i])
+ {
+ case 1:
+ if (session.LogicSettings.EvolveAllPokemonAboveIv || session.LogicSettings.EvolveAllPokemonWithEnoughCandy
+ || session.LogicSettings.UseLuckyEggsWhileEvolving || session.LogicSettings.KeepPokemonsThatCanEvolve)
+ if (ActionRandom.Next(1, 10) > 4)
+ await EvolvePokemonTask.Execute(session, cancellationToken);
+ break;
+ case 2:
+ if (session.LogicSettings.UseEggIncubators)
+ if (ActionRandom.Next(1, 10) > 4)
+ await UseIncubatorsTask.Execute(session, cancellationToken);
+ break;
+ case 3:
+ if (session.LogicSettings.TransferDuplicatePokemon)
+ if (ActionRandom.Next(1, 10) > 4)
+ await TransferDuplicatePokemonTask.Execute(session, cancellationToken);
+ break;
+ case 4:
+ if (session.LogicSettings.UseLuckyEggConstantly)
+ if (ActionRandom.Next(1, 10) > 4)
+ await UseLuckyEggConstantlyTask.Execute(session, cancellationToken);
+ break;
+ case 5:
+ if (session.LogicSettings.UseIncenseConstantly)
+ if (ActionRandom.Next(1, 10) > 4)
+ await UseIncenseConstantlyTask.Execute(session, cancellationToken);
+ break;
+ case 6:
+ if (session.LogicSettings.RenamePokemon)
+ if (ActionRandom.Next(1, 10) > 4)
+ await RenamePokemonTask.Execute(session, cancellationToken);
+ break;
+ case 7:
+ if (session.LogicSettings.AutoFavoritePokemon)
+ if (ActionRandom.Next(1, 10) > 4)
+ await FavoritePokemonTask.Execute(session, cancellationToken);
+ break;
+ case 8:
+ if (ActionRandom.Next(1, 10) > 4)
+ await RecycleItemsTask.Execute(session, cancellationToken);
+ break;
+ case 9:
+ if (session.LogicSettings.AutomaticallyLevelUpPokemon)
+ if (ActionRandom.Next(1, 10) > 4)
+ await LevelUpPokemonTask.Execute(session, cancellationToken);
+ break;
+ }
+ }
+
+ await GetPokeDexCount.Execute(session, cancellationToken);
+ }
+
+ public static async Task TransferRandom(ISession session, CancellationToken cancellationToken)
+ {
+ if (ActionRandom.Next(1, 10) > 4)
+ await TransferDuplicatePokemonTask.Execute(session, cancellationToken);
+ }
+ }
+}
diff --git a/PoGo.NecroBot.Logic/Tasks/HumanWalkSnipeTask.cs b/PoGo.NecroBot.Logic/Tasks/HumanWalkSnipeTask.cs
index 7e87424d0..ddbbb63d5 100644
--- a/PoGo.NecroBot.Logic/Tasks/HumanWalkSnipeTask.cs
+++ b/PoGo.NecroBot.Logic/Tasks/HumanWalkSnipeTask.cs
@@ -175,7 +175,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
});
await session.Navigation.Move(new GeoCoordinate(pokemon.latitude, pokemon.longitude,
- LocationUtils.getElevation(pokemon.latitude, pokemon.longitude)),
+ LocationUtils.getElevation(session, pokemon.latitude, pokemon.longitude)),
async () =>
{
var distance = LocationUtils.CalculateDistanceInMeters(pokemon.latitude, pokemon.longitude, session.Client.CurrentLatitude, session.Client.CurrentLongitude);
@@ -189,7 +189,7 @@ await session.Navigation.Move(new GeoCoordinate(pokemon.latitude, pokemon.longit
{
await actionWhenWalking(session.Client.CurrentLatitude, session.Client.CurrentLongitude);
}
- return await Task.FromResult(true);
+ return true;
},
session,
cancellationToken, pokemon.FilterSetting.AllowSpeedUp ? pokemon.FilterSetting.MaxSpeedUpSpeed : 0);
diff --git a/PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs
index fb30e7382..27003e548 100644
--- a/PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs
+++ b/PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs
@@ -23,6 +23,8 @@
using POGOProtos.Map.Pokemon;
using POGOProtos.Networking.Responses;
using Quobject.SocketIoClientDotNet.Client;
+using GeoCoordinatePortable;
+using PoGo.NecroBot.Logic.Utils;
#endregion
@@ -418,8 +420,8 @@ public static async Task Snipe(ISession session, IEnumerable pokemonI
List catchablePokemon;
try
{
- await session.Client.Player.UpdatePlayerLocation(latitude, longitude, session.Client.CurrentAltitude);
-
+ await LocationUtils.UpdatePlayerLocationWithAltitude(session, new GeoCoordinate(latitude, longitude, session.Client.CurrentAltitude));
+
session.EventDispatcher.Send(new UpdatePositionEvent
{
Longitude = longitude,
@@ -435,7 +437,7 @@ public static async Task Snipe(ISession session, IEnumerable pokemonI
}
finally
{
- await session.Client.Player.UpdatePlayerLocation(CurrentLatitude, CurrentLongitude, session.Client.CurrentAltitude);
+ await LocationUtils.UpdatePlayerLocationWithAltitude(session, new GeoCoordinate(CurrentLatitude, CurrentLongitude, session.Client.CurrentAltitude));
}
if (catchablePokemon.Count == 0)
@@ -451,13 +453,13 @@ public static async Task Snipe(ISession session, IEnumerable pokemonI
EncounterResponse encounter;
try
{
- await session.Client.Player.UpdatePlayerLocation(latitude, longitude, session.Client.CurrentAltitude);
+ await LocationUtils.UpdatePlayerLocationWithAltitude(session, new GeoCoordinate(latitude, longitude, session.Client.CurrentAltitude));
encounter = session.Client.Encounter.EncounterPokemon(pokemon.EncounterId, pokemon.SpawnPointId).Result;
}
finally
{
- await session.Client.Player.UpdatePlayerLocation(CurrentLatitude, CurrentLongitude, session.Client.CurrentAltitude);
+ await LocationUtils.UpdatePlayerLocationWithAltitude(session, new GeoCoordinate(CurrentLatitude, CurrentLongitude, session.Client.CurrentAltitude));
}
if (encounter.Status == EncounterResponse.Types.Status.EncounterSuccess)
@@ -768,7 +770,7 @@ private static List GetSniperInfoFrom_pokesnipers(ISession session,
private static List GetSniperInfoFrom_pokewatchers(ISession session, List pokemonIds)
{
- var uri = $"http://pokewatchers.com/api.php?act=grab";
+ var uri = $"http://pokewatchers.com/grab/";
ScanResult_pokewatchers scanResult_pokewatchers;
try
diff --git a/PoGo.NecroBot.Logic/Tasks/TransferDuplicatePokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/TransferDuplicatePokemonTask.cs
index 9686fde5a..d37690839 100644
--- a/PoGo.NecroBot.Logic/Tasks/TransferDuplicatePokemonTask.cs
+++ b/PoGo.NecroBot.Logic/Tasks/TransferDuplicatePokemonTask.cs
@@ -48,6 +48,12 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
family.Candy_++;
+ // Padding the TransferEvent with player-choosen delay before instead of after.
+ // This is to remedy too quick transfers, often happening within a second of the
+ // previous action otherwise
+
+ DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 0);
+
session.EventDispatcher.Send(new TransferPokemonEvent
{
Id = duplicatePokemon.PokemonId,
@@ -58,7 +64,6 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
FamilyCandies = family.Candy_
});
- DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 0);
}
}
}
diff --git a/PoGo.NecroBot.Logic/Tasks/UseIncubatorsTask.cs b/PoGo.NecroBot.Logic/Tasks/UseIncubatorsTask.cs
index e59a08fa0..244b5767b 100644
--- a/PoGo.NecroBot.Logic/Tasks/UseIncubatorsTask.cs
+++ b/PoGo.NecroBot.Logic/Tasks/UseIncubatorsTask.cs
@@ -9,11 +9,9 @@
using System.Threading.Tasks;
using Newtonsoft.Json;
using PoGo.NecroBot.Logic.Event;
-using PoGo.NecroBot.Logic.Logging;
using PoGo.NecroBot.Logic.PoGoUtils;
using PoGo.NecroBot.Logic.State;
using POGOProtos.Inventory.Item;
-using PoGo.NecroBot.Logic.Common;
#endregion
@@ -68,12 +66,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
var newRememberedIncubators = new List();
- // Find out if there are only 10km-eggs (special case)
- var only10kmEggs = false;
- var testIfOnly10kmEggs = unusedEggs.FirstOrDefault(x => x.EggKmWalkedTarget < 10);
- if (testIfOnly10kmEggs == null) only10kmEggs = true;
-
- foreach (var incubator in incubators)
+ foreach (var incubator in incubators)
{
cancellationToken.ThrowIfCancellationRequested();
@@ -88,23 +81,14 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
if (egg == null)
continue;
- // Avoid using 10 km egg until you are level 20 in order to get higher
- // initial CP on the high IV 10 km Pokmons (unless you ONLY have 10km-eggs)
- if (egg.EggKmWalkedTarget == 10 && playerStats.Level < 20 && !only10kmEggs)
- {
- Logger.Write(session.Translation.GetTranslation(TranslationString.Only10kmEggs), LogLevel.Egg);
- continue;
- }
-
- // Avoid using 2/5 km eggs with limited incubator - IF setting is 10!
- if (egg.EggKmWalkedTarget < session.LogicSettings.UseEggIncubatorMinKm
- && incubator.ItemId != ItemId.ItemIncubatorBasicUnlimited)
+ //avoid using 2/5 km eggs with limited incubator
+ if (egg.EggKmWalkedTarget < session.LogicSettings.UseEggIncubatorMinKm && incubator.ItemId != ItemId.ItemIncubatorBasicUnlimited)
continue;
var response = await session.Client.Inventory.UseItemEggIncubator(incubator.Id, egg.Id);
unusedEggs.Remove(egg);
- newRememberedIncubators.Add(new IncubatorUsage {IncubatorId = incubator.Id, PokemonId = egg.Id});
+ newRememberedIncubators.Add(new IncubatorUsage { IncubatorId = incubator.Id, PokemonId = egg.Id });
session.EventDispatcher.Send(new EggIncubatorStatusEvent
{
diff --git a/PoGo.NecroBot.Logic/Tasks/UseNearbyPokestopsTask.cs b/PoGo.NecroBot.Logic/Tasks/UseNearbyPokestopsTask.cs
index cdb714970..fdd612be2 100644
--- a/PoGo.NecroBot.Logic/Tasks/UseNearbyPokestopsTask.cs
+++ b/PoGo.NecroBot.Logic/Tasks/UseNearbyPokestopsTask.cs
@@ -62,7 +62,9 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
{
cancellationToken.ThrowIfCancellationRequested();
- var pokestopList = await GetPokeStops(session);
+ var pokestopsTuple = await GetPokeStops(session);
+ var allPokestops = pokestopsTuple.Item1;
+ var pokestopList = pokestopsTuple.Item2;
while (pokestopList.Any())
{
@@ -83,141 +85,172 @@ public static async Task Execute(ISession session, CancellationToken cancellatio
var pokeStop = pokestopList[pokestopListNum];
pokestopList.RemoveAt(pokestopListNum);
- await FortPokestop(session, cancellationToken, pokeStop);
+ // this logic should only be called when we reach a pokestop either via GPX path or normal walking
+ // as when walk-sniping, we want to get to the snipe ASAP rather than stop for lured pokemon upon
+ // calling FarmPokestop; in that situation we are also always within 40m of the pokestop, so no
+ // need to walk to it
+ var fortInfo = await session.Client.Fort.GetFort(pokeStop.Id, pokeStop.Latitude, pokeStop.Longitude);
- if (++stopsHit >= storeRI) //TODO: OR item/pokemon bag is full //check stopsHit against storeRI random without dividing.
+ // we only move to the PokeStop, and send the associated FortTargetEvent, when not using GPX
+ // also, GPX pathing uses its own EggWalker and calls the CatchPokemon tasks internally.
+ if (!session.LogicSettings.UseGpxPathing)
{
- storeRI = rc.Next(6, 12); //set new storeRI for new random value
- stopsHit = 0;
-
- await RecycleItemsTask.Execute(session, cancellationToken);
-
- if (session.LogicSettings.EvolveAllPokemonWithEnoughCandy ||
- session.LogicSettings.EvolveAllPokemonAboveIv ||
- session.LogicSettings.UseLuckyEggsWhileEvolving ||
- session.LogicSettings.KeepPokemonsThatCanEvolve)
- {
- await EvolvePokemonTask.Execute(session, cancellationToken);
- }
-
- if (session.LogicSettings.UseLuckyEggConstantly)
- await UseLuckyEggConstantlyTask.Execute(session, cancellationToken);
+ var eggWalker = new EggWalker(1000, session);
- if (session.LogicSettings.UseIncenseConstantly)
- await UseIncenseConstantlyTask.Execute(session, cancellationToken);
+ var distance = LocationUtils.CalculateDistanceInMeters(session.Client.CurrentLatitude,
+ session.Client.CurrentLongitude, pokeStop.Latitude, pokeStop.Longitude);
+ cancellationToken.ThrowIfCancellationRequested();
- if (session.LogicSettings.TransferDuplicatePokemon)
- await TransferDuplicatePokemonTask.Execute(session, cancellationToken);
+ if (!session.LogicSettings.UseGoogleWalk && !session.LogicSettings.UseYoursWalk)
+ session.EventDispatcher.Send(new FortTargetEvent { Name = fortInfo.Name, Distance = distance, Route = "NecroBot" });
+ else
+ BaseWalkStrategy.FortInfo = fortInfo;
- if (session.LogicSettings.TransferWeakPokemon)
- await TransferWeakPokemonTask.Execute(session, cancellationToken);
+ await session.Navigation.Move(new GeoCoordinate(pokeStop.Latitude, pokeStop.Longitude,
+ LocationUtils.getElevation(session, pokeStop.Latitude, pokeStop.Longitude)),
+ async () =>
+ {
+ // Catch normal map Pokemon
+ await CatchNearbyPokemonsTask.Execute(session, cancellationToken);
+ //Catch Incense Pokemon
+ await CatchIncensePokemonsTask.Execute(session, cancellationToken);
+ return true;
+ },
+ session,
+ cancellationToken);
+
+ // we have moved this distance, so apply it immediately to the egg walker.
+ await eggWalker.ApplyDistance(distance, cancellationToken);
+ }
- if (session.LogicSettings.RenamePokemon)
- await RenamePokemonTask.Execute(session, cancellationToken);
+ //Catch Lure Pokemon
+ if (pokeStop.LureInfo != null)
+ {
+ // added for cooldowns
+ await Task.Delay(Math.Min(session.LogicSettings.DelayBetweenPlayerActions, 3000));
+ await CatchLurePokemonsTask.Execute(session, pokeStop, cancellationToken);
+ }
- if (session.LogicSettings.AutoFavoritePokemon)
- await FavoritePokemonTask.Execute(session, cancellationToken);
+ await FarmPokestop(session, pokeStop, fortInfo, cancellationToken);
- if (session.LogicSettings.AutomaticallyLevelUpPokemon)
- await LevelUpPokemonTask.Execute(session, cancellationToken);
+ if (++stopsHit >= storeRI) //TODO: OR item/pokemon bag is full //check stopsHit against storeRI random without dividing.
+ {
+ storeRI = rc.Next(6, 12); //set new storeRI for new random value
+ stopsHit = 0;
- await GetPokeDexCount.Execute(session, cancellationToken);
+ if (session.LogicSettings.UseNearActionRandom)
+ {
+ await HumanRandomActionTask.Execute(session, cancellationToken);
+ }
+ else
+ {
+ await RecycleItemsTask.Execute(session, cancellationToken);
+
+ if (session.LogicSettings.EvolveAllPokemonWithEnoughCandy ||
+ session.LogicSettings.EvolveAllPokemonAboveIv ||
+ session.LogicSettings.UseLuckyEggsWhileEvolving ||
+ session.LogicSettings.KeepPokemonsThatCanEvolve)
+ await EvolvePokemonTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.UseLuckyEggConstantly)
+ await UseLuckyEggConstantlyTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.UseIncenseConstantly)
+ await UseIncenseConstantlyTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.TransferDuplicatePokemon)
+ await TransferDuplicatePokemonTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.TransferWeakPokemon)
+ await TransferWeakPokemonTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.RenamePokemon)
+ await RenamePokemonTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.AutoFavoritePokemon)
+ await FavoritePokemonTask.Execute(session, cancellationToken);
+ if (session.LogicSettings.AutomaticallyLevelUpPokemon)
+ await LevelUpPokemonTask.Execute(session, cancellationToken);
+
+ await GetPokeDexCount.Execute(session, cancellationToken);
+ }
}
if (session.LogicSettings.SnipeAtPokestops || session.LogicSettings.UseSnipeLocationServer)
await SnipePokemonTask.Execute(session, cancellationToken);
- //samuraitruong: temoporary not allow human walk snipe until we implement a good logic to use.
- if (session.LogicSettings.EnableHumanWalkingSnipe && !session.LogicSettings.UseGpxPathing)
+ if (session.LogicSettings.EnableHumanWalkingSnipe)
{
//refactore to move this code inside the task later.
await HumanWalkSnipeTask.Execute(session, cancellationToken,
- async (double lat, double lng) =>
- {
- //idea of this function is to spin pokestop on way. maybe risky.
- var reachablePokestops = pokestopList.Where(i =>
+ async (double lat, double lng) =>
+ {
+ //idea of this function is to spin pokestop on way. maybe risky.
+ var reachablePokestops = allPokestops.Where(i =>
+ LocationUtils.CalculateDistanceInMeters(session.Client.CurrentLatitude,
+ session.Client.CurrentLongitude, i.Latitude, i.Longitude) < 40).ToList();
+ reachablePokestops = reachablePokestops.OrderBy(i =>
LocationUtils.CalculateDistanceInMeters(session.Client.CurrentLatitude,
- session.Client.CurrentLongitude, i.Latitude, i.Longitude) < 30.0)
- .ToList();
- reachablePokestops = reachablePokestops.OrderBy(i => LocationUtils.CalculateDistanceInMeters(session.Client.CurrentLatitude,
- session.Client.CurrentLongitude, i.Latitude, i.Longitude))
- .ToList();
- foreach (var ps in reachablePokestops)
- {
- pokestopList.Remove(ps);
- await FortPokestop(session, cancellationToken, ps);
- }
- },
- async () =>
- {
- var nearestStop = pokestopList.OrderBy(i =>
- LocationUtils.CalculateDistanceInMeters(session.Client.CurrentLatitude,
- session.Client.CurrentLongitude, i.Latitude, i.Longitude)).FirstOrDefault();
-
- var walkedDistance = LocationUtils.CalculateDistanceInMeters(nearestStop.Latitude, nearestStop.Longitude, session.Client.CurrentLatitude, session.Client.CurrentLongitude);
- if (walkedDistance > session.LogicSettings.HumanWalkingSnipeWalkbackDistanceLimit)
- {
- await Task.Delay(3000);
- var nearbyPokeStops = await UpdateFortsData(session);
- var notexists = nearbyPokeStops.Where(p => !pokestopList.Any(x => x.Id == p.Id)).ToList();
- pokestopList.AddRange(notexists);
- session.EventDispatcher.Send(new PokeStopListEvent { Forts = pokestopList });
- session.EventDispatcher.Send(new HumanWalkSnipeEvent()
- {
- Type = HumanWalkSnipeEventTypes.PokestopUpdated,
- Pokestops = notexists,
- NearestDistane = walkedDistance
- });
-
- }
- });
+ session.Client.CurrentLongitude, i.Latitude, i.Longitude)).ToList();
+ foreach (var ps in reachablePokestops)
+ {
+ if (!session.LogicSettings.UseGpxPathing || pokestopList.Contains(ps))
+ {
+ pokestopList.Remove(ps);
+ }
+
+ var fi = await session.Client.Fort.GetFort(ps.Id, ps.Latitude, ps.Longitude);
+ await FarmPokestop(session, ps, fi, cancellationToken);
+ }
+ },
+ async () =>
+ {
+ // if using GPX we have to move back to the original pokestop, to resume the path.
+ // we do not try to use pokestops on the way back, as we will have used them getting
+ // here.
+ if (session.LogicSettings.UseGpxPathing)
+ {
+ var eggWalker = new EggWalker(1000, session);
+
+ var distance = LocationUtils.CalculateDistanceInMeters(session.Client.CurrentLatitude,
+ session.Client.CurrentLongitude, pokeStop.Latitude, pokeStop.Longitude);
+ var geo = new GeoCoordinate(pokeStop.Latitude, pokeStop.Longitude);
+
+ await session.Navigation.Move(geo,
+ async () =>
+ {
+ await CatchNearbyPokemonsTask.Execute(session, cancellationToken);
+ //Catch Incense Pokemon
+ await CatchIncensePokemonsTask.Execute(session, cancellationToken);
+ return true;
+ },
+ session,
+ cancellationToken);
+
+ await eggWalker.ApplyDistance(distance, cancellationToken);
+ return;
+ }
+
+ var nearestStop = pokestopList.OrderBy(i =>
+ LocationUtils.CalculateDistanceInMeters(session.Client.CurrentLatitude,
+ session.Client.CurrentLongitude, i.Latitude, i.Longitude)).FirstOrDefault();
+
+ var walkedDistance = LocationUtils.CalculateDistanceInMeters(nearestStop.Latitude, nearestStop.Longitude, session.Client.CurrentLatitude, session.Client.CurrentLongitude);
+ if (walkedDistance > session.LogicSettings.HumanWalkingSnipeWalkbackDistanceLimit)
+ {
+ await Task.Delay(3000);
+ var nearbyPokeStops = await UpdateFortsData(session);
+ var notexists = nearbyPokeStops.Where(p => !pokestopList.Any(x => x.Id == p.Id)).ToList();
+ pokestopList.AddRange(notexists);
+ session.EventDispatcher.Send(new PokeStopListEvent { Forts = pokestopList });
+ session.EventDispatcher.Send(new HumanWalkSnipeEvent()
+ {
+ Type = HumanWalkSnipeEventTypes.PokestopUpdated,
+ Pokestops = notexists,
+ NearestDistance = walkedDistance
+ });
+ }
+ });
}
-
}
}
- private static async Task FortPokestop(ISession session, CancellationToken cancellationToken, FortData pokeStop)
+ private static async Task FarmPokestop(ISession session, FortData pokeStop, FortDetailsResponse fortInfo, CancellationToken cancellationToken)
{
- var fortInfo = await session.Client.Fort.GetFort(pokeStop.Id, pokeStop.Latitude, pokeStop.Longitude);
-
- // we only move to the PokeStop, and send the associated FortTargetEvent, when not using GPX
- // also, GPX pathing uses its own EggWalker and calls the CatchPokemon tasks internally.
- if (!session.LogicSettings.UseGpxPathing)
- {
- var eggWalker = new EggWalker(1000, session);
-
- var distance = LocationUtils.CalculateDistanceInMeters(session.Client.CurrentLatitude,
- session.Client.CurrentLongitude, pokeStop.Latitude, pokeStop.Longitude);
- cancellationToken.ThrowIfCancellationRequested();
-
- if (!session.LogicSettings.UseGoogleWalk && !session.LogicSettings.UseYoursWalk)
- session.EventDispatcher.Send(new FortTargetEvent { Name = fortInfo.Name, Distance = distance, Route = "NecroBot" });
- else
- BaseWalkStrategy.FortInfo = fortInfo;
-
- await session.Navigation.Move(new GeoCoordinate(pokeStop.Latitude, pokeStop.Longitude,
- LocationUtils.getElevation(pokeStop.Latitude, pokeStop.Longitude)),
- async () =>
- {
- // Catch normal map Pokemon
- await CatchNearbyPokemonsTask.Execute(session, cancellationToken);
- //Catch Incense Pokemon
- await CatchIncensePokemonsTask.Execute(session, cancellationToken);
- return true;
- },
- session,
- cancellationToken);
-
- // we have moved this distance, so apply it immediately to the egg walker.
- await eggWalker.ApplyDistance(distance, cancellationToken);
- }
-
- //Catch Lure Pokemon
- if (pokeStop.LureInfo != null)
- {
- await CatchLurePokemonsTask.Execute(session, pokeStop, cancellationToken);
- }
-
FortSearchResponse fortSearch;
var timesZeroXPawarded = 0;
var fortTry = 0; //Current check
@@ -284,6 +317,7 @@ await session.Navigation.Move(new GeoCoordinate(pokeStop.Latitude, pokeStop.Long
Items = StringUtils.GetSummedFriendlyNameOfItemAwardList(fortSearch.ItemsAwarded),
Latitude = pokeStop.Latitude,
Longitude = pokeStop.Longitude,
+ Altitude = session.Client.CurrentAltitude,
InventoryFull = fortSearch.Result == FortSearchResponse.Types.Result.InventoryFull
});
@@ -313,7 +347,7 @@ await session.Navigation.Move(new GeoCoordinate(pokeStop.Latitude, pokeStop.Long
//to only find stops within 40 meters for GPX pathing, as we are not going to the pokestops,
//so do not make it more than 40 because it will never get close to those stops.
//For non GPX pathing, it returns all pokestops in range.
- private static async Task> GetPokeStops(ISession session)
+ private static async Task, List>> GetPokeStops(ISession session)
{
List pokeStops = await UpdateFortsData(session);
if (!session.LogicSettings.UseGpxPathing)
@@ -328,7 +362,7 @@ private static async Task> GetPokeStops(ISession session)
}
session.EventDispatcher.Send(new PokeStopListEvent { Forts = pokeStops });
- return pokeStops;
+ return Tuple.Create(pokeStops, pokeStops);
}
if (pokeStops.Count > 0)
@@ -337,16 +371,16 @@ private static async Task> GetPokeStops(ISession session)
session.EventDispatcher.Send(new PokeStopListEvent { Forts = pokeStops });
}
// Wasn't sure how to make this pretty. Edit as needed.
- return pokeStops.Where(
+ return Tuple.Create(
+ pokeStops,
+ pokeStops.Where(
i =>
- i.Type == FortType.Checkpoint &&
- i.CooldownCompleteTimestampMs < DateTime.UtcNow.ToUnixTime() &&
( // Make sure PokeStop is within 40 meters or else it is pointless to hit it
LocationUtils.CalculateDistanceInMeters(
session.Client.CurrentLatitude, session.Client.CurrentLongitude,
i.Latitude, i.Longitude) < 40) ||
session.LogicSettings.MaxTravelDistanceInMeters == 0
- ).ToList();
+ ).ToList());
}
private static async Task> UpdateFortsData(ISession session)
diff --git a/PoGo.NecroBot.Logic/Utils/LocationUtils.cs b/PoGo.NecroBot.Logic/Utils/LocationUtils.cs
index 04513bc24..6ff3ca101 100644
--- a/PoGo.NecroBot.Logic/Utils/LocationUtils.cs
+++ b/PoGo.NecroBot.Logic/Utils/LocationUtils.cs
@@ -2,6 +2,11 @@
using System;
using GeoCoordinatePortable;
+using System.Threading.Tasks;
+using POGOProtos.Networking.Responses;
+using PoGo.NecroBot.Logic.State;
+using PokemonGo.RocketAPI;
+using PoGo.NecroBot.Logic.Service;
#endregion
@@ -9,6 +14,12 @@ namespace PoGo.NecroBot.Logic.Utils
{
public static class LocationUtils
{
+ public static async Task UpdatePlayerLocationWithAltitude(ISession session, GeoCoordinate position)
+ {
+ double altitude = session.ElevationService.GetElevation(position.Latitude, position.Longitude);
+ return await session.Client.Player.UpdatePlayerLocation(position.Latitude, position.Longitude, altitude);
+ }
+
public static double CalculateDistanceInMeters(double sourceLat, double sourceLng, double destLat,
double destLng)
// from http://stackoverflow.com/questions/6366408/calculating-distance-between-two-latitude-and-longitude-geocoordinates
@@ -25,8 +36,11 @@ public static double CalculateDistanceInMeters(GeoCoordinate sourceLocation, Geo
destinationLocation.Latitude, destinationLocation.Longitude);
}
- public static double getElevation(double lat, double lon)
+ public static double getElevation(ISession session, double lat, double lon)
{
+ if (session != null)
+ return session.ElevationService.GetElevation(lat, lon);
+
Random random = new Random();
double maximum = 11.0f;
double minimum = 8.6f;
@@ -59,7 +73,7 @@ public static GeoCoordinate CreateWaypoint(GeoCoordinate sourceLocation, double
// adjust toLonRadians to be in the range -180 to +180...
targetLongitudeRadians = (targetLongitudeRadians + 3*Math.PI)%(2*Math.PI) - Math.PI;
- return new GeoCoordinate(ToDegrees(targetLatitudeRadians), ToDegrees(targetLongitudeRadians), getElevation(sourceLocation.Latitude, sourceLocation.Longitude));
+ return new GeoCoordinate(ToDegrees(targetLatitudeRadians), ToDegrees(targetLongitudeRadians), getElevation(null, sourceLocation.Latitude, sourceLocation.Longitude));
}
public static GeoCoordinate CreateWaypoint(GeoCoordinate sourceLocation, double distanceInMeters, double bearingDegrees, double altitude)
diff --git a/PoGo.NecroBot.Logic/packages.config b/PoGo.NecroBot.Logic/packages.config
index d289b6c91..a3cd81ca1 100644
--- a/PoGo.NecroBot.Logic/packages.config
+++ b/PoGo.NecroBot.Logic/packages.config
@@ -5,12 +5,12 @@
+
-
diff --git a/README.md b/README.md
index 88e346761..ebff05616 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,13 @@
+
+
+
+
[![Discord](https://discordapp.com/api/guilds/209253611031625728/widget.png)](https://discord.gg/VXKxNFr)
[![Stories in Ready](https://badge.waffle.io/NoxxDev/NecroBot.svg?label=ready&title=Ready)](https://waffle.io/NoxxDev/NecroBot)
[![Github All Releases](https://img.shields.io/github/downloads/NoxxDev/NecroBot/total.svg)](https://github.com/NoxxDev/NecroBot/releases)
[![GitHub license](https://img.shields.io/badge/license-AGPL-blue.svg)](https://raw.githubusercontent.com/NoxxDev/NecroBot/master/LICENSE.md)
[![Twitter Follow](https://img.shields.io/twitter/follow/NoxxDev.svg?style=social&label=Follow&maxAge=1)](https://twitter.com/NoxxDev)
-
-
-
-
-
## This repository is a fork updated of [NecroBot](https://github.com/NECROBOTIO/NecroBot)
@@ -43,8 +42,8 @@ Make sure you check out our [Wiki](https://github.com/NoxxDev/NecroBot/wiki) to
- [Snipe pokemon]
- [Manual Locations](https://github.com/NoxxDev/NecroBot/wiki/Manual-Locations-Sniping-Guide)
- [Automatic Locations](https://github.com/NoxxDev/NecroBot/wiki/Automatic-Locations-Sniping-Guide)
- - [HumanWalk Snipping](https://github.com/NoxxDev/NecroBot/wiki/Human-walk-snipe-config)
- - [MSniper Snipping](https://github.com/NoxxDev/NecroBot/wiki/MSniper-Manual-Snipping-Guide)
+ - [HumanWalk Sniping](https://github.com/NoxxDev/NecroBot/wiki/Human-walk-snipe-config)
+ - [MSniper Sniping](https://github.com/NoxxDev/NecroBot/wiki/MSniper-Manual-Sniping-Guide)
- [Power-Up pokemon]
- [Telegram Remote Control Support]
@@ -60,7 +59,7 @@ AeonLucid - [POGOProtos](https://github.com/AeonLucid/POGOProtos)
NECROBOTIO - [NecroBot](https://github.com/NECROBOTIO/NecroBot)
-Msx752 - [MSniper](https://github.com/msx752/MSniper)
+Msx752 - [MSniper](https://msx752.github.io/MSniper/)
Thanks to everyone who volunteered by contributing via Pull Requests!
@@ -68,6 +67,6 @@ Thanks to everyone who volunteered by contributing via Pull Requests!
This Website and Project is in no way affiliated with, authorized, maintained, sponsored or endorsed by Niantic, The Pokémon Company, Nintendo or any of its affiliates or subsidiaries. This is an independent and unofficial API for educational use ONLY.
-Using the Project might be against the TOS
+Using the Project might be against the TOS.
diff --git a/build.bat b/build.bat
new file mode 100644
index 000000000..54b4a27c3
--- /dev/null
+++ b/build.bat
@@ -0,0 +1,4 @@
+echo off
+
+nuget.exe restore "NecroBot for Pokemon Go.sln"
+"C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" "NecroBot for Pokemon Go.sln" /property:Configuration=Release /property:Platform=x86
\ No newline at end of file
diff --git a/nuget.exe b/nuget.exe
new file mode 100644
index 000000000..6bb79fe53
Binary files /dev/null and b/nuget.exe differ