From d9eceec2073535bb90b83679558da31c5719ec47 Mon Sep 17 00:00:00 2001 From: AN2548 Date: Sat, 30 Jul 2016 19:00:53 +0100 Subject: [PATCH 01/25] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 234c2551e..944328984 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Chatting about this Repository can be done on our Discord: https://discord.gg/Vs - [Use lucky egg while evolve] - [Egg Hatching Automatically] - [Multi bot support] + - [Snipe pokemon]

Getting Started

Make sure you check out our [Wiki](https://github.com/NecronomiconCoding/NecroBot/wiki) to get started. From bf4838401bb07bedf801e7e9ca144050ecc23f5a Mon Sep 17 00:00:00 2001 From: AN2548 Date: Sat, 30 Jul 2016 19:06:55 +0100 Subject: [PATCH 02/25] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 944328984..4a2619e0f 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Chatting about this Repository can be done on our Discord: https://discord.gg/Vs - [Egg Hatching Automatically] - [Multi bot support] - [Snipe pokemon] + - [Power-Up pokemon]

Getting Started

Make sure you check out our [Wiki](https://github.com/NecronomiconCoding/NecroBot/wiki) to get started. From d414a1f3b04a22e6cca1b3f3c0016367056915e8 Mon Sep 17 00:00:00 2001 From: Javier Sayago Date: Sat, 30 Jul 2016 20:25:50 +0200 Subject: [PATCH 03/25] Update translation.es.json --- .../Config/Translations/translation.es.json | 68 +++++++++++++------ 1 file changed, 46 insertions(+), 22 deletions(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.es.json b/PoGo.NecroBot.CLI/Config/Translations/translation.es.json index 6d7ab2136..e788f4fd2 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.es.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.es.json @@ -1,4 +1,4 @@ -{ +{ "TranslationStrings": [ { "Key": "pokeball", @@ -22,21 +22,19 @@ }, { "Key": "farmPokestopsOutsideRadius", - "Value": - "¡Estás fuera del radio definido! Andando a la posición inicial (a {0}m) en 5 segundos. ¿Es correcto tu archivo Coords.ini?" + "Value": "¡Estás fuera del radio definido! Andando a la posición inicial (a {0}m) en 5 segundos. ¿Es correcto tu archivo Coords.ini?" }, { "Key": "farmPokestopsNoUsableFound", - "Value": - "No se encontraron pokeparadas disponibles en tu área. ¿Has configurado una distancia máxima demasiado pequeña?" + "Value": "No se encontraron pokeparadas disponibles en tu área. ¿Has configurado una distancia máxima demasiado pequeña?" }, { "Key": "eventFortUsed", - "Value": "PX: {0}, Gemas: {1}, Objetos: {2}" + "Value": "Nombre: {0} PX: {1}, Gemas: {2}, Objetos: {3}" }, { "Key": "eventFortFailed", - "Value": "El avance falló, posible SoftBan. Eliminar SoftBan en: {0}/{1}" + "Value": "Nombre: {0} INFO: El avance falló, posible SoftBan. Eliminar SoftBan en: {1}/{2}" }, { "Key": "eventFortTargeted", @@ -68,8 +66,7 @@ }, { "Key": "eventPokemonCapture", - "Value": - "({0}) | ({1}) {2} Lvl: {3} PC: ({4}/{5}) IV: {6}% | Prob: {7}% | {8}m dist | con {9} (quedan {10}). | {11}" + "Value": "({0}) | ({1}) {2} Lvl: {3} PC: ({4}/{5}) IV: {6}% | Prob: {7}% | {8}m dist | con {9} (quedan {10}). | {11}" }, { "Key": "eventNoPokeballs", @@ -121,8 +118,7 @@ }, { "Key": "welcomeWarning", - "Value": - "Asegúrese de que la Latitud y Longitud son las correctas. Salga del Programa si no es así! Lat: {0} Lng: {1}" + "Value": "Asegúrese de que la Latitud y Longitud son las correctas. Salga del Programa si no es así! Lat: {0} Lng: {1}" }, { "Key": "incubatorPuttingEgg", @@ -134,7 +130,7 @@ }, { "Key": "incubatorEggHatched", - "Value": "Huevo incubado ha eclosionado: {0}" + "Value": "Huevo incubado ha eclosionado: {0} | Lvl: {1} CP: ({2}/{3}) IV: {4}%" }, { "Key": "logEntryError", @@ -272,14 +268,45 @@ "Key": "pokemonSkipped", "Value": "Omitido {0}" }, + { + "Key": "zeroPokeballInv", + "Value": "No tienes pokeballs en el inventario, no podemos atrapar más Pokemon por ahora :(" + }, + { + "Key": "currentPokeballInv", + "Value": "[Inventario actual] Pokeballs: {0} | Greatballs: {1} | Ultraballs: {2} | Masterballs: {3}" + }, + { + "Key": "checkingForBallsToRecycle", + "Value": "Comprobación de las bolas a reciclar, manteniendo {0}" + }, + { + "Key": "checkingForPotionsToRecycle", + "Value": "Comprobación de las pociones a reciclar, manteniendo {0}" + }, + { + "Key": "checkingForRevivesToRecycle", + "Value": "Comprobación de los revivir a reciclar, manteniendo {0}" + }, + { + "Key": "pokeballsToKeepIncorrect", + "Value": "TotalAmountOfPokebalsToKeep está configurado incorrectamente. El número es más pequeño que 1." + }, + { + "Key": "potionsToKeepIncorrect", + "Value": "TotalAmountOfPotionsToKeep está configurado incorrectamente. El número es más pequeño que 1." + }, + { + "Key": "revivesToKeepIncorrect", + "Value": "TotalAmountOfRevivesToKeep está configurado incorrectamente. El número es más pequeño que 1." + }, { "Key": "invFullTransferring", "Value": "El inventario de pokemons está lleno. Transferir pokemons..." }, { "Key": "invFullTransferManually", - "Value": - "El inventario de pokemons está lleno. Por favor transfiera los pokemons manualmente o active (true) TransferDuplicatePokemon en el archivo de opciones..." + "Value": "El inventario de pokemons está lleno. Por favor transfiera los pokemons manualmente o active (true) TransferDuplicatePokemon en el archivo de opciones..." }, { "Key": "invFullPokestopLooting", @@ -347,8 +374,7 @@ }, { "Key": "statsTemplateString", - "Value": - "{0} - Activo {1} - Nivel: {2} | EXP/H: {3:0} | P/H: {4:0} | P.Estelar: {5:0} | Transferido: {6:0} | Reciclado: {7:0}" + "Value": "{0} - Activo {1} - Nivel: {2} | EXP/H: {3:n0} | P/H: {4:n0} | P.Estelar: {5:n0} | Transferido: {6:n0} | Reciclado: {7:n0}" }, { "Key": "statsXpTemplateString", @@ -360,13 +386,11 @@ }, { "Key": "googleTwoFactorAuth", - "Value": - "Como tiene habilitado Google autenticación de 2 factores, tendrá que insertar una contraseña específica de la APP en el auth.json" + "Value": "Como tiene habilitado Google autenticación de 2 factores, tendrá que insertar una contraseña específica de la APP en el auth.json" }, { "Key": "googleTwoFactorAuthExplanation", - "Value": - "Abriendo Google App-Passwords. Por favor, cree una nueva contraseña en la APP (utilizar en otro dispositivo)" + "Value": "Abriendo Google App-Passwords. Por favor, cree una nueva contraseña en la APP (utilizar en otro dispositivo)" }, { "Key": "googleError", @@ -397,11 +421,11 @@ "Value": "No hay suficientes Pokeballs para iniciar Sniping! ({0}/{1})" }, { - "Key": "displayHighestMOVE1Header", + "Key": "displayHighestMove1Header", "Value": "MOVIMIENTO1" }, { - "Key": "displayHighestMOVE2Header", + "Key": "displayHighestMove2Header", "Value": "MOVIMIENTO2" } ] From f16ae32f05fe89d6b8315351bc8df642bd1dd5d0 Mon Sep 17 00:00:00 2001 From: Javier Sayago Date: Sat, 30 Jul 2016 20:42:41 +0200 Subject: [PATCH 04/25] Update translation.es.json --- PoGo.NecroBot.CLI/Config/Translations/translation.es.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.es.json b/PoGo.NecroBot.CLI/Config/Translations/translation.es.json index e788f4fd2..61c4b0acf 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.es.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.es.json @@ -74,7 +74,7 @@ }, { "Key": "catchStatusAttempt", - "Value": "{0} Intento #{1}" + "Value": "{0} | Intentos #{1}" }, { "Key": "catchStatus", From 73e9ddf0c1900b2e3ce4638e87e794a03a1bb555 Mon Sep 17 00:00:00 2001 From: Javier Sayago Date: Sat, 30 Jul 2016 20:51:27 +0200 Subject: [PATCH 05/25] Update translation.es.json --- PoGo.NecroBot.CLI/Config/Translations/translation.es.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.es.json b/PoGo.NecroBot.CLI/Config/Translations/translation.es.json index 61c4b0acf..bb745dd29 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.es.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.es.json @@ -70,7 +70,7 @@ }, { "Key": "eventNoPokeballs", - "Value": "¡Sin Pokéballs! - Hemos perdido un {0} con {1} PC :(" + "Value": "¡Sin Poké Ball! - Hemos perdido un {0} con {1} PC :(" }, { "Key": "catchStatusAttempt", @@ -270,11 +270,11 @@ }, { "Key": "zeroPokeballInv", - "Value": "No tienes pokeballs en el inventario, no podemos atrapar más Pokemon por ahora :(" + "Value": "No tienes Poké Ball en el inventario, no podemos atrapar más Pokemon por ahora :(" }, { "Key": "currentPokeballInv", - "Value": "[Inventario actual] Pokeballs: {0} | Greatballs: {1} | Ultraballs: {2} | Masterballs: {3}" + "Value": "[Inventario actual] Poké Ball: {0} | Super Ball: {1} | Ultra Ball: {2} | Master Ball: {3}" }, { "Key": "checkingForBallsToRecycle", @@ -418,7 +418,7 @@ }, { "Key": "notEnoughPokeballsToSnipe", - "Value": "No hay suficientes Pokeballs para iniciar Sniping! ({0}/{1})" + "Value": "No hay suficientes Poké Balls para iniciar Sniping! ({0}/{1})" }, { "Key": "displayHighestMove1Header", From 65e8a26b7eb871110da20ee9bb23f752558fc179 Mon Sep 17 00:00:00 2001 From: Javier Sayago Date: Sat, 30 Jul 2016 20:52:54 +0200 Subject: [PATCH 06/25] Update translation.es.json --- PoGo.NecroBot.CLI/Config/Translations/translation.es.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.es.json b/PoGo.NecroBot.CLI/Config/Translations/translation.es.json index bb745dd29..d8a2fbee7 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.es.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.es.json @@ -70,7 +70,7 @@ }, { "Key": "eventNoPokeballs", - "Value": "¡Sin Poké Ball! - Hemos perdido un {0} con {1} PC :(" + "Value": "¡Sin Poké Balls! - Hemos perdido un {0} con {1} PC :(" }, { "Key": "catchStatusAttempt", @@ -274,7 +274,7 @@ }, { "Key": "currentPokeballInv", - "Value": "[Inventario actual] Poké Ball: {0} | Super Ball: {1} | Ultra Ball: {2} | Master Ball: {3}" + "Value": "[Inventario actual] Poké Balls: {0} | Super Balls: {1} | Ultra Balls: {2} | Master Balls: {3}" }, { "Key": "checkingForBallsToRecycle", From 956feda4b456b83c2b7a8210aa3c5dc450fcd197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20B=C3=A9nazet?= Date: Sat, 30 Jul 2016 21:06:05 +0200 Subject: [PATCH 07/25] Update translation.fr.json Added key and fixed misspelling --- .../Config/Translations/translation.fr.json | 92 ++++++++++++++----- 1 file changed, 67 insertions(+), 25 deletions(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json b/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json index 0736b3b38..6220c2f9c 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json @@ -1,4 +1,4 @@ -{ +{ "TranslationStrings": [ { "Key": "pokeball", @@ -34,11 +34,11 @@ }, { "Key": "eventFortFailed", - "Value": "Collecte/Capture impossible, tentative dans : {1}/{2}" + "Value": "Collecte/Capture impossible, tentative dans : Unban dans : {1}/{2}" }, { "Key": "eventFortTargeted", - "Value": "{0} ({1}m)" + "Value": "Arrivée au Pokestop : {0} dans ({1}m)" }, { "Key": "eventProfileLogin", @@ -98,7 +98,7 @@ }, { "Key": "commonWordName", - "Value": "" + "Value": "nom" }, { "Key": "commonWordUnknown", @@ -118,7 +118,7 @@ }, { "Key": "welcomeWarning", - "Value": "Lat: {0} Lng: {1} de départ sauvegardé." + "Value": "Assuez vous que les coordonnées soient les bonnes. Lat: {0} Lng: {1}. Quittez le programme sinon" }, { "Key": "incubatorPuttingEgg", @@ -130,7 +130,7 @@ }, { "Key": "incubatorEggHatched", - "Value": "Eclosion de l'oeuf : {0}" + "Value": "Eclosion de l'oeuf : {0} | Lvl: {1} CP: ({2}/{3}) IV: {4}%" }, { "Key": "logEntryError", @@ -190,8 +190,7 @@ }, { "Key": "ptcOffline", - "Value": - "Les serveurs PTC semblent hors-ligne ou vos identifiants PTC sont incorrects. Merci d'essayer via Google." + "Value": "Les serveurs PTC semblent hors-ligne ou vos identifiants PTC sont incorrects. Merci d'essayer via Google." }, { "Key": "tryingAgainIn", @@ -199,7 +198,7 @@ }, { "Key": "accountNotVerified", - "Value": "Le compte n'est pas vérifié! Arrêt en cours..." + "Value": "Le compte n'est pas vérifié ! Arrêt en cours..." }, { "Key": "openingGoogleDevicePage", @@ -207,7 +206,7 @@ }, { "Key": "couldntCopyToClipboard", - "Value": "Entrez le code {1} sur {0}" + "Value": "Impossible de copier dans le presse-papier. Faites le manuellement" }, { "Key": "couldntCopyToClipboard2", @@ -223,8 +222,7 @@ }, { "Key": "coordinatesAreInvalid", - "Value": - "Les coordonnées définies dans le fichier \"Coords.ini\" sont invalides, utilisation des coordonnées par défaut." + "Value": "Les coordonnées définies dans le fichier \"Coords.ini\" sont invalides, utilisation des coordonnées par défaut." }, { "Key": "gotUpToDateVersion", @@ -269,6 +267,38 @@ { "Key": "pokemonSkipped", "Value": "{0} ignoré" + }, + { + "Key": "zeroPokeballInv", + "Value": "Vous n'avez plus de pokéballs, capture de pokémons impossible !" + }, + { + "Key": "currentPokeballInv", + "Value": "[Inventaire] Pokeballs: {0} | Superballs: {1} | Hyperballs: {2} | Masterballs: {3}" + }, + { + "Key": "checkingForBallsToRecycle", + "Value": "Recherche de PokeBalls à supprimer. En garder {0}" + }, + { + "Key": "checkingForPotionsToRecycle", + "Value": "Recherche de Potions à supprimer. En garder {0}" + }, + { + "Key": "checkingForRevivesToRecycle", + "Value": "Recherche de Rappels à supprimer. En garder {0}" + }, + { + "Key": "pokeballsToKeepIncorrect", + "Value": "TotalAmountOfPokebalsToKeep est mal configuré. Le nombre est inférieur à 1." + }, + { + "Key": "potionsToKeepIncorrect", + "Value": "TotalAmountOfPotionsToKeep est mal configuré. Le nombre est inférieur à 1." + }, + { + "Key": "revivesToKeepIncorrect", + "Value": "TotalAmountOfRevivesToKeep est mal configuré. Le nombre est inférieur à 1." }, { "Key": "invFullTransferring", @@ -276,12 +306,11 @@ }, { "Key": "invFullTransferManually", - "Value": - "L'inventaire de pokémon est plein. Merci de transférer manuellement ou de changer la valeur de \"TransferDuplicatePokemon\" en \"true\"..." + "Value": "L'inventaire de pokémon est plein. Merci de transférer manuellement ou de changer la valeur de \"TransferDuplicatePokemon\" en \"true\"..." }, { "Key": "invFullPokestopLooting", - "Value": "L'inventaire des objets est plein. Aucun objet n'a pu être récolter!" + "Value": "L'inventaire des objets est plein. Aucun objet n'a pu être récolté!" }, { "Key": "encounterProblem", @@ -293,15 +322,15 @@ }, { "Key": "desiredDestTooFar", - "Value": "Votre destination désirée {0}, {1} est plus éloigné que votre position actuelle {2}, {3}." + "Value": "Votre destination désirée {0}, {1} est trop éloignée de votre position actuelle {2}, {3}." }, { "Key": "pokemonRename", - "Value": "{0} ({1}) a été renommé de {2} à {3}." + "Value": "{0} ({1}) a été renommé de {2} en {3}." }, { "Key": "pokemonIgnoreFilter", - "Value": "[Pokémon-Ignore-Filter] - {0} ignoré comme défini dans les options!" + "Value": "[Pokémon-Ignore-Filter] - {0} ignoré comme défini dans les options !" }, { "Key": "catchStatusAttempt", @@ -345,12 +374,11 @@ }, { "Key": "statsTemplateString", - "Value": - "{0} - Runtime {1} - Lvl: {2} | EXP/H: {3:0} | P/H: {4:0} | Poussières: {5:0} | Transférés: {6:0} | Reçyclés: {7:0}" + "Value": "{0} - Runtime {1} - Lvl: {2} | EXP/H: {3:0} | P/H: {4:0} | Poussières: {5:0} | Transférés: {6:0} | Reçyclés: {7:0}" }, { "Key": "statsXpTemplateString", - "Value": "{0} (prochain level dans {1}h {2}m | {3}/{4} XP)" + "Value": "{0} (Prochain level dans {1}h {2}m | {3}/{4} XP)" }, { "Key": "requireInputText", @@ -358,13 +386,11 @@ }, { "Key": "googleTwoFactorAuth", - "Value": - "La validation en deux étapes de votre compte Google est activé, vous devez insérer un mot de passe spécifique à l'application dans auth.json" + "Value": "La validation en deux étapes de votre compte Google est activée, vous devez insérer un mot de passe spécifique à l'application dans auth.json" }, { "Key": "googleTwoFactorAuthExplanation", - "Value": - "Ouverture de la page Mots de passe d'application. Merci de générer un nouveau mot de passe spécifique à l'application. (use Other as Device)" + "Value": "Ouverture de la page Mots de passe d'application. Merci de générer un nouveau mot de passe spécifique à l'application. (use Other as Device)" }, { "Key": "googleError", @@ -381,10 +407,26 @@ { "Key": "snipeScan", "Value": "[Sniper] Scan en cours sur {0}..." + }, + { + "Key": "snipeScanEx", + "Value": "[Sniper] Scan de {0} avec {1} IV à {2}..." }, { "Key": "noPokemonToSnipe", "Value": "[Sniper] Echec du scan. Aucun pokémon trouvé." + }, + { + "Key": "notEnoughPokeballsToSnipe", + "Value": "Pas assez de Pokeballs pour commencer un snipping! ({0}/{1})" + }, + { + "Key": "displayHighestMove1Header", + "Value": "ATTAQUE1" + }, + { + "Key": "displayHighestMove2Header", + "Value": "ATTAQUE2" } ] } From cfd7065d367e0b51c657388a1b4991490a62375d Mon Sep 17 00:00:00 2001 From: Javier Sayago Date: Sat, 30 Jul 2016 21:24:47 +0200 Subject: [PATCH 08/25] Update translation.es.json --- PoGo.NecroBot.CLI/Config/Translations/translation.es.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.es.json b/PoGo.NecroBot.CLI/Config/Translations/translation.es.json index d8a2fbee7..c626e0b7f 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.es.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.es.json @@ -422,11 +422,11 @@ }, { "Key": "displayHighestMove1Header", - "Value": "MOVIMIENTO1" + "Value": "ATAQUE1" }, { "Key": "displayHighestMove2Header", - "Value": "MOVIMIENTO2" + "Value": "ATAQUE2" } ] } From 5a2cfea11626b897de9eef65827a45c5901965bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20B=C3=A9nazet?= Date: Sat, 30 Jul 2016 21:52:42 +0200 Subject: [PATCH 09/25] Update translation.fr.json --- .../Config/Translations/translation.fr.json | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json b/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json index 6220c2f9c..ca5f0d184 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json @@ -34,7 +34,7 @@ }, { "Key": "eventFortFailed", - "Value": "Collecte/Capture impossible, tentative dans : Unban dans : {1}/{2}" + "Value": "Collecte/Capture impossible, tentative dans : {1}/{2}" }, { "Key": "eventFortTargeted", @@ -98,7 +98,7 @@ }, { "Key": "commonWordName", - "Value": "nom" + "Value": "Nom" }, { "Key": "commonWordUnknown", @@ -204,14 +204,6 @@ "Key": "openingGoogleDevicePage", "Value": "Ouverture de la page Google Device. Merci de copier/coller le code avec CTRL+C/CTRL+V" }, - { - "Key": "couldntCopyToClipboard", - "Value": "Impossible de copier dans le presse-papier. Faites le manuellement" - }, - { - "Key": "couldntCopyToClipboard2", - "Value": "Entrez le code {1} sur {0}" - }, { "Key": "realisticTravelDetected", "Value": "Chemin réaliste détecté, utilisation du fichier UserSettings.settings" From d8b79b87e579f3a95e9ba1e31b067b50e9c311bc Mon Sep 17 00:00:00 2001 From: Revell1on Date: Sat, 30 Jul 2016 23:07:06 +0300 Subject: [PATCH 10/25] Bot was catching all pokemons above 300 with greatball despite ignoring user settings --- PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs index e72eb4d07..683deb721 100644 --- a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs @@ -195,9 +195,6 @@ private static async Task GetBestBall(ISession session, dynamic encounte if (greatBallsCount > 0 && iV >= session.LogicSettings.KeepMinIvPercentage && probability < 0.50) return ItemId.ItemGreatBall; - if (greatBallsCount > 0 && pokemonCp >= 300) - return ItemId.ItemGreatBall; - if (pokeBallsCount > 0) return ItemId.ItemPokeBall; if (greatBallsCount > 0) From cc8c15d518865e2e8454430647489a7c711ed2ba Mon Sep 17 00:00:00 2001 From: N0ct3 Date: Sat, 30 Jul 2016 22:15:42 +0200 Subject: [PATCH 11/25] Update EvolvePokemonTask.cs Added a message to be able to track the progress of the "Lucky egg" evolution farm --- PoGo.NecroBot.Logic/Tasks/EvolvePokemonTask.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PoGo.NecroBot.Logic/Tasks/EvolvePokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/EvolvePokemonTask.cs index fd21162ff..9c66ae786 100644 --- a/PoGo.NecroBot.Logic/Tasks/EvolvePokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/EvolvePokemonTask.cs @@ -42,6 +42,10 @@ public static async Task Execute(ISession session, CancellationToken cancellatio else { // Wait until we have enough pokemon + session.EventDispatcher.Send(new NoticeEvent() + { + Message = $"Not enough Pokemons to trigger a lucky egg. Waiting for {session.LogicSettings.UseLuckyEggsMinPokemonAmount - pokemonToEvolve.Count} more ({ pokemonToEvolve.Count}/{session.LogicSettings.UseLuckyEggsMinPokemonAmount})" + }); return; } } @@ -78,4 +82,4 @@ public static async Task UseLuckyEgg(ISession session) DelayingUtils.Delay(session.LogicSettings.DelayBetweenPokemonCatch, 2000); } } -} \ No newline at end of file +} From e9677dabd5207f31df31ed5477a3457eb90ed025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20B=C3=A9nazet?= Date: Sat, 30 Jul 2016 22:20:41 +0200 Subject: [PATCH 12/25] Update translation.fr.json --- .../Config/Translations/translation.fr.json | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json b/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json index ca5f0d184..6046bd87c 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json @@ -30,7 +30,7 @@ }, { "Key": "eventFortUsed", - "Value": "{0} | {1}XP, Gems: {2}, Objets: {3}" + "Value": "Nom : {0} | {1}XP, Gems : {2}, Objets : {3}" }, { "Key": "eventFortFailed", @@ -58,7 +58,7 @@ }, { "Key": "eventPokemonTransferred", - "Value": "{0}\t- {1}/{2}% [Meilleur {3}/{4}%] ({5} Bonbons)" + "Value": "{0}\t- PC: {1} - IV: {2}% [Maximum PC:{3} IV: {4}%] ({5} Bonbons)" }, { "Key": "eventItemRecycled", @@ -66,7 +66,7 @@ }, { "Key": "eventPokemonCapture", - "Value": "({0}) | ({1}) {2} Lvl {3} PC({4}/{5}) {6}%IV | {7}% Chance | {8}m dist | {10} {9} restant | {11}" + "Value": "({0}) | ({1}) {2} Lvl {3} [({4}/{5})/{6}%] {7}% Chance | {8}m dist | {10} {9} restant | {11}" }, { "Key": "eventNoPokeballs", @@ -200,10 +200,6 @@ "Key": "accountNotVerified", "Value": "Le compte n'est pas vérifié ! Arrêt en cours..." }, - { - "Key": "openingGoogleDevicePage", - "Value": "Ouverture de la page Google Device. Merci de copier/coller le code avec CTRL+C/CTRL+V" - }, { "Key": "realisticTravelDetected", "Value": "Chemin réaliste détecté, utilisation du fichier UserSettings.settings" @@ -370,7 +366,7 @@ }, { "Key": "statsXpTemplateString", - "Value": "{0} (Prochain level dans {1}h {2}m | {3}/{4} XP)" + "Value": "{0} (Prochain niveau dans {1}h {2}m | {3}/{4} XP)" }, { "Key": "requireInputText", From 44e7bc580a8f55ca2f9d2c24edeae2959ebc54fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20B=C3=A9nazet?= Date: Sat, 30 Jul 2016 22:38:47 +0200 Subject: [PATCH 13/25] Update translation.fr.json --- PoGo.NecroBot.CLI/Config/Translations/translation.fr.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json b/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json index 6046bd87c..bd5da6819 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.fr.json @@ -66,7 +66,7 @@ }, { "Key": "eventPokemonCapture", - "Value": "({0}) | ({1}) {2} Lvl {3} [({4}/{5})/{6}%] {7}% Chance | {8}m dist | {10} {9} restant | {11}" + "Value": "({0}) | ({1}) {2} Lv {3} {6} ({4}/{5}) | {7}% Chance sur {8}m | {10} {9} restant, {11}" }, { "Key": "eventNoPokeballs", @@ -74,7 +74,7 @@ }, { "Key": "catchStatusAttempt", - "Value": "Tentative#{1} - {0}" + "Value": #{1} - {0}" }, { "Key": "catchStatus", From f7371964a975b790d30a2acc4ee50563d9c53847 Mon Sep 17 00:00:00 2001 From: Tsuki Date: Sun, 31 Jul 2016 05:40:32 +0800 Subject: [PATCH 14/25] Use online server --- PoGo.NecroBot.Logic/ILogicSettings.cs | 1 + PoGo.NecroBot.Logic/Settings.cs | 2 + PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs | 141 +++++++++++++----- 3 files changed, 103 insertions(+), 41 deletions(-) diff --git a/PoGo.NecroBot.Logic/ILogicSettings.cs b/PoGo.NecroBot.Logic/ILogicSettings.cs index e67f7b410..d2e2a9a48 100644 --- a/PoGo.NecroBot.Logic/ILogicSettings.cs +++ b/PoGo.NecroBot.Logic/ILogicSettings.cs @@ -104,6 +104,7 @@ public interface ILogicSettings string SnipeLocationServer { get; } int SnipeLocationServerPort { get; } bool UseSnipeLocationServer { get; } + bool UseSnipeOnlineLocationServer { get; } bool UseTransferIvForSnipe { get; } bool SnipeIgnoreUnknownIv { get; } int MinDelayBetweenSnipes { get; } diff --git a/PoGo.NecroBot.Logic/Settings.cs b/PoGo.NecroBot.Logic/Settings.cs index 0562a4b81..ce3b21113 100644 --- a/PoGo.NecroBot.Logic/Settings.cs +++ b/PoGo.NecroBot.Logic/Settings.cs @@ -387,6 +387,7 @@ public class GlobalSettings public int UseUltraBallAboveCp = 1000; public double WalkingSpeedInKilometerPerHour = 15.0; public int WebSocketPort = 14251; + public bool UseSnipeOnlineLocationServer = true; public static GlobalSettings Default => new GlobalSettings(); @@ -626,6 +627,7 @@ public LogicSettings(GlobalSettings settings) public string SnipeLocationServer => _settings.SnipeLocationServer; public int SnipeLocationServerPort => _settings.SnipeLocationServerPort; public bool UseSnipeLocationServer => _settings.UseSnipeLocationServer; + public bool UseSnipeOnlineLocationServer => _settings.UseSnipeOnlineLocationServer; public bool UseTransferIvForSnipe => _settings.UseTransferIvForSnipe; public bool SnipeIgnoreUnknownIv => _settings.SnipeIgnoreUnknownIv; public int MinDelayBetweenSnipes => _settings.MinDelayBetweenSnipes; diff --git a/PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs index 951fb3c9c..3bb1e34a1 100644 --- a/PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/SnipePokemonTask.cs @@ -6,12 +6,16 @@ using System.IO; using System.Linq; using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using PoGo.NecroBot.Logic.Common; using PoGo.NecroBot.Logic.Event; +using PoGo.NecroBot.Logic.Logging; using PoGo.NecroBot.Logic.State; using POGOProtos.Enums; using POGOProtos.Inventory.Item; @@ -130,18 +134,26 @@ public static async Task Execute(ISession session, CancellationToken cancellatio if (session.LogicSettings.UseSnipeLocationServer) { - var locationsToSnipe = SnipeLocations?.Where(q => - (!session.LogicSettings.UseTransferIvForSnipe || - (q.Iv == 0 && !session.LogicSettings.SnipeIgnoreUnknownIv) || - (q.Iv >= session.Inventory.GetPokemonTransferFilter(q.Id).KeepMinIvPercentage)) && - !LocsVisited.Contains(new PokemonLocation(q.Latitude, q.Longitude)) - && !(q.TimeStamp != default(DateTime) && - q.TimeStamp > new DateTime(2016) && - // make absolutely sure that the server sent a correct datetime - q.TimeStamp < DateTime.Now) && - (q.Id == PokemonId.Missingno || pokemonIds.Contains(q.Id))).ToList() ?? - new List(); - + List locationsToSnipe; + if (session.LogicSettings.UseSnipeOnlineLocationServer) + { + locationsToSnipe = new List(SnipeLocations); + locationsToSnipe = locationsToSnipe.Where(q =>q.Id == PokemonId.Missingno || pokemonIds.Contains(q.Id)).ToList(); + } + else + { + locationsToSnipe = SnipeLocations?.Where(q => + (!session.LogicSettings.UseTransferIvForSnipe || + (q.Iv == 0 && !session.LogicSettings.SnipeIgnoreUnknownIv) || + (q.Iv >= session.Inventory.GetPokemonTransferFilter(q.Id).KeepMinIvPercentage)) && + !LocsVisited.Contains(new PokemonLocation(q.Latitude, q.Longitude)) + && !(q.TimeStamp != default(DateTime) && + q.TimeStamp > new DateTime(2016) && + // make absolutely sure that the server sent a correct datetime + q.TimeStamp < DateTime.Now) && + (q.Id == PokemonId.Missingno || pokemonIds.Contains(q.Id))).ToList() ?? + new List(); + } if (locationsToSnipe.Any()) { _lastSnipe = DateTime.Now; @@ -331,47 +343,94 @@ private static ScanResult SnipeScanForPokemon(Location location) } return scanResult; } - + public class Pokesniper + { + public string id { get; set; } + public string name { get; set; } + public string coords { get; set; } + public DateTime until { get; set; } + public string icon { get; set; } + } public static async Task Start(Session session, CancellationToken cancellationToken) { while (true) { - cancellationToken.ThrowIfCancellationRequested(); - try + if (session.LogicSettings.UseSnipeOnlineLocationServer) { - var lClient = new TcpClient(); - lClient.Connect(session.LogicSettings.SnipeLocationServer, - session.LogicSettings.SnipeLocationServerPort); + try + { + using (var httpClient = new HttpClient()) + { + httpClient.DefaultRequestHeaders.Accept.Add( + new MediaTypeWithQualityHeaderValue("application/json")); + var response =await + httpClient.GetAsync("http://pokesnipers.com/api/v1/pokemon.json", cancellationToken); + response.EnsureSuccessStatusCode(); + var json = await response.Content.ReadAsStringAsync(); + dynamic pokesniper = JsonConvert.DeserializeObject(json); + JArray results = pokesniper.results; + SnipeLocations.Clear(); + foreach (var result in results) + { + PokemonId id; + Enum.TryParse(result.Value("name"), out id); + var a = new SniperInfo + { + Id = id, + Iv = 100, + Latitude = Convert.ToDouble(result.Value("coords").Split(',')[0]), + Longitude = Convert.ToDouble(result.Value("coords").Split(',')[1]), + TimeStamp = DateTime.Now + }; + SnipeLocations.Add(a); + } + } + } + catch (Exception e) + { + // ignored + } + } + else + { + cancellationToken.ThrowIfCancellationRequested(); + try + { + var lClient = new TcpClient(); + lClient.Connect(session.LogicSettings.SnipeLocationServer, + session.LogicSettings.SnipeLocationServerPort); - var sr = new StreamReader(lClient.GetStream()); + var sr = new StreamReader(lClient.GetStream()); - while (lClient.Connected) - { - var line = sr.ReadLine(); - if (line == null) - throw new Exception("Unable to ReadLine from sniper socket"); + while (lClient.Connected) + { + var line = sr.ReadLine(); + if (line == null) + throw new Exception("Unable to ReadLine from sniper socket"); - var info = JsonConvert.DeserializeObject(line); + var info = JsonConvert.DeserializeObject(line); - if (SnipeLocations.Any(x => - Math.Abs(x.Latitude - info.Latitude) < 0.0001 && - Math.Abs(x.Longitude - info.Longitude) < 0.0001)) - // we might have different precisions from other sources - continue; + if (SnipeLocations.Any(x => + Math.Abs(x.Latitude - info.Latitude) < 0.0001 && + Math.Abs(x.Longitude - info.Longitude) < 0.0001)) + // we might have different precisions from other sources + continue; - SnipeLocations.RemoveAll(x => DateTime.Now > x.TimeStampAdded.AddMinutes(15)); - SnipeLocations.Add(info); + SnipeLocations.RemoveAll(x => DateTime.Now > x.TimeStampAdded.AddMinutes(15)); + SnipeLocations.Add(info); + } + } + catch (SocketException) + { + // this is spammed to often. Maybe add it to debug log later + } + catch (Exception ex) + { + // most likely System.IO.IOException + session.EventDispatcher.Send(new ErrorEvent {Message = ex.ToString()}); } } - catch (SocketException) - { - // this is spammed to often. Maybe add it to debug log later - } - catch (Exception ex) - { - // most likely System.IO.IOException - session.EventDispatcher.Send(new ErrorEvent {Message = ex.ToString()}); - } + await Task.Delay(5000, cancellationToken); } From 90b09fd2aab2f26cfd878a276029dd8b17a955a5 Mon Sep 17 00:00:00 2001 From: Sinekk Date: Sat, 30 Jul 2016 23:49:46 +0200 Subject: [PATCH 15/25] Add translation.ca.json Added NecroBot translation to Catalan language. --- .../Config/Translations/translation.ca.json | 434 ++++++++++++++++++ 1 file changed, 434 insertions(+) create mode 100644 PoGo.NecroBot.CLI/Config/Translations/translation.ca.json diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.ca.json b/PoGo.NecroBot.CLI/Config/Translations/translation.ca.json new file mode 100644 index 000000000..4d96449b4 --- /dev/null +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.ca.json @@ -0,0 +1,434 @@ +{ + "TranslationStrings": [ + { + "Key": "pokeball", + "Value": "Poké Ball" + }, + { + "Key": "greatPokeball", + "Value": "Super Ball" + }, + { + "Key": "ultraPokeball", + "Value": "Ultra Ball" + }, + { + "Key": "masterPokeball", + "Value": "Master Ball" + }, + { + "Key": "wrongAuthType", + "Value": "AuthType desconegut dins de config.json" + }, + { + "Key": "farmPokestopsOutsideRadius", + "Value": "Ets fora del radi definit! Caminant cap a la posició inicial (a {0}m) en 5 segons. És correcte el teu arxiu Coords.ini?" + }, + { + "Key": "farmPokestopsNoUsableFound", + "Value": "No s'han trobat pokeparades disponibles dins la teva àrea. Has configurat una distància màxima massa petita?" + }, + { + "Key": "eventFortUsed", + "Value": "PX: {0}, Gemmes: {1}, Objectes: {2}" + }, + { + "Key": "eventFortFailed", + "Value": "El desplaçament ha fallat, possible SoftBan. Eliminar SoftBan en: {0}/{1}" + }, + { + "Key": "eventFortTargeted", + "Value": "{0} en ({1}m)" + }, + { + "Key": "eventProfileLogin", + "Value": "Jugant com a {0}" + }, + { + "Key": "eventUsedLuckyEgg", + "Value": "S'ha fet servir un Ou de la Sort. Te'n queden {0}" + }, + { + "Key": "eventPokemonEvolvedSuccess", + "Value": "{0}, obtens {1}px" + }, + { + "Key": "eventPokemonEvolvedFailed", + "Value": "Fallit {0}. El resultat ha estat {1}, parant d'evolucionar {2}" + }, + { + "Key": "eventPokemonTransferred", + "Value": "{0}\t- PC: {1} IV: {2}% [Millor PC: {3} IV: {4}%] (Caramels: {5})" + }, + { + "Key": "eventItemRecycled", + "Value": "{0}x {1}" + }, + { + "Key": "eventPokemonCapture", + "Value": + "({0}) | ({1}) {2} Lvl: {3} PC: ({4}/{5}) IV: {6}% | Prob: {7}% | {8}m dist | amb {9} (queden {10}). | {11}" + }, + { + "Key": "eventNoPokeballs", + "Value": "Sense Pokéballs! - Hem perdut un {0} amb {1} PC :(" + }, + { + "Key": "catchStatusAttempt", + "Value": "{0} Intent #{1}" + }, + { + "Key": "catchStatus", + "Value": "{0}" + }, + { + "Key": "candies", + "Value": "Caramels: {0}" + }, + { + "Key": "unhandledGpxData", + "Value": "Error: Dades de l'arxiu GPX no controlades, intentar ometre." + }, + { + "Key": "displayHighestsHeader", + "Value": "Pokemon" + }, + { + "Key": "commonWordPerfect", + "Value": "perfecte" + }, + { + "Key": "commonWordName", + "Value": "nom" + }, + { + "Key": "commonWordUnknown", + "Value": "Desconegut" + }, + { + "Key": "displayHighestsCpHeader", + "Value": "Pokemon amb més PC" + }, + { + "Key": "displayHighestsPerfectHeader", + "Value": "Pokemon amb més Perfecció" + }, + { + "Key": "displayHighestsLevelHeader", + "Value": "Pokemon amb més Nivell" + }, + { + "Key": "welcomeWarning", + "Value": "Asegura't que la Latitud i la Longitud són correctes. Surt del programa si no és així! Lat: {0} Lng: {1}" + }, + { + "Key": "incubatorPuttingEgg", + "Value": "Afegint ou a la incubadora: {0:0.00}km restants" + }, + { + "Key": "incubatorStatusUpdate", + "Value": "Actualitzant l'estat de la incubadora: {0:0.00}km restants" + }, + { + "Key": "incubatorEggHatched", + "Value": "L'ou incubat ha eclosionat! : {0}" + }, + { + "Key": "logEntryError", + "Value": "ERROR" + }, + { + "Key": "logEntryAttention", + "Value": "ATENCIÓ" + }, + { + "Key": "logEntryInfo", + "Value": "INFO" + }, + { + "Key": "logEntryPokestop", + "Value": "POKEPARADA" + }, + { + "Key": "logEntryFarming", + "Value": "FARMING" + }, + { + "Key": "logEntryRecycling", + "Value": "RECICLATGE" + }, + { + "Key": "logEntryPKMN", + "Value": "PKMN" + }, + { + "Key": "logEntryTransfered", + "Value": "TRANSFERIT" + }, + { + "Key": "logEntryEvolved", + "Value": "EVOLUCIONAR" + }, + { + "Key": "logEntryBerry", + "Value": "BAIA" + }, + { + "Key": "logEntryEgg", + "Value": "OU" + }, + { + "Key": "logEntryDebug", + "Value": "DEBUG" + }, + { + "Key": "logEntryUpdate", + "Value": "ACTUALITZAR" + }, + { + "Key": "loggingIn", + "Value": "Connectat fent servir {0}" + }, + { + "Key": "ptcOffline", + "Value": "Els servidors de PTC probablement han caigut o les teves dades d'accés són incorrectes. Prova amb Google." + }, + { + "Key": "tryingAgainIn", + "Value": "Intentar de nou en {0} segons..." + }, + { + "Key": "accountNotVerified", + "Value": "Compte no verificat! Sortint..." + }, + { + "Key": "openingGoogleDevicePage", + "Value": "Obrint la pàgina de Google Device. Si us plau, enganxa el codi fent servir CTRL+V." + }, + { + "Key": "couldntCopyToClipboard", + "Value": "No s'ha pogut copiar al portpapers, si us plau, fes-ho manualment." + }, + { + "Key": "couldntCopyToClipboard2", + "Value": "Anar: {0} & introduïr {1}" + }, + { + "Key": "realisticTravelDetected", + "Value": "Detectat viatge realista, utilitzant UserSettings.settings" + }, + { + "Key": "notRealisticTravel", + "Value": "Viatge no realista en {0}, utilitzant l'últim Coords.ini memoritzat" + }, + { + "Key": "coordinatesAreInvalid", + "Value": "Les coordenades de \"Coords.ini\" no són correctes, utilizant les coordenades predeterminades" + }, + { + "Key": "gotUpToDateVersion", + "Value": "Perfecte! Ja tens la versió més recent del programa {0}" + }, + { + "Key": "autoUpdaterDisabled", + "Value": "L'AutoUpdater està desactivat. Obtén l'última versió a: {0}\n " + }, + { + "Key": "downloadingUpdate", + "Value": "Descarregant i aplicant l'actualització..." + }, + { + "Key": "finishedDownloadingRelease", + "Value": "Acabada la descàrrega de l'última actualització..." + }, + { + "Key": "finishedUnpackingFiles", + "Value": "Acabat el desempaquetament dels arxius..." + }, + { + "Key": "finishedTransferringConfig", + "Value": "S'ha acabat de transferir la teva configuració a la nova versió..." + }, + { + "Key": "updateFinished", + "Value": "Actualització acabada, ja pots tancar aquesta finestra." + }, + { + "Key": "lookingForIncensePokemon", + "Value": "Buscant encens per a pokemon..." + }, + { + "Key": "lookingForPokemon", + "Value": "Buscant Pokemon..." + }, + { + "Key": "lookingForLurePokemon", + "Value": "Buscant Esquers pokemon..." + }, + { + "Key": "pokemonSkipped", + "Value": "Omès {0}" + }, + { + "Key": "zeroPokeballInv", + "Value": "No tens pokeballs en el teu inventori, no es poden capturar més Pokemon." + }, + { + "Key": "currentPokeballInv", + "Value": "[Inventori Actual] Pokeballs: {0} | Greatballs: {1} | Ultraballs: {2} | Masterballs: {3}" + }, + { + "Key": "checkingForBallsToRecycle", + "Value": "Comprovant si hi ha boles per reciclar, guardant-ne {0}" + }, + { + "Key": "checkingForPotionsToRecycle", + "Value": "Comprovant si hi ha pocions per reciclar, guardant-ne {0}" + }, + { + "Key": "checkingForRevivesToRecycle", + "Value": "Comprovant si hi ha reviures per reciclar, guardant-ne {0}" + }, + { + "Key": "pokeballsToKeepIncorrect", + "Value": "L'opció TotalAmountOfPokebalsToKeep ha estat configurada incorrectament. El nombre és menor que 1." + }, + { + "Key": "potionsToKeepIncorrect", + "Value": "L'opció TotalAmountOfPotionsToKeep ha estat configurada incorrectament. El nombre és menor que 1" + }, + { + "Key": "revivesToKeepIncorrect", + "Value": "L'opció TotalAmountOfRevivesToKeep ha estat configurada incorrectament. El nombre és menor que 1" + }, + { + "Key": "invFullTransferring", + "Value": "L'inventari de pokemons està ple. Transferir pokemons..." + }, + { + "Key": "invFullTransferManually", + "Value": "L'inventari de pokemons està ple. Si us plau, transfereix els pokemons manualment o activa l'opció TransferDuplicatePokemon dins l'arxiu de Configuració posant-la com a (True)..." + }, + { + "Key": "invFullPokestopLooting", + "Value": "L'inventari està ple, no s'ha pogut lootejar res :(" + }, + { + "Key": "encounterProblem", + "Value": "S'ha trobat un nou problema: {0}" + }, + { + "Key": "encounterProblemLurePokemon", + "Value": "S'ha trobat un problema: Esquer pokemon {0}" + }, + { + "Key": "desiredDestTooFar", + "Value": "La destinació desitjada {0}, {1} està massa lluny de la teva posició actual {2}, {3}" + }, + { + "Key": "pokemonRename", + "Value": "Pokemon {0} ({1}) reanomenat de {2} a {3}." + }, + { + "Key": "pokemonIgnoreFilter", + "Value": "[Filtre de Pokemons Ignorats] - Ignorant {0} tal i com s'ha definit en la configuració actual." + }, + { + "Key": "catchStatusAttempt", + "Value": "Intent de Captura" + }, + { + "Key": "catchStatusError", + "Value": "Error de Captura" + }, + { + "Key": "catchStatusEscape", + "Value": "Captura Fallida" + }, + { + "Key": "catchStatusFlee", + "Value": "Fugida" + }, + { + "Key": "catchStatusMissed", + "Value": "Captures Perdudes" + }, + { + "Key": "catchStatusSuccess", + "Value": "Captura Exitosa" + }, + { + "Key": "catchTypeNormal", + "Value": "Normal" + }, + { + "Key": "catchTypeLure", + "Value": "Esquer" + }, + { + "Key": "catchTypeIncense", + "Value": "Encens" + }, + { + "Key": "webSocketFailStart", + "Value": "No s'ha pogut iniciar WebSocketServer en el port: {0}" + }, + { + "Key": "statsTemplateString", + "Value": + "{0} - Actiu {1} - Nivell: {2} | EXP/H: {3:0} | P/H: {4:0} | P.Estel·lar: {5:0} | Transferit: {6:0} | Reciclat: {7:0}" + }, + { + "Key": "statsXpTemplateString", + "Value": "{0} (proper nivell en {1}h {2}m | {3}/{4} XP)" + }, + { + "Key": "requireInputText", + "Value": "El programa continuarà després de premer una tecla..." + }, + { + "Key": "googleTwoFactorAuth", + "Value": "Com tens habilitada l'autenticació de Google en 2 passos, hauràs d'inserir una contrasenya específica de l'APP dins de l'arxiu auth.json" + }, + { + "Key": "googleTwoFactorAuthExplanation", + "Value": "Obrint Google App-Passwords. Si us plau, crea una nova contrasenya en l'APP (utilitzar en un altre dispositiu)" + }, + { + "Key": "googleError", + "Value": "Assegura't d'haver introduit el correu electrònic i contrasenya correctes." + }, + { + "Key": "missingCredentialsGoogle", + "Value": "És necessari omplir els camps GoogleUsername i GooglePassword a l'arxiu auth.json!" + }, + { + "Key": "missingCredentialsPtc", + "Value": "És necessari omplir els camps PtcUsername i PtcPassword a l'arxiu auth.json!" + }, + { + "Key": "snipeScan", + "Value": "[Sniper] Escanejant {0} en busca de Pokemons..." + }, + { + "Key": "snipeScanEx", + "Value": "[Sniper] Snipejant a {0} amb {1} IV a {2}..." + }, + { + "Key": "noPokemonToSnipe", + "Value": "[Sniper] No s'han trobat Pokemons :(" + }, + { + "Key": "notEnoughPokeballsToSnipe", + "Value": "No hi ha suficients Pokeballs per a iniciar l'Sniping! ({0}/{1})" + }, + { + "Key": "displayHighestMOVE1Header", + "Value": "MOVIMENT1" + }, + { + "Key": "displayHighestMOVE2Header", + "Value": "MOVIMENT2" + } + ] +} From 587cb95a2709cbabc4acf8fa50a7f1931c2b3b36 Mon Sep 17 00:00:00 2001 From: bornsupercharged Date: Sat, 30 Jul 2016 17:37:36 -0500 Subject: [PATCH 16/25] Fixed problems with ball logic --- PoGo.NecroBot.Logic/ILogicSettings.cs | 3 +++ PoGo.NecroBot.Logic/Settings.cs | 6 ++++++ PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs | 19 ++++++------------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/PoGo.NecroBot.Logic/ILogicSettings.cs b/PoGo.NecroBot.Logic/ILogicSettings.cs index e67f7b410..74adc0864 100644 --- a/PoGo.NecroBot.Logic/ILogicSettings.cs +++ b/PoGo.NecroBot.Logic/ILogicSettings.cs @@ -72,6 +72,9 @@ public interface ILogicSettings int UseGreatBallAboveCp { get; } int UseUltraBallAboveCp { get; } int UseMasterBallAboveCp { get; } + double UseMasterBallBelowCatchProbability { get; } + double UseUltraBallBelowCatchProbability { get; } + double UseGreatBallBelowCatchProbability { get; } int DelayBetweenPokemonCatch { get; } bool AutomaticallyLevelUpPokemon { get; } string LevelUpByCPorIv { get; } diff --git a/PoGo.NecroBot.Logic/Settings.cs b/PoGo.NecroBot.Logic/Settings.cs index 0562a4b81..dcac9ee6a 100644 --- a/PoGo.NecroBot.Logic/Settings.cs +++ b/PoGo.NecroBot.Logic/Settings.cs @@ -381,6 +381,9 @@ public class GlobalSettings public int UseLuckyEggsMinPokemonAmount = 30; public bool UseLuckyEggsWhileEvolving = false; public int UseMasterBallAboveCp = 1500; + public double UseGreatBallBelowCatchProbability = 0.5; + public double UseUltraBallBelowCatchProbability = 0.4; + public double UseMasterBallBelowCatchProbability = 0.05; public bool UsePokemonToNotCatchFilter = false; public bool UseSnipeLocationServer = false; public bool UseTransferIvForSnipe = false; @@ -592,6 +595,9 @@ public LogicSettings(GlobalSettings settings) public int UseGreatBallAboveCp => _settings.UseGreatBallAboveCp; public int UseUltraBallAboveCp => _settings.UseUltraBallAboveCp; public int UseMasterBallAboveCp => _settings.UseMasterBallAboveCp; + public double UseMasterBallBelowCatchProbability => _settings.UseMasterBallBelowCatchProbability; + public double UseUltraBallBelowCatchProbability => _settings.UseUltraBallBelowCatchProbability; + public double UseGreatBallBelowCatchProbability => _settings.UseGreatBallBelowCatchProbability; public int DelayBetweenPokemonCatch => _settings.DelayBetweenPokemonCatch; public int DelayBetweenPlayerActions => _settings.DelayBetweenPlayerActions; public bool UsePokemonToNotCatchFilter => _settings.UsePokemonToNotCatchFilter; diff --git a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs index e72eb4d07..a1a4cca7d 100644 --- a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs @@ -180,22 +180,15 @@ private static async Task GetBestBall(ISession session, dynamic encounte var masterBallsCount = await session.Inventory.GetItemAmountByType(ItemId.ItemMasterBall); if (masterBallsCount > 0 && - ((pokemonCp >= session.LogicSettings.UseMasterBallAboveCp && - !session.LogicSettings.PokemonToUseMasterball.Any()) || + ((!session.LogicSettings.PokemonToUseMasterball.Any() && + (pokemonCp >= session.LogicSettings.UseMasterBallAboveCp || probability < session.LogicSettings.UseMasterBallBelowCatchProbability)) || session.LogicSettings.PokemonToUseMasterball.Contains(pokemonId))) return ItemId.ItemMasterBall; - if (ultraBallsCount > 0 && pokemonCp >= session.LogicSettings.UseUltraBallAboveCp) + if (ultraBallsCount > 0 && + (pokemonCp >= session.LogicSettings.UseUltraBallAboveCp || probability < session.LogicSettings.UseUltraBallBelowCatchProbability)) return ItemId.ItemUltraBall; - if (greatBallsCount > 0 && pokemonCp >= session.LogicSettings.UseGreatBallAboveCp) - return ItemId.ItemGreatBall; - - if (ultraBallsCount > 0 && iV >= session.LogicSettings.KeepMinIvPercentage && probability < 0.40) - return ItemId.ItemUltraBall; - - if (greatBallsCount > 0 && iV >= session.LogicSettings.KeepMinIvPercentage && probability < 0.50) - return ItemId.ItemGreatBall; - - if (greatBallsCount > 0 && pokemonCp >= 300) + if (greatBallsCount > 0 && + (pokemonCp >= session.LogicSettings.UseGreatBallAboveCp || probability < session.LogicSettings.UseGreatBallBelowCatchProbability)) return ItemId.ItemGreatBall; if (pokeBallsCount > 0) From a74e257fbb8727853612bee0ad4a0bdfd77f35a9 Mon Sep 17 00:00:00 2001 From: bornsupercharged Date: Sat, 30 Jul 2016 18:04:06 -0500 Subject: [PATCH 17/25] Fixed indentation and added iV configurable option --- PoGo.NecroBot.Logic/ILogicSettings.cs | 2 ++ PoGo.NecroBot.Logic/Settings.cs | 8 ++++-- PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs | 25 ++++++++++++------- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/PoGo.NecroBot.Logic/ILogicSettings.cs b/PoGo.NecroBot.Logic/ILogicSettings.cs index 74adc0864..7ad7c565a 100644 --- a/PoGo.NecroBot.Logic/ILogicSettings.cs +++ b/PoGo.NecroBot.Logic/ILogicSettings.cs @@ -72,6 +72,8 @@ public interface ILogicSettings int UseGreatBallAboveCp { get; } int UseUltraBallAboveCp { get; } int UseMasterBallAboveCp { get; } + int UseGreatBallAboveIv { get; } + int UseUltraBallAboveIv { get; } double UseMasterBallBelowCatchProbability { get; } double UseUltraBallBelowCatchProbability { get; } double UseGreatBallBelowCatchProbability { get; } diff --git a/PoGo.NecroBot.Logic/Settings.cs b/PoGo.NecroBot.Logic/Settings.cs index dcac9ee6a..1b191b3ef 100644 --- a/PoGo.NecroBot.Logic/Settings.cs +++ b/PoGo.NecroBot.Logic/Settings.cs @@ -377,17 +377,19 @@ public class GlobalSettings public float UpgradePokemonIvMinimum = 95; public bool UseEggIncubators = true; public bool UseGpxPathing = false; - public int UseGreatBallAboveCp = 750; public int UseLuckyEggsMinPokemonAmount = 30; public bool UseLuckyEggsWhileEvolving = false; + public int UseGreatBallAboveCp = 750; + public int UseUltraBallAboveCp = 1000; public int UseMasterBallAboveCp = 1500; + public int UseGreatBallAboveIv = 80; + public int UseUltraBallAboveIv = 90; public double UseGreatBallBelowCatchProbability = 0.5; public double UseUltraBallBelowCatchProbability = 0.4; public double UseMasterBallBelowCatchProbability = 0.05; public bool UsePokemonToNotCatchFilter = false; public bool UseSnipeLocationServer = false; public bool UseTransferIvForSnipe = false; - public int UseUltraBallAboveCp = 1000; public double WalkingSpeedInKilometerPerHour = 15.0; public int WebSocketPort = 14251; @@ -595,6 +597,8 @@ public LogicSettings(GlobalSettings settings) public int UseGreatBallAboveCp => _settings.UseGreatBallAboveCp; public int UseUltraBallAboveCp => _settings.UseUltraBallAboveCp; public int UseMasterBallAboveCp => _settings.UseMasterBallAboveCp; + public int UseGreatBallAboveIv => _settings.UseGreatBallAboveIv; + public int UseUltraBallAboveIv => _settings.UseUltraBallAboveIv; public double UseMasterBallBelowCatchProbability => _settings.UseMasterBallBelowCatchProbability; public double UseUltraBallBelowCatchProbability => _settings.UseUltraBallBelowCatchProbability; public double UseGreatBallBelowCatchProbability => _settings.UseGreatBallBelowCatchProbability; diff --git a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs index a1a4cca7d..035d1d05d 100644 --- a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs @@ -179,17 +179,24 @@ private static async Task GetBestBall(ISession session, dynamic encounte var ultraBallsCount = await session.Inventory.GetItemAmountByType(ItemId.ItemUltraBall); var masterBallsCount = await session.Inventory.GetItemAmountByType(ItemId.ItemMasterBall); - if (masterBallsCount > 0 && - ((!session.LogicSettings.PokemonToUseMasterball.Any() && - (pokemonCp >= session.LogicSettings.UseMasterBallAboveCp || probability < session.LogicSettings.UseMasterBallBelowCatchProbability)) || - session.LogicSettings.PokemonToUseMasterball.Contains(pokemonId))) + if (masterBallsCount > 0 && ( + (!session.LogicSettings.PokemonToUseMasterball.Any() && ( + pokemonCp >= session.LogicSettings.UseMasterBallAboveCp || + probability < session.LogicSettings.UseMasterBallBelowCatchProbability)) || + session.LogicSettings.PokemonToUseMasterball.Contains(pokemonId))) return ItemId.ItemMasterBall; - if (ultraBallsCount > 0 && - (pokemonCp >= session.LogicSettings.UseUltraBallAboveCp || probability < session.LogicSettings.UseUltraBallBelowCatchProbability)) + + if (ultraBallsCount > 0 && ( + pokemonCp >= session.LogicSettings.UseUltraBallAboveCp || + iV >= session.LogicSettings.UseUltraBallAboveIv || + probability < session.LogicSettings.UseUltraBallBelowCatchProbability)) + return ItemId.ItemUltraBall; + + if (greatBallsCount > 0 && ( + pokemonCp >= session.LogicSettings.UseGreatBallAboveCp || + iV >= session.LogicSettings.UseGreatBallAboveIv || + probability < session.LogicSettings.UseGreatBallBelowCatchProbability)) return ItemId.ItemUltraBall; - if (greatBallsCount > 0 && - (pokemonCp >= session.LogicSettings.UseGreatBallAboveCp || probability < session.LogicSettings.UseGreatBallBelowCatchProbability)) - return ItemId.ItemGreatBall; if (pokeBallsCount > 0) return ItemId.ItemPokeBall; From 520a69711e3470fca601f3b61f3fca1bf728e447 Mon Sep 17 00:00:00 2001 From: bornsupercharged Date: Sat, 30 Jul 2016 18:19:56 -0500 Subject: [PATCH 18/25] Had a bug in the code where it would throw a ultraball instead of a greatball. --- PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs index 035d1d05d..c7128c81c 100644 --- a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs @@ -196,16 +196,10 @@ private static async Task GetBestBall(ISession session, dynamic encounte pokemonCp >= session.LogicSettings.UseGreatBallAboveCp || iV >= session.LogicSettings.UseGreatBallAboveIv || probability < session.LogicSettings.UseGreatBallBelowCatchProbability)) - return ItemId.ItemUltraBall; + return ItemId.ItemGreatBall; if (pokeBallsCount > 0) return ItemId.ItemPokeBall; - if (greatBallsCount > 0) - return ItemId.ItemGreatBall; - if (ultraBallsCount > 0) - return ItemId.ItemUltraBall; - if (masterBallsCount > 0 && !session.LogicSettings.PokemonToUseMasterball.Any()) - return ItemId.ItemMasterBall; return ItemId.ItemUnknown; } From 3c2c7e4dace99e843038e6805f87a7e7421b6242 Mon Sep 17 00:00:00 2001 From: nrmodesto Date: Sun, 31 Jul 2016 00:56:50 +0100 Subject: [PATCH 19/25] Update translation.pt-pt.json Converted from Portuguese from Brazil to Portuguese from Portugal... --- .../Translations/translation.pt-pt.json | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.pt-pt.json b/PoGo.NecroBot.CLI/Config/Translations/translation.pt-pt.json index de8f43369..09b1f41ba 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.pt-pt.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.pt-pt.json @@ -18,16 +18,16 @@ }, { "Key": "wrongAuthType", - "Value": "Tipo de autenticação desconhecida em config.json" + "Value": "Tipo de autenticação desconhecida no ficheiro config.json" }, { "Key": "farmPokestopsOutsideRadius", "Value": - "Você está fora do seu raio definido! Caminhando para o início ({0}m) em 5 segundos. Suas coordenadas em Coords.ini estão corretas?" + "Estás fora do raio definido! A caminhar para o início ({0}m) em 5 segundos. As coordenadas em Coords.ini estão corretas?" }, { "Key": "farmPokestopsNoUsableFound", - "Value": "Não foram encontradas PokeStops na sua área. Sua distância máxima não é muito pequena?" + "Value": "Não foram encontradas PokeStops na tua área. A tua distância máxima não é muito pequena?" }, { "Key": "eventFortUsed", @@ -35,19 +35,19 @@ }, { "Key": "eventFortFailed", - "Value": "Nome: {0} INFO: O saque falhou, possível softban. Desbanindo em: {1}/{2}" + "Value": "Nome: {0} INFO: O drop falhou, softban possível. Desbloqueio em: {1}/{2}" }, { "Key": "eventFortTargeted", - "Value": "Chegando ao Pokestop: {0} em ({1}m)" + "Value": "A chegar ao Pokestop: {0} em ({1}m)" }, { "Key": "eventProfileLogin", - "Value": "Jogando como {0}" + "Value": "A jogar como {0}" }, { "Key": "eventUsedLuckyEgg", - "Value": "Ovo da Sorte utilizado, restando: {0}" + "Value": "Ovo da Sorte utilizado, a restar: {0}" }, { "Key": "eventPokemonEvolvedSuccess", @@ -55,7 +55,7 @@ }, { "Key": "eventPokemonEvolvedFailed", - "Value": "Falhou {0}. O resultado foi {1}, parando evolução {2}" + "Value": "Falhou {0}. O resultado foi {1}, a parar a evolução {2}" }, { "Key": "eventPokemonTransferred", @@ -72,7 +72,7 @@ }, { "Key": "eventNoPokeballs", - "Value": "Sem Pokébolas - Nós perdemos um(a) {0} com {1} de CP" + "Value": "Sem Pokébolas - Perdemos um(a) {0} com {1} de CP" }, { "Key": "catchStatusAttempt", @@ -88,7 +88,7 @@ }, { "Key": "unhandledGpxData", - "Value": "Dados não processados ​​no arquivo GPX, tentando ignorar." + "Value": "Dados não processados ​​no ficheiro GPX, a ignorar." }, { "Key": "displayHighestsHeader", @@ -108,19 +108,19 @@ }, { "Key": "displayHighestsCpHeader", - "Value": "Exibir maior CP" + "Value": "Mostrar maior CP" }, { "Key": "displayHighestsPerfectHeader", - "Value": "Exibir os mais perfeitos" + "Value": "Mostrar os mais perfeitos" }, { "Key": "displayHighestsLevelHeader", - "Value": "Exibir os com level mais alto" + "Value": "Mostrar os com nível mais alto" }, { "Key": "welcomeWarning", - "Value": "Verifique se a Lat & Lng estão corretas. O bot irá fechar caso contrário! Lat: {0} Lng: {1}" + "Value": "Verifica se a Lat & Lng estão corretas. O bot fechará caso contrário! Lat: {0} Lng: {1}" }, { "Key": "incubatorPuttingEgg", @@ -192,7 +192,7 @@ }, { "Key": "ptcOffline", - "Value": "Os Servidores PTC provavelmente estão offline ou suas credenciais são inválidas. Tente o Google." + "Value": "Os Servidores PTC provavelmente estão offline ou as credenciais são inválidas. Experimenta o Google." }, { "Key": "tryingAgainIn", @@ -204,15 +204,15 @@ }, { "Key": "openingGoogleDevicePage", - "Value": "Abrindo a página de aparelhos Google. Cole o código utilizando CTRL+V" + "Value": "Abrindo a página de dispositivos Google. Cola o código utilizando CTRL+V" }, { "Key": "couldntCopyToClipboard", - "Value": "Não foi possível copiar para área de transferência, faça isso manualmente" + "Value": "Não foi possível copiar para área de transferência, faz isso manualmente!" }, { "Key": "couldntCopyToClipboard2", - "Value": "Vá para: {0} & e informe {1}" + "Value": "Vai para: {0} & e informa {1}" }, { "Key": "realisticTravelDetected", @@ -220,15 +220,15 @@ }, { "Key": "notRealisticTravel", - "Value": "Sem movimentos realista em {0}, utilizando ultimas configurações salvas em Coords.ini" + "Value": "Sem movimentos realistas em {0}, utilizando as ultimas configurações salvas em Coords.ini" }, { "Key": "coordinatesAreInvalid", - "Value": "As coodernadas no arquivo \"Coords.ini\" são inválidas, utilizando as coordenadas padrão" + "Value": "As coodernadas no ficheiro \"Coords.ini\" sãp inválidas, utilizando as coordenadas por defeito" }, { "Key": "gotUpToDateVersion", - "Value": "Perfeito! Você já possui a última Versão {0}" + "Value": "Perfeito! Já possuis a última Versão {0}" }, { "Key": "autoUpdaterDisabled", @@ -236,7 +236,7 @@ }, { "Key": "downloadingUpdate", - "Value": "Baixando e aplicando atualização..." + "Value": "Transferindo e aplicando a atualização..." }, { "Key": "finishedDownloadingRelease", @@ -244,11 +244,11 @@ }, { "Key": "finishedUnpackingFiles", - "Value": "Terminando de descompactar arquivos..." + "Value": "Terminando de descompactar os ficheiros..." }, { "Key": "updateFinished", - "Value": "Atualização concluída, você já pode fechar essa janela." + "Value": "Atualização concluída, já podes fechar esta janela." }, { "Key": "lookingForIncensePokemon", @@ -273,11 +273,11 @@ { "Key": "invFullTransferManually", "Value": - "O inventário de Pokémons está cheio. Transfira seus pokémons manualmente altere TransferDuplicatePokemon para true nas configurações..." + "O inventário de Pokémons está cheio. Transfere os pokémons manualmente ou altera TransferDuplicatePokemon para true nas configurações..." }, { "Key": "invFullPokestopLooting", - "Value": "O inventório está cheio, nenhum item saqueado!" + "Value": "O inventário está cheio, nenhum item dropado!" }, { "Key": "encounterProblem", @@ -289,7 +289,7 @@ }, { "Key": "desiredDestTooFar", - "Value": "Seu destino desejado de {0}, {1} é muito longe de sua posição atual {2}, {3}" + "Value": "O destino desejado de {0}, {1} é muito longe da tua posição atual {2}, {3}" }, { "Key": "pokemonRename", @@ -350,28 +350,28 @@ }, { "Key": "requireInputText", - "Value": "Pressione enter para dar início ao bot..." + "Value": "Pressiona enter para dar início ao bot..." }, { "Key": "googleTwoFactorAuth", "Value": - "Como você possui o Google Two Factor Auth ativado, você precisará informar o App Specific Password no arquivo auth.json" + "Como tens o Google Two Factor Auth ativado, precisarás de definir o App Specific Password no ficheiro auth.json" }, { "Key": "googleTwoFactorAuthExplanation", - "Value": "Abrindo Google App-Passwords. Faça um novo App Password (utilize Outro como Aparelho)" + "Value": "Abrindo Google App-Passwords. Faz um novo App Password (utilize Outro como Dispositivo)" }, { "Key": "googleError", - "Value": "Verifique se você informou um e-mail e uma senha correta." + "Value": "Verifica se definiste um e-mail e uma palavra-passe correta." }, { "Key": "missingCredentialsGoogle", - "Value": "Você precisa informar o GoogleUsername e GooglePassword no arquivo auth.json!" + "Value": "Precisas de definir o GoogleUsername e GooglePassword no ficheiro auth.json!" }, { "Key": "missingCredentialsPtc", - "Value": "Você precisa informar o PtcUsername e PtcPassword no arquivo auth.json!" + "Value": "Precisas de definir o PtcUsername e PtcPassword no ficheiro auth.json!" }, { "Key": "snipeScan", From 78f4e8d992e7bf0755e7a8bbd343230ca886bba3 Mon Sep 17 00:00:00 2001 From: TheTravelingTrainer Date: Sun, 31 Jul 2016 00:58:48 +0100 Subject: [PATCH 20/25] Updates to websockets to handle command based communcation (#1497) * Added inital command interface for web sockets * added back in legacy calls * didnt save all files * async issues --- PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj | 16 +++-- .../Events/PokemonListResponce.cs | 20 ++++++ .../BasicGetCommands/GetPokemonListHandler.cs | 26 ++++++++ .../Helpers/PokemonListWeb.cs | 31 ++++++++++ .../Tasks/GetPokemonListTask.cs | 26 ++++++++ .../WebSocketHandler/EncodingHelper.cs | 25 ++++++++ .../IWebSocketRequestHandler.cs | 16 +++++ .../WebSocketHandler/IWebSocketResponce.cs | 14 +++++ .../WebSocketHandler/WebSocketEventManager.cs | 61 +++++++++++++++++++ PoGo.NecroBot.CLI/WebSocketInterface.cs | 18 +++++- 10 files changed, 248 insertions(+), 5 deletions(-) create mode 100644 PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/Events/PokemonListResponce.cs create mode 100644 PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/GetPokemonListHandler.cs create mode 100644 PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/Helpers/PokemonListWeb.cs create mode 100644 PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/Tasks/GetPokemonListTask.cs create mode 100644 PoGo.NecroBot.CLI/WebSocketHandler/EncodingHelper.cs create mode 100644 PoGo.NecroBot.CLI/WebSocketHandler/IWebSocketRequestHandler.cs create mode 100644 PoGo.NecroBot.CLI/WebSocketHandler/IWebSocketResponce.cs create mode 100644 PoGo.NecroBot.CLI/WebSocketHandler/WebSocketEventManager.cs diff --git a/PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj b/PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj index 7acb1a633..cf260544b 100644 --- a/PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj +++ b/PoGo.NecroBot.CLI/PoGo.NecroBot.CLI.csproj @@ -109,6 +109,14 @@ + + + + + + + + @@ -204,6 +212,7 @@ Resources.Designer.cs + @@ -227,8 +236,7 @@ - - f.ItemSpec).Where(f => !excludedAssemblie foreach (var item in filesToCleanup) File.Delete(item); -]]> - +]]> + diff --git a/PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/Events/PokemonListResponce.cs b/PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/Events/PokemonListResponce.cs new file mode 100644 index 000000000..e16ffaf8a --- /dev/null +++ b/PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/Events/PokemonListResponce.cs @@ -0,0 +1,20 @@ +using PoGo.NecroBot.Logic.Event; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PoGo.NecroBot.CLI.WebSocketHandler.BasicGetCommands.Events +{ + public class PokemonListResponce : IWebSocketResponce, IEvent + { + public PokemonListResponce(dynamic data) + { + Command = "PokemonListWeb"; + Data = data; + } + public string Command { get; private set; } + public dynamic Data { get; private set; } + } +} diff --git a/PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/GetPokemonListHandler.cs b/PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/GetPokemonListHandler.cs new file mode 100644 index 000000000..7591f5bcd --- /dev/null +++ b/PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/GetPokemonListHandler.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using SuperSocket.WebSocket; +using PoGo.NecroBot.CLI.WebSocketHandler.BasicGetCommands.Tasks; +using PoGo.NecroBot.Logic.State; + +namespace PoGo.NecroBot.CLI.WebSocketHandler.BasicGetCommands +{ + public class GetPokemonListHandler : IWebSocketRequestHandler + { + public string Command { get; private set;} + + public GetPokemonListHandler() + { + Command = "GetPokemonList"; + } + + public async Task Handle(ISession session, WebSocketSession webSocketSession, dynamic message) + { + await GetPokemonListTask.Execute(session, webSocketSession); + } + } +} diff --git a/PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/Helpers/PokemonListWeb.cs b/PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/Helpers/PokemonListWeb.cs new file mode 100644 index 000000000..86f21b1d0 --- /dev/null +++ b/PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/Helpers/PokemonListWeb.cs @@ -0,0 +1,31 @@ +using POGOProtos.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PoGo.NecroBot.CLI.WebSocketHandler.BasicGetCommands +{ + public class PokemonListWeb + { + public PokemonData Base; + + public PokemonListWeb(PokemonData data) + { + Base = data; + } + + public double IvPerfection + { + get + { + return Logic.PoGoUtils.PokemonInfo.CalculatePokemonPerfection(Base); + } + } + + } +} + + + diff --git a/PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/Tasks/GetPokemonListTask.cs b/PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/Tasks/GetPokemonListTask.cs new file mode 100644 index 000000000..d01f9d013 --- /dev/null +++ b/PoGo.NecroBot.CLI/WebSocketHandler/BasicGetCommands/Tasks/GetPokemonListTask.cs @@ -0,0 +1,26 @@ +using PoGo.NecroBot.CLI.WebSocketHandler.BasicGetCommands.Events; +using PoGo.NecroBot.Logic.State; +using SuperSocket.WebSocket; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PoGo.NecroBot.CLI.WebSocketHandler.BasicGetCommands.Tasks +{ + class GetPokemonListTask + { + + public static async Task Execute(ISession session, WebSocketSession webSocketSession) + { + var allPokemonInBag = await session.Inventory.GetHighestsCp(1000); + var list = new List(); + allPokemonInBag.ToList().ForEach(o => list.Add(new PokemonListWeb(o))); + webSocketSession.Send(EncodingHelper.Serialize(new PokemonListResponce(list))); + + await Task.Delay(500); + } + + } +} diff --git a/PoGo.NecroBot.CLI/WebSocketHandler/EncodingHelper.cs b/PoGo.NecroBot.CLI/WebSocketHandler/EncodingHelper.cs new file mode 100644 index 000000000..9caadbe59 --- /dev/null +++ b/PoGo.NecroBot.CLI/WebSocketHandler/EncodingHelper.cs @@ -0,0 +1,25 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PoGo.NecroBot.CLI.WebSocketHandler +{ + class EncodingHelper + { + + public static string Serialize(dynamic evt) + { + var jsonSerializerSettings = new JsonSerializerSettings + { + TypeNameHandling = TypeNameHandling.None + }; + + return JsonConvert.SerializeObject(evt, Formatting.None, jsonSerializerSettings); + } + + + } +} diff --git a/PoGo.NecroBot.CLI/WebSocketHandler/IWebSocketRequestHandler.cs b/PoGo.NecroBot.CLI/WebSocketHandler/IWebSocketRequestHandler.cs new file mode 100644 index 000000000..61b6e2ceb --- /dev/null +++ b/PoGo.NecroBot.CLI/WebSocketHandler/IWebSocketRequestHandler.cs @@ -0,0 +1,16 @@ +using PoGo.NecroBot.Logic.State; +using SuperSocket.WebSocket; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PoGo.NecroBot.CLI.WebSocketHandler +{ + interface IWebSocketRequestHandler + { + string Command { get; } + Task Handle(ISession session, WebSocketSession webSocketSession, dynamic message); + } +} diff --git a/PoGo.NecroBot.CLI/WebSocketHandler/IWebSocketResponce.cs b/PoGo.NecroBot.CLI/WebSocketHandler/IWebSocketResponce.cs new file mode 100644 index 000000000..e9cbedc8b --- /dev/null +++ b/PoGo.NecroBot.CLI/WebSocketHandler/IWebSocketResponce.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PoGo.NecroBot.CLI.WebSocketHandler +{ + interface IWebSocketResponce + { + string Command { get; } + dynamic Data { get; } + } +} diff --git a/PoGo.NecroBot.CLI/WebSocketHandler/WebSocketEventManager.cs b/PoGo.NecroBot.CLI/WebSocketHandler/WebSocketEventManager.cs new file mode 100644 index 000000000..164c84b21 --- /dev/null +++ b/PoGo.NecroBot.CLI/WebSocketHandler/WebSocketEventManager.cs @@ -0,0 +1,61 @@ +using SuperSocket.WebSocket; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using PoGo.NecroBot.Logic.Tasks; +using System.Reflection; +using PoGo.NecroBot.Logic.State; + +namespace PoGo.NecroBot.CLI.WebSocketHandler +{ + class WebSocketEventManager + { + Dictionary _registerdHandlers = new Dictionary(); + + public void RegisterHandler(string actionName, IWebSocketRequestHandler action) + { + try + { + _registerdHandlers.Add(actionName,action); + } + catch(Exception ex) + { + // todo + } + } + + public async Task Handle(ISession session, WebSocketSession webSocketSession, dynamic message) + { + if (_registerdHandlers.ContainsKey((string)message.Command)) + { + await _registerdHandlers[(string)message.Command].Handle(session, webSocketSession, message); + } + else + { + // Unknown command. + } + } + + // Registers all IWebSocketRequestHandler's automatically. + + public static WebSocketEventManager CreateInstance() + { + var manager = new WebSocketEventManager(); + + var type = typeof(IWebSocketRequestHandler); + var types = AppDomain.CurrentDomain.GetAssemblies() + .SelectMany(s => s.GetTypes()) + .Where(p => type.IsAssignableFrom(p) && p.IsClass); + + foreach(var plugin in types) + { + IWebSocketRequestHandler instance = (IWebSocketRequestHandler)Activator.CreateInstance(plugin); + manager.RegisterHandler(instance.Command, instance); + } + + return manager; + } + } +} diff --git a/PoGo.NecroBot.CLI/WebSocketInterface.cs b/PoGo.NecroBot.CLI/WebSocketInterface.cs index ea14f993e..8c4a62fd6 100644 --- a/PoGo.NecroBot.CLI/WebSocketInterface.cs +++ b/PoGo.NecroBot.CLI/WebSocketInterface.cs @@ -1,6 +1,8 @@ #region using directives using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using PoGo.NecroBot.CLI.WebSocketHandler; using PoGo.NecroBot.Logic.Common; using PoGo.NecroBot.Logic.Event; using PoGo.NecroBot.Logic.Logging; @@ -20,12 +22,14 @@ public class WebSocketInterface private readonly Session _session; private PokeStopListEvent _lastPokeStopList; private ProfileEvent _lastProfile; + private WebSocketEventManager _websocketHandler; public WebSocketInterface(int port, Session session) { _session = session; var translations = session.Translation; _server = new WebSocketServer(); + _websocketHandler = WebSocketEventManager.CreateInstance(); var setupComplete = _server.Setup(new ServerConfig { Name = "NecroWebSocket", @@ -79,7 +83,7 @@ private void HandleEvent(ProfileEvent evt) private async void HandleMessage(WebSocketSession session, string message) { - switch (message) + switch(message) { case "PokemonList": await PokemonListTask.Execute(_session); @@ -88,6 +92,18 @@ private async void HandleMessage(WebSocketSession session, string message) await EggsListTask.Execute(_session); break; } + + // Setup to only send data back to the session that requested it. + try + { + dynamic decodedMessage = JObject.Parse(message); + await _websocketHandler?.Handle(_session, session, decodedMessage); + } + catch (JsonException ex) + { + + + } } private void HandleSession(WebSocketSession session) From fac3f0be78afac110438a1a8c388993808d643e6 Mon Sep 17 00:00:00 2001 From: nrmodesto Date: Sun, 31 Jul 2016 00:59:07 +0100 Subject: [PATCH 21/25] Update translation.pt-pt.json --- PoGo.NecroBot.CLI/Config/Translations/translation.pt-pt.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.pt-pt.json b/PoGo.NecroBot.CLI/Config/Translations/translation.pt-pt.json index 09b1f41ba..a57dc45dd 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.pt-pt.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.pt-pt.json @@ -224,7 +224,7 @@ }, { "Key": "coordinatesAreInvalid", - "Value": "As coodernadas no ficheiro \"Coords.ini\" sãp inválidas, utilizando as coordenadas por defeito" + "Value": "As coodernadas no ficheiro \"Coords.ini\" são inválidas, utilizando as coordenadas por defeito" }, { "Key": "gotUpToDateVersion", From a5f1cb7a1770289a91ce3e1f306786dcbc88e4de Mon Sep 17 00:00:00 2001 From: AlessioDP Date: Sun, 31 Jul 2016 02:08:00 +0200 Subject: [PATCH 22/25] Updated translation.it.json Fixed: LogEntryPKMN > LogEntryPkmn DisplayHighestMOVEXHeader > DisplayHighestMoveXHeader --- .../Config/Translations/translation.it.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.it.json b/PoGo.NecroBot.CLI/Config/Translations/translation.it.json index a924d6786..110170dab 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.it.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.it.json @@ -159,7 +159,7 @@ "Value": "RICICLO" }, { - "Key": "logEntryPKMN", + "Key": "logEntryPkmn", "Value": "PKMN" }, { @@ -381,6 +381,18 @@ "Key": "snipeScan", "Value": "[Sniper] Scansione Pokémon per lo snipe a {0}.." }, + { + "Key": "noPokemonToSnipe", + "Value": "[Sniper] Nessun Pokémon trovato per lo snipe!" + }, + { + "Key": "DisplayHighestMove1Header", + "Value": "Mossa1" + }, + { + "Key": "DisplayHighestMove2Header", + "Value": "Mossa2" + }, { "Key": "noPokemonToSnipe", "Value": "[Sniper] Nessun Pokémon trovato per lo snipe!" From 7cfd30a8191c391d0346e6ba2f65eb99ce6af233 Mon Sep 17 00:00:00 2001 From: bornsupercharged Date: Sat, 30 Jul 2016 19:46:41 -0500 Subject: [PATCH 23/25] Everything is working except the external POGOProtos dll for the setting favorite call. --- PoGo.NecroBot.Logic/Common/Translations.cs | 3 ++ PoGo.NecroBot.Logic/ILogicSettings.cs | 2 + .../PoGo.NecroBot.Logic.csproj | 1 + PoGo.NecroBot.Logic/Settings.cs | 4 ++ PoGo.NecroBot.Logic/State/FarmState.cs | 7 +++ PoGo.NecroBot.Logic/Tasks/Farm.cs | 5 +++ .../Tasks/FarmPokestopsGPXTask.cs | 5 +++ .../Tasks/FarmPokestopsTask.cs | 9 ++++ .../Tasks/FavoritePokemonTask.cs | 43 +++++++++++++++++++ 9 files changed, 79 insertions(+) create mode 100644 PoGo.NecroBot.Logic/Tasks/FavoritePokemonTask.cs diff --git a/PoGo.NecroBot.Logic/Common/Translations.cs b/PoGo.NecroBot.Logic/Common/Translations.cs index 748da0952..e342f1d3f 100644 --- a/PoGo.NecroBot.Logic/Common/Translations.cs +++ b/PoGo.NecroBot.Logic/Common/Translations.cs @@ -103,6 +103,7 @@ public enum TranslationString LookingForLurePokemon, DesiredDestTooFar, PokemonRename, + PokemonFavorite, PokemonIgnoreFilter, CatchStatusError, CatchStatusEscape, @@ -273,6 +274,8 @@ public class Translation : ITranslation "Your desired destination of {0}, {1} is too far from your current position of {2}, {3}"), new KeyValuePair(TranslationString.PokemonRename, "Pokemon {0} ({1}) renamed from {2} to {3}."), + new KeyValuePair(TranslationString.PokemonFavorite, + "{0}% perfect {1} (CP {2}) *favorited*."), new KeyValuePair(TranslationString.PokemonIgnoreFilter, "[Pokemon ignore filter] - Ignoring {0} as defined in settings"), new KeyValuePair(TranslationString.CatchStatusAttempt, "CatchAttempt"), diff --git a/PoGo.NecroBot.Logic/ILogicSettings.cs b/PoGo.NecroBot.Logic/ILogicSettings.cs index e67f7b410..c208932d3 100644 --- a/PoGo.NecroBot.Logic/ILogicSettings.cs +++ b/PoGo.NecroBot.Logic/ILogicSettings.cs @@ -91,6 +91,8 @@ public interface ILogicSettings bool DumpPokemonStats { get; } bool RenamePokemon { get; } bool RenameOnlyAboveIv { get; } + float FavoriteMinIvPercentage { get; } + bool AutoFavoritePokemon { get; } string RenameTemplate { get; } int AmountOfPokemonToDisplayOnStart { get; } string TranslationLanguageCode { get; } diff --git a/PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj b/PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj index e98ae7111..2cbb9a14a 100644 --- a/PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj +++ b/PoGo.NecroBot.Logic/PoGo.NecroBot.Logic.csproj @@ -89,6 +89,7 @@ + diff --git a/PoGo.NecroBot.Logic/Settings.cs b/PoGo.NecroBot.Logic/Settings.cs index 0562a4b81..0e15e8b4e 100644 --- a/PoGo.NecroBot.Logic/Settings.cs +++ b/PoGo.NecroBot.Logic/Settings.cs @@ -361,6 +361,8 @@ public class GlobalSettings public bool RenameOnlyAboveIv = true; public bool RenamePokemon = false; + public float FavoriteMinIvPercentage = 95; + public bool AutoFavoritePokemon = false; public string RenameTemplate = "{1}_{0}"; public bool SnipeAtPokestops = false; public bool SnipeIgnoreUnknownIv = false; @@ -606,6 +608,8 @@ public LogicSettings(GlobalSettings settings) public float EvolveAboveIvValue => _settings.EvolveAboveIvValue; public bool RenamePokemon => _settings.RenamePokemon; public bool RenameOnlyAboveIv => _settings.RenameOnlyAboveIv; + public float FavoriteMinIvPercentage => _settings.FavoriteMinIvPercentage; + public bool AutoFavoritePokemon => _settings.AutoFavoritePokemon; public string RenameTemplate => _settings.RenameTemplate; public int AmountOfPokemonToDisplayOnStart => _settings.AmountOfPokemonToDisplayOnStart; public bool DumpPokemonStats => _settings.DumpPokemonStats; diff --git a/PoGo.NecroBot.Logic/State/FarmState.cs b/PoGo.NecroBot.Logic/State/FarmState.cs index e78601062..408e3557e 100644 --- a/PoGo.NecroBot.Logic/State/FarmState.cs +++ b/PoGo.NecroBot.Logic/State/FarmState.cs @@ -21,15 +21,22 @@ public async Task Execute(ISession session, CancellationToken cancellati { await TransferDuplicatePokemonTask.Execute(session, cancellationToken); } + if (session.LogicSettings.AutomaticallyLevelUpPokemon) { await LevelUpPokemonTask.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); if (session.LogicSettings.UseEggIncubators) diff --git a/PoGo.NecroBot.Logic/Tasks/Farm.cs b/PoGo.NecroBot.Logic/Tasks/Farm.cs index fff7d3370..f9f4949c6 100644 --- a/PoGo.NecroBot.Logic/Tasks/Farm.cs +++ b/PoGo.NecroBot.Logic/Tasks/Farm.cs @@ -42,6 +42,11 @@ public void Run(CancellationToken cancellationToken) RenamePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken); } + if (_session.LogicSettings.AutoFavoritePokemon) + { + FavoritePokemonTask.Execute(_session, cancellationToken).Wait(cancellationToken); + } + RecycleItemsTask.Execute(_session, cancellationToken).Wait(cancellationToken); if (_session.LogicSettings.UseEggIncubators) diff --git a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs index ea28d42d6..efec15193 100644 --- a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsGPXTask.cs @@ -134,6 +134,11 @@ public static async Task Execute(ISession session, CancellationToken cancellatio { await RenamePokemonTask.Execute(session, cancellationToken); } + + if (session.LogicSettings.AutoFavoritePokemon) + { + await FavoritePokemonTask.Execute(session, cancellationToken); + } } await session.Navigation.HumanPathWalking( diff --git a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs index 4d3386da2..84068bc5c 100644 --- a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs @@ -163,23 +163,32 @@ await session.Navigation.HumanLikeWalking(new GeoCoordinate(pokeStop.Latitude, p await session.Inventory.RefreshCachedInventory(); } await RecycleItemsTask.Execute(session, cancellationToken); + if (session.LogicSettings.EvolveAllPokemonWithEnoughCandy || session.LogicSettings.EvolveAllPokemonAboveIv) { await EvolvePokemonTask.Execute(session, cancellationToken); } + if (session.LogicSettings.AutomaticallyLevelUpPokemon) { await LevelUpPokemonTask.Execute(session, cancellationToken); } + if (session.LogicSettings.TransferDuplicatePokemon) { await TransferDuplicatePokemonTask.Execute(session, cancellationToken); } + if (session.LogicSettings.RenamePokemon) { await RenamePokemonTask.Execute(session, cancellationToken); } + + if (session.LogicSettings.AutoFavoritePokemon) + { + await FavoritePokemonTask.Execute(session, cancellationToken); + } } if (session.LogicSettings.SnipeAtPokestops || session.LogicSettings.UseSnipeLocationServer) diff --git a/PoGo.NecroBot.Logic/Tasks/FavoritePokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/FavoritePokemonTask.cs new file mode 100644 index 000000000..091580012 --- /dev/null +++ b/PoGo.NecroBot.Logic/Tasks/FavoritePokemonTask.cs @@ -0,0 +1,43 @@ +#region using directives + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using PoGo.NecroBot.Logic.Common; +using PoGo.NecroBot.Logic.Event; +using PoGo.NecroBot.Logic.PoGoUtils; +using PoGo.NecroBot.Logic.State; + +#endregion + +namespace PoGo.NecroBot.Logic.Tasks +{ + public class FavoritePokemonTask + { + public static async Task Execute(ISession session, CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + + var pokemons = await session.Inventory.GetPokemons(); + + foreach (var pokemon in pokemons) + { + cancellationToken.ThrowIfCancellationRequested(); + + var perfection = Math.Round(PokemonInfo.CalculatePokemonPerfection(pokemon)); + + if (session.LogicSettings.AutoFavoritePokemon && perfection >= session.LogicSettings.FavoriteMinIvPercentage && pokemon.Favorite!=1) + { + await session.Client.Inventory.SetFavoritePokemon(pokemon.Id, true); + + session.EventDispatcher.Send(new NoticeEvent + { + Message = + session.Translation.GetTranslation(TranslationString.PokemonFavorite, perfection, pokemon.PokemonId, pokemon.Cp) + }); + } + } + } + } +} \ No newline at end of file From 40cb81b6273589aa6be48d7929fd8f170c47edd9 Mon Sep 17 00:00:00 2001 From: bornsupercharged Date: Sun, 31 Jul 2016 00:15:15 -0500 Subject: [PATCH 24/25] Added fix for recycling to not happen unless bag capacity is at 95% or greater --- .../Config/Translations/translation.ca.json | 868 +++++++++--------- PoGo.NecroBot.Logic/Inventory.cs | 8 + PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs | 6 + .../Tasks/FarmPokestopsTask.cs | 1 + PoGo.NecroBot.Logic/Tasks/RecycleItemsTask.cs | 4 + 5 files changed, 453 insertions(+), 434 deletions(-) diff --git a/PoGo.NecroBot.CLI/Config/Translations/translation.ca.json b/PoGo.NecroBot.CLI/Config/Translations/translation.ca.json index 4d96449b4..a5713878d 100644 --- a/PoGo.NecroBot.CLI/Config/Translations/translation.ca.json +++ b/PoGo.NecroBot.CLI/Config/Translations/translation.ca.json @@ -1,434 +1,434 @@ -{ - "TranslationStrings": [ - { - "Key": "pokeball", - "Value": "Poké Ball" - }, - { - "Key": "greatPokeball", - "Value": "Super Ball" - }, - { - "Key": "ultraPokeball", - "Value": "Ultra Ball" - }, - { - "Key": "masterPokeball", - "Value": "Master Ball" - }, - { - "Key": "wrongAuthType", - "Value": "AuthType desconegut dins de config.json" - }, - { - "Key": "farmPokestopsOutsideRadius", - "Value": "Ets fora del radi definit! Caminant cap a la posició inicial (a {0}m) en 5 segons. És correcte el teu arxiu Coords.ini?" - }, - { - "Key": "farmPokestopsNoUsableFound", - "Value": "No s'han trobat pokeparades disponibles dins la teva àrea. Has configurat una distància màxima massa petita?" - }, - { - "Key": "eventFortUsed", - "Value": "PX: {0}, Gemmes: {1}, Objectes: {2}" - }, - { - "Key": "eventFortFailed", - "Value": "El desplaçament ha fallat, possible SoftBan. Eliminar SoftBan en: {0}/{1}" - }, - { - "Key": "eventFortTargeted", - "Value": "{0} en ({1}m)" - }, - { - "Key": "eventProfileLogin", - "Value": "Jugant com a {0}" - }, - { - "Key": "eventUsedLuckyEgg", - "Value": "S'ha fet servir un Ou de la Sort. Te'n queden {0}" - }, - { - "Key": "eventPokemonEvolvedSuccess", - "Value": "{0}, obtens {1}px" - }, - { - "Key": "eventPokemonEvolvedFailed", - "Value": "Fallit {0}. El resultat ha estat {1}, parant d'evolucionar {2}" - }, - { - "Key": "eventPokemonTransferred", - "Value": "{0}\t- PC: {1} IV: {2}% [Millor PC: {3} IV: {4}%] (Caramels: {5})" - }, - { - "Key": "eventItemRecycled", - "Value": "{0}x {1}" - }, - { - "Key": "eventPokemonCapture", - "Value": - "({0}) | ({1}) {2} Lvl: {3} PC: ({4}/{5}) IV: {6}% | Prob: {7}% | {8}m dist | amb {9} (queden {10}). | {11}" - }, - { - "Key": "eventNoPokeballs", - "Value": "Sense Pokéballs! - Hem perdut un {0} amb {1} PC :(" - }, - { - "Key": "catchStatusAttempt", - "Value": "{0} Intent #{1}" - }, - { - "Key": "catchStatus", - "Value": "{0}" - }, - { - "Key": "candies", - "Value": "Caramels: {0}" - }, - { - "Key": "unhandledGpxData", - "Value": "Error: Dades de l'arxiu GPX no controlades, intentar ometre." - }, - { - "Key": "displayHighestsHeader", - "Value": "Pokemon" - }, - { - "Key": "commonWordPerfect", - "Value": "perfecte" - }, - { - "Key": "commonWordName", - "Value": "nom" - }, - { - "Key": "commonWordUnknown", - "Value": "Desconegut" - }, - { - "Key": "displayHighestsCpHeader", - "Value": "Pokemon amb més PC" - }, - { - "Key": "displayHighestsPerfectHeader", - "Value": "Pokemon amb més Perfecció" - }, - { - "Key": "displayHighestsLevelHeader", - "Value": "Pokemon amb més Nivell" - }, - { - "Key": "welcomeWarning", - "Value": "Asegura't que la Latitud i la Longitud són correctes. Surt del programa si no és així! Lat: {0} Lng: {1}" - }, - { - "Key": "incubatorPuttingEgg", - "Value": "Afegint ou a la incubadora: {0:0.00}km restants" - }, - { - "Key": "incubatorStatusUpdate", - "Value": "Actualitzant l'estat de la incubadora: {0:0.00}km restants" - }, - { - "Key": "incubatorEggHatched", - "Value": "L'ou incubat ha eclosionat! : {0}" - }, - { - "Key": "logEntryError", - "Value": "ERROR" - }, - { - "Key": "logEntryAttention", - "Value": "ATENCIÓ" - }, - { - "Key": "logEntryInfo", - "Value": "INFO" - }, - { - "Key": "logEntryPokestop", - "Value": "POKEPARADA" - }, - { - "Key": "logEntryFarming", - "Value": "FARMING" - }, - { - "Key": "logEntryRecycling", - "Value": "RECICLATGE" - }, - { - "Key": "logEntryPKMN", - "Value": "PKMN" - }, - { - "Key": "logEntryTransfered", - "Value": "TRANSFERIT" - }, - { - "Key": "logEntryEvolved", - "Value": "EVOLUCIONAR" - }, - { - "Key": "logEntryBerry", - "Value": "BAIA" - }, - { - "Key": "logEntryEgg", - "Value": "OU" - }, - { - "Key": "logEntryDebug", - "Value": "DEBUG" - }, - { - "Key": "logEntryUpdate", - "Value": "ACTUALITZAR" - }, - { - "Key": "loggingIn", - "Value": "Connectat fent servir {0}" - }, - { - "Key": "ptcOffline", - "Value": "Els servidors de PTC probablement han caigut o les teves dades d'accés són incorrectes. Prova amb Google." - }, - { - "Key": "tryingAgainIn", - "Value": "Intentar de nou en {0} segons..." - }, - { - "Key": "accountNotVerified", - "Value": "Compte no verificat! Sortint..." - }, - { - "Key": "openingGoogleDevicePage", - "Value": "Obrint la pàgina de Google Device. Si us plau, enganxa el codi fent servir CTRL+V." - }, - { - "Key": "couldntCopyToClipboard", - "Value": "No s'ha pogut copiar al portpapers, si us plau, fes-ho manualment." - }, - { - "Key": "couldntCopyToClipboard2", - "Value": "Anar: {0} & introduïr {1}" - }, - { - "Key": "realisticTravelDetected", - "Value": "Detectat viatge realista, utilitzant UserSettings.settings" - }, - { - "Key": "notRealisticTravel", - "Value": "Viatge no realista en {0}, utilitzant l'últim Coords.ini memoritzat" - }, - { - "Key": "coordinatesAreInvalid", - "Value": "Les coordenades de \"Coords.ini\" no són correctes, utilizant les coordenades predeterminades" - }, - { - "Key": "gotUpToDateVersion", - "Value": "Perfecte! Ja tens la versió més recent del programa {0}" - }, - { - "Key": "autoUpdaterDisabled", - "Value": "L'AutoUpdater està desactivat. Obtén l'última versió a: {0}\n " - }, - { - "Key": "downloadingUpdate", - "Value": "Descarregant i aplicant l'actualització..." - }, - { - "Key": "finishedDownloadingRelease", - "Value": "Acabada la descàrrega de l'última actualització..." - }, - { - "Key": "finishedUnpackingFiles", - "Value": "Acabat el desempaquetament dels arxius..." - }, - { - "Key": "finishedTransferringConfig", - "Value": "S'ha acabat de transferir la teva configuració a la nova versió..." - }, - { - "Key": "updateFinished", - "Value": "Actualització acabada, ja pots tancar aquesta finestra." - }, - { - "Key": "lookingForIncensePokemon", - "Value": "Buscant encens per a pokemon..." - }, - { - "Key": "lookingForPokemon", - "Value": "Buscant Pokemon..." - }, - { - "Key": "lookingForLurePokemon", - "Value": "Buscant Esquers pokemon..." - }, - { - "Key": "pokemonSkipped", - "Value": "Omès {0}" - }, - { - "Key": "zeroPokeballInv", - "Value": "No tens pokeballs en el teu inventori, no es poden capturar més Pokemon." - }, - { - "Key": "currentPokeballInv", - "Value": "[Inventori Actual] Pokeballs: {0} | Greatballs: {1} | Ultraballs: {2} | Masterballs: {3}" - }, - { - "Key": "checkingForBallsToRecycle", - "Value": "Comprovant si hi ha boles per reciclar, guardant-ne {0}" - }, - { - "Key": "checkingForPotionsToRecycle", - "Value": "Comprovant si hi ha pocions per reciclar, guardant-ne {0}" - }, - { - "Key": "checkingForRevivesToRecycle", - "Value": "Comprovant si hi ha reviures per reciclar, guardant-ne {0}" - }, - { - "Key": "pokeballsToKeepIncorrect", - "Value": "L'opció TotalAmountOfPokebalsToKeep ha estat configurada incorrectament. El nombre és menor que 1." - }, - { - "Key": "potionsToKeepIncorrect", - "Value": "L'opció TotalAmountOfPotionsToKeep ha estat configurada incorrectament. El nombre és menor que 1" - }, - { - "Key": "revivesToKeepIncorrect", - "Value": "L'opció TotalAmountOfRevivesToKeep ha estat configurada incorrectament. El nombre és menor que 1" - }, - { - "Key": "invFullTransferring", - "Value": "L'inventari de pokemons està ple. Transferir pokemons..." - }, - { - "Key": "invFullTransferManually", - "Value": "L'inventari de pokemons està ple. Si us plau, transfereix els pokemons manualment o activa l'opció TransferDuplicatePokemon dins l'arxiu de Configuració posant-la com a (True)..." - }, - { - "Key": "invFullPokestopLooting", - "Value": "L'inventari està ple, no s'ha pogut lootejar res :(" - }, - { - "Key": "encounterProblem", - "Value": "S'ha trobat un nou problema: {0}" - }, - { - "Key": "encounterProblemLurePokemon", - "Value": "S'ha trobat un problema: Esquer pokemon {0}" - }, - { - "Key": "desiredDestTooFar", - "Value": "La destinació desitjada {0}, {1} està massa lluny de la teva posició actual {2}, {3}" - }, - { - "Key": "pokemonRename", - "Value": "Pokemon {0} ({1}) reanomenat de {2} a {3}." - }, - { - "Key": "pokemonIgnoreFilter", - "Value": "[Filtre de Pokemons Ignorats] - Ignorant {0} tal i com s'ha definit en la configuració actual." - }, - { - "Key": "catchStatusAttempt", - "Value": "Intent de Captura" - }, - { - "Key": "catchStatusError", - "Value": "Error de Captura" - }, - { - "Key": "catchStatusEscape", - "Value": "Captura Fallida" - }, - { - "Key": "catchStatusFlee", - "Value": "Fugida" - }, - { - "Key": "catchStatusMissed", - "Value": "Captures Perdudes" - }, - { - "Key": "catchStatusSuccess", - "Value": "Captura Exitosa" - }, - { - "Key": "catchTypeNormal", - "Value": "Normal" - }, - { - "Key": "catchTypeLure", - "Value": "Esquer" - }, - { - "Key": "catchTypeIncense", - "Value": "Encens" - }, - { - "Key": "webSocketFailStart", - "Value": "No s'ha pogut iniciar WebSocketServer en el port: {0}" - }, - { - "Key": "statsTemplateString", - "Value": - "{0} - Actiu {1} - Nivell: {2} | EXP/H: {3:0} | P/H: {4:0} | P.Estel·lar: {5:0} | Transferit: {6:0} | Reciclat: {7:0}" - }, - { - "Key": "statsXpTemplateString", - "Value": "{0} (proper nivell en {1}h {2}m | {3}/{4} XP)" - }, - { - "Key": "requireInputText", - "Value": "El programa continuarà després de premer una tecla..." - }, - { - "Key": "googleTwoFactorAuth", - "Value": "Com tens habilitada l'autenticació de Google en 2 passos, hauràs d'inserir una contrasenya específica de l'APP dins de l'arxiu auth.json" - }, - { - "Key": "googleTwoFactorAuthExplanation", - "Value": "Obrint Google App-Passwords. Si us plau, crea una nova contrasenya en l'APP (utilitzar en un altre dispositiu)" - }, - { - "Key": "googleError", - "Value": "Assegura't d'haver introduit el correu electrònic i contrasenya correctes." - }, - { - "Key": "missingCredentialsGoogle", - "Value": "És necessari omplir els camps GoogleUsername i GooglePassword a l'arxiu auth.json!" - }, - { - "Key": "missingCredentialsPtc", - "Value": "És necessari omplir els camps PtcUsername i PtcPassword a l'arxiu auth.json!" - }, - { - "Key": "snipeScan", - "Value": "[Sniper] Escanejant {0} en busca de Pokemons..." - }, - { - "Key": "snipeScanEx", - "Value": "[Sniper] Snipejant a {0} amb {1} IV a {2}..." - }, - { - "Key": "noPokemonToSnipe", - "Value": "[Sniper] No s'han trobat Pokemons :(" - }, - { - "Key": "notEnoughPokeballsToSnipe", - "Value": "No hi ha suficients Pokeballs per a iniciar l'Sniping! ({0}/{1})" - }, - { - "Key": "displayHighestMOVE1Header", - "Value": "MOVIMENT1" - }, - { - "Key": "displayHighestMOVE2Header", - "Value": "MOVIMENT2" - } - ] -} +{ + "TranslationStrings": [ + { + "Key": "pokeball", + "Value": "Poké Ball" + }, + { + "Key": "greatPokeball", + "Value": "Super Ball" + }, + { + "Key": "ultraPokeball", + "Value": "Ultra Ball" + }, + { + "Key": "masterPokeball", + "Value": "Master Ball" + }, + { + "Key": "wrongAuthType", + "Value": "AuthType desconegut dins de config.json" + }, + { + "Key": "farmPokestopsOutsideRadius", + "Value": "Ets fora del radi definit! Caminant cap a la posició inicial (a {0}m) en 5 segons. És correcte el teu arxiu Coords.ini?" + }, + { + "Key": "farmPokestopsNoUsableFound", + "Value": "No s'han trobat pokeparades disponibles dins la teva àrea. Has configurat una distància màxima massa petita?" + }, + { + "Key": "eventFortUsed", + "Value": "PX: {0}, Gemmes: {1}, Objectes: {2}" + }, + { + "Key": "eventFortFailed", + "Value": "El desplaçament ha fallat, possible SoftBan. Eliminar SoftBan en: {0}/{1}" + }, + { + "Key": "eventFortTargeted", + "Value": "{0} en ({1}m)" + }, + { + "Key": "eventProfileLogin", + "Value": "Jugant com a {0}" + }, + { + "Key": "eventUsedLuckyEgg", + "Value": "S'ha fet servir un Ou de la Sort. Te'n queden {0}" + }, + { + "Key": "eventPokemonEvolvedSuccess", + "Value": "{0}, obtens {1}px" + }, + { + "Key": "eventPokemonEvolvedFailed", + "Value": "Fallit {0}. El resultat ha estat {1}, parant d'evolucionar {2}" + }, + { + "Key": "eventPokemonTransferred", + "Value": "{0}\t- PC: {1} IV: {2}% [Millor PC: {3} IV: {4}%] (Caramels: {5})" + }, + { + "Key": "eventItemRecycled", + "Value": "{0}x {1}" + }, + { + "Key": "eventPokemonCapture", + "Value": + "({0}) | ({1}) {2} Lvl: {3} PC: ({4}/{5}) IV: {6}% | Prob: {7}% | {8}m dist | amb {9} (queden {10}). | {11}" + }, + { + "Key": "eventNoPokeballs", + "Value": "Sense Pokéballs! - Hem perdut un {0} amb {1} PC :(" + }, + { + "Key": "catchStatusAttempt", + "Value": "{0} Intent #{1}" + }, + { + "Key": "catchStatus", + "Value": "{0}" + }, + { + "Key": "candies", + "Value": "Caramels: {0}" + }, + { + "Key": "unhandledGpxData", + "Value": "Error: Dades de l'arxiu GPX no controlades, intentar ometre." + }, + { + "Key": "displayHighestsHeader", + "Value": "Pokemon" + }, + { + "Key": "commonWordPerfect", + "Value": "perfecte" + }, + { + "Key": "commonWordName", + "Value": "nom" + }, + { + "Key": "commonWordUnknown", + "Value": "Desconegut" + }, + { + "Key": "displayHighestsCpHeader", + "Value": "Pokemon amb més PC" + }, + { + "Key": "displayHighestsPerfectHeader", + "Value": "Pokemon amb més Perfecció" + }, + { + "Key": "displayHighestsLevelHeader", + "Value": "Pokemon amb més Nivell" + }, + { + "Key": "welcomeWarning", + "Value": "Asegura't que la Latitud i la Longitud són correctes. Surt del programa si no és així! Lat: {0} Lng: {1}" + }, + { + "Key": "incubatorPuttingEgg", + "Value": "Afegint ou a la incubadora: {0:0.00}km restants" + }, + { + "Key": "incubatorStatusUpdate", + "Value": "Actualitzant l'estat de la incubadora: {0:0.00}km restants" + }, + { + "Key": "incubatorEggHatched", + "Value": "L'ou incubat ha eclosionat! : {0}" + }, + { + "Key": "logEntryError", + "Value": "ERROR" + }, + { + "Key": "logEntryAttention", + "Value": "ATENCIÓ" + }, + { + "Key": "logEntryInfo", + "Value": "INFO" + }, + { + "Key": "logEntryPokestop", + "Value": "POKEPARADA" + }, + { + "Key": "logEntryFarming", + "Value": "FARMING" + }, + { + "Key": "logEntryRecycling", + "Value": "RECICLATGE" + }, + { + "Key": "logEntryPKMN", + "Value": "PKMN" + }, + { + "Key": "logEntryTransfered", + "Value": "TRANSFERIT" + }, + { + "Key": "logEntryEvolved", + "Value": "EVOLUCIONAR" + }, + { + "Key": "logEntryBerry", + "Value": "BAIA" + }, + { + "Key": "logEntryEgg", + "Value": "OU" + }, + { + "Key": "logEntryDebug", + "Value": "DEBUG" + }, + { + "Key": "logEntryUpdate", + "Value": "ACTUALITZAR" + }, + { + "Key": "loggingIn", + "Value": "Connectat fent servir {0}" + }, + { + "Key": "ptcOffline", + "Value": "Els servidors de PTC probablement han caigut o les teves dades d'accés són incorrectes. Prova amb Google." + }, + { + "Key": "tryingAgainIn", + "Value": "Intentar de nou en {0} segons..." + }, + { + "Key": "accountNotVerified", + "Value": "Compte no verificat! Sortint..." + }, + { + "Key": "openingGoogleDevicePage", + "Value": "Obrint la pàgina de Google Device. Si us plau, enganxa el codi fent servir CTRL+V." + }, + { + "Key": "couldntCopyToClipboard", + "Value": "No s'ha pogut copiar al portpapers, si us plau, fes-ho manualment." + }, + { + "Key": "couldntCopyToClipboard2", + "Value": "Anar: {0} & introduïr {1}" + }, + { + "Key": "realisticTravelDetected", + "Value": "Detectat viatge realista, utilitzant UserSettings.settings" + }, + { + "Key": "notRealisticTravel", + "Value": "Viatge no realista en {0}, utilitzant l'últim Coords.ini memoritzat" + }, + { + "Key": "coordinatesAreInvalid", + "Value": "Les coordenades de \"Coords.ini\" no són correctes, utilizant les coordenades predeterminades" + }, + { + "Key": "gotUpToDateVersion", + "Value": "Perfecte! Ja tens la versió més recent del programa {0}" + }, + { + "Key": "autoUpdaterDisabled", + "Value": "L'AutoUpdater està desactivat. Obtén l'última versió a: {0}\n " + }, + { + "Key": "downloadingUpdate", + "Value": "Descarregant i aplicant l'actualització..." + }, + { + "Key": "finishedDownloadingRelease", + "Value": "Acabada la descàrrega de l'última actualització..." + }, + { + "Key": "finishedUnpackingFiles", + "Value": "Acabat el desempaquetament dels arxius..." + }, + { + "Key": "finishedTransferringConfig", + "Value": "S'ha acabat de transferir la teva configuració a la nova versió..." + }, + { + "Key": "updateFinished", + "Value": "Actualització acabada, ja pots tancar aquesta finestra." + }, + { + "Key": "lookingForIncensePokemon", + "Value": "Buscant encens per a pokemon..." + }, + { + "Key": "lookingForPokemon", + "Value": "Buscant Pokemon..." + }, + { + "Key": "lookingForLurePokemon", + "Value": "Buscant Esquers pokemon..." + }, + { + "Key": "pokemonSkipped", + "Value": "Omès {0}" + }, + { + "Key": "zeroPokeballInv", + "Value": "No tens pokeballs en el teu inventori, no es poden capturar més Pokemon." + }, + { + "Key": "currentPokeballInv", + "Value": "[Inventori Actual] Pokeballs: {0} | Greatballs: {1} | Ultraballs: {2} | Masterballs: {3}" + }, + { + "Key": "checkingForBallsToRecycle", + "Value": "Comprovant si hi ha boles per reciclar, guardant-ne {0}" + }, + { + "Key": "checkingForPotionsToRecycle", + "Value": "Comprovant si hi ha pocions per reciclar, guardant-ne {0}" + }, + { + "Key": "checkingForRevivesToRecycle", + "Value": "Comprovant si hi ha reviures per reciclar, guardant-ne {0}" + }, + { + "Key": "pokeballsToKeepIncorrect", + "Value": "L'opció TotalAmountOfPokebalsToKeep ha estat configurada incorrectament. El nombre és menor que 1." + }, + { + "Key": "potionsToKeepIncorrect", + "Value": "L'opció TotalAmountOfPotionsToKeep ha estat configurada incorrectament. El nombre és menor que 1" + }, + { + "Key": "revivesToKeepIncorrect", + "Value": "L'opció TotalAmountOfRevivesToKeep ha estat configurada incorrectament. El nombre és menor que 1" + }, + { + "Key": "invFullTransferring", + "Value": "L'inventari de pokemons està ple. Transferir pokemons..." + }, + { + "Key": "invFullTransferManually", + "Value": "L'inventari de pokemons està ple. Si us plau, transfereix els pokemons manualment o activa l'opció TransferDuplicatePokemon dins l'arxiu de Configuració posant-la com a (True)..." + }, + { + "Key": "invFullPokestopLooting", + "Value": "L'inventari està ple, no s'ha pogut lootejar res :(" + }, + { + "Key": "encounterProblem", + "Value": "S'ha trobat un nou problema: {0}" + }, + { + "Key": "encounterProblemLurePokemon", + "Value": "S'ha trobat un problema: Esquer pokemon {0}" + }, + { + "Key": "desiredDestTooFar", + "Value": "La destinació desitjada {0}, {1} està massa lluny de la teva posició actual {2}, {3}" + }, + { + "Key": "pokemonRename", + "Value": "Pokemon {0} ({1}) reanomenat de {2} a {3}." + }, + { + "Key": "pokemonIgnoreFilter", + "Value": "[Filtre de Pokemons Ignorats] - Ignorant {0} tal i com s'ha definit en la configuració actual." + }, + { + "Key": "catchStatusAttempt", + "Value": "Intent de Captura" + }, + { + "Key": "catchStatusError", + "Value": "Error de Captura" + }, + { + "Key": "catchStatusEscape", + "Value": "Captura Fallida" + }, + { + "Key": "catchStatusFlee", + "Value": "Fugida" + }, + { + "Key": "catchStatusMissed", + "Value": "Captures Perdudes" + }, + { + "Key": "catchStatusSuccess", + "Value": "Captura Exitosa" + }, + { + "Key": "catchTypeNormal", + "Value": "Normal" + }, + { + "Key": "catchTypeLure", + "Value": "Esquer" + }, + { + "Key": "catchTypeIncense", + "Value": "Encens" + }, + { + "Key": "webSocketFailStart", + "Value": "No s'ha pogut iniciar WebSocketServer en el port: {0}" + }, + { + "Key": "statsTemplateString", + "Value": + "{0} - Actiu {1} - Nivell: {2} | EXP/H: {3:0} | P/H: {4:0} | P.Estel·lar: {5:0} | Transferit: {6:0} | Reciclat: {7:0}" + }, + { + "Key": "statsXpTemplateString", + "Value": "{0} (proper nivell en {1}h {2}m | {3}/{4} XP)" + }, + { + "Key": "requireInputText", + "Value": "El programa continuarà després de premer una tecla..." + }, + { + "Key": "googleTwoFactorAuth", + "Value": "Com tens habilitada l'autenticació de Google en 2 passos, hauràs d'inserir una contrasenya específica de l'APP dins de l'arxiu auth.json" + }, + { + "Key": "googleTwoFactorAuthExplanation", + "Value": "Obrint Google App-Passwords. Si us plau, crea una nova contrasenya en l'APP (utilitzar en un altre dispositiu)" + }, + { + "Key": "googleError", + "Value": "Assegura't d'haver introduit el correu electrònic i contrasenya correctes." + }, + { + "Key": "missingCredentialsGoogle", + "Value": "És necessari omplir els camps GoogleUsername i GooglePassword a l'arxiu auth.json!" + }, + { + "Key": "missingCredentialsPtc", + "Value": "És necessari omplir els camps PtcUsername i PtcPassword a l'arxiu auth.json!" + }, + { + "Key": "snipeScan", + "Value": "[Sniper] Escanejant {0} en busca de Pokemons..." + }, + { + "Key": "snipeScanEx", + "Value": "[Sniper] Snipejant a {0} amb {1} IV a {2}..." + }, + { + "Key": "noPokemonToSnipe", + "Value": "[Sniper] No s'han trobat Pokemons :(" + }, + { + "Key": "notEnoughPokeballsToSnipe", + "Value": "No hi ha suficients Pokeballs per a iniciar l'Sniping! ({0}/{1})" + }, + { + "Key": "displayHighestMOVE1Header", + "Value": "MOVIMENT1" + }, + { + "Key": "displayHighestMOVE2Header", + "Value": "MOVIMENT2" + } + ] +} diff --git a/PoGo.NecroBot.Logic/Inventory.cs b/PoGo.NecroBot.Logic/Inventory.cs index b425e48c4..edb3a701d 100644 --- a/PoGo.NecroBot.Logic/Inventory.cs +++ b/PoGo.NecroBot.Logic/Inventory.cs @@ -224,6 +224,14 @@ public async Task> GetItems() .Where(p => p != null); } + public async Task GetTotalItemCount() + { + var myItems = (await GetItems()).ToList(); + int myItemCount = 0; + foreach (var myItem in myItems) myItemCount += myItem.Count; + return myItemCount; + } + public async Task> GetItemsToRecycle(ISession session) { var itemsToRecylce = new List(); diff --git a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs index c7128c81c..337b62436 100644 --- a/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/CatchPokemonTask.cs @@ -200,6 +200,12 @@ private static async Task GetBestBall(ISession session, dynamic encounte if (pokeBallsCount > 0) return ItemId.ItemPokeBall; + if (greatBallsCount > 0) + return ItemId.ItemGreatBall; + if (ultraBallsCount > 0) + return ItemId.ItemUltraBall; + if (masterBallsCount > 0 && !session.LogicSettings.PokemonToUseMasterball.Any()) + return ItemId.ItemMasterBall; return ItemId.ItemUnknown; } diff --git a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs index 84068bc5c..c4757ae04 100644 --- a/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/FarmPokestopsTask.cs @@ -162,6 +162,7 @@ await session.Navigation.HumanLikeWalking(new GeoCoordinate(pokeStop.Latitude, p { await session.Inventory.RefreshCachedInventory(); } + await RecycleItemsTask.Execute(session, cancellationToken); if (session.LogicSettings.EvolveAllPokemonWithEnoughCandy || diff --git a/PoGo.NecroBot.Logic/Tasks/RecycleItemsTask.cs b/PoGo.NecroBot.Logic/Tasks/RecycleItemsTask.cs index 3b33e5ecd..ed79228ab 100644 --- a/PoGo.NecroBot.Logic/Tasks/RecycleItemsTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/RecycleItemsTask.cs @@ -16,6 +16,10 @@ public static async Task Execute(ISession session, CancellationToken cancellatio { cancellationToken.ThrowIfCancellationRequested(); + var currentTotalItems = await session.Inventory.GetTotalItemCount(); + if ((session.Profile.PlayerData.MaxItemStorage*.95) > currentTotalItems) + return; + var items = await session.Inventory.GetItemsToRecycle(session); foreach (var item in items) From 81208268b7d1da2487f7c6f6c4bd8721e2f441bb Mon Sep 17 00:00:00 2001 From: bornsupercharged Date: Sun, 31 Jul 2016 09:09:41 -0500 Subject: [PATCH 25/25] Made recycling a configurable inventory usage percentage --- PoGo.NecroBot.Logic/ILogicSettings.cs | 1 + PoGo.NecroBot.Logic/Settings.cs | 3 ++- PoGo.NecroBot.Logic/Tasks/RecycleItemsTask.cs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/PoGo.NecroBot.Logic/ILogicSettings.cs b/PoGo.NecroBot.Logic/ILogicSettings.cs index 8c7f69e83..b40b05d08 100644 --- a/PoGo.NecroBot.Logic/ILogicSettings.cs +++ b/PoGo.NecroBot.Logic/ILogicSettings.cs @@ -120,6 +120,7 @@ public interface ILogicSettings int TotalAmountOfPotionsToKeep { get; } int TotalAmountOfRevivesToKeep { get; } + double RecycleInventoryAtUsagePercentage { get; } ICollection> ItemRecycleFilter { get; } ICollection PokemonsToEvolve { get; } diff --git a/PoGo.NecroBot.Logic/Settings.cs b/PoGo.NecroBot.Logic/Settings.cs index 86f8c8356..4773f4e2b 100644 --- a/PoGo.NecroBot.Logic/Settings.cs +++ b/PoGo.NecroBot.Logic/Settings.cs @@ -117,7 +117,7 @@ public class GlobalSettings public string GpxFile = "GPXPath.GPX"; - + public double RecycleInventoryAtUsagePercentage = 0.90; public List> ItemRecycleFilter = new List> { new KeyValuePair(ItemId.ItemUnknown, 0), @@ -620,6 +620,7 @@ public LogicSettings(GlobalSettings settings) public int AmountOfPokemonToDisplayOnStart => _settings.AmountOfPokemonToDisplayOnStart; public bool DumpPokemonStats => _settings.DumpPokemonStats; public string TranslationLanguageCode => _settings.TranslationLanguageCode; + public double RecycleInventoryAtUsagePercentage => _settings.RecycleInventoryAtUsagePercentage; public ICollection> ItemRecycleFilter => _settings.ItemRecycleFilter; public ICollection PokemonsToEvolve => _settings.PokemonsToEvolve; public ICollection PokemonsNotToTransfer => _settings.PokemonsNotToTransfer; diff --git a/PoGo.NecroBot.Logic/Tasks/RecycleItemsTask.cs b/PoGo.NecroBot.Logic/Tasks/RecycleItemsTask.cs index 09948aada..e7115aa96 100644 --- a/PoGo.NecroBot.Logic/Tasks/RecycleItemsTask.cs +++ b/PoGo.NecroBot.Logic/Tasks/RecycleItemsTask.cs @@ -18,7 +18,7 @@ public static async Task Execute(ISession session, CancellationToken cancellatio cancellationToken.ThrowIfCancellationRequested(); var currentTotalItems = await session.Inventory.GetTotalItemCount(); - if ((session.Profile.PlayerData.MaxItemStorage*.95) > currentTotalItems) + if ((session.Profile.PlayerData.MaxItemStorage * session.LogicSettings.RecycleInventoryAtUsagePercentage) > currentTotalItems) return; var items = await session.Inventory.GetItemsToRecycle(session);