diff --git a/pgo-automat-settings.properties b/pgo-automat-settings.properties index a2f9984..3cc2b0b 100644 --- a/pgo-automat-settings.properties +++ b/pgo-automat-settings.properties @@ -1,12 +1,12 @@ #Pokmon GO Automatizace - Nastaven -#Thu Dec 04 16:03:55 CET 2025 +#Mon Dec 08 13:05:40 CET 2025 autoklik.count=500 window.width=807 transfer.delay=0 window.height=743 autoklik.x=2380 autoklik.y=1124 -transfer.count=30 -window.x=930 +transfer.count=12 +window.x=866 autoklik.interval=100 -window.y=22 +window.y=237 diff --git a/pgo.png b/pgo.png index f2801e6..4c9a3b8 100644 Binary files a/pgo.png and b/pgo.png differ diff --git a/src/main/java/com/pokemongo/PokemonGoAutomation.java b/src/main/java/com/pokemongo/PokemonGoAutomation.java index ac71572..b2b9958 100644 --- a/src/main/java/com/pokemongo/PokemonGoAutomation.java +++ b/src/main/java/com/pokemongo/PokemonGoAutomation.java @@ -26,8 +26,8 @@ public class PokemonGoAutomation { private BufferedImage t2Template; // Confirmation button template private BufferedImage pok1Template; // Pokemon detection template private BufferedImage includeTemplate; // Include button template - private static final int DELAY_BETWEEN_CLICKS = 200; // ms - private static final int DELAY_AFTER_ACTION = 500; // ms + private static final int DELAY_BETWEEN_CLICKS = 100; // ms + private static final int DELAY_AFTER_ACTION = 100; // ms private int transferredPokemonCount = 0; // Počet transfernutých pokémonů public PokemonGoAutomation() throws AWTException { @@ -162,7 +162,7 @@ public class PokemonGoAutomation { * Hledá v oblasti od vrchu obrazovky do 75% výšky * Může najít až 9 Pokémonů */ - private List detectPokemonsByTemplateMatching() { + private List detectPokemonsByTemplateMatching2() { List positions = new ArrayList<>(); System.out.println("\n=== Detekce Pokémonů pomocí template matchingu (pok1.png) ==="); @@ -561,7 +561,7 @@ public class PokemonGoAutomation { return; } - int pokemonThisRound = Math.min(9, totalPokemonCount - transferredCount); + int pokemonThisRound = Math.min(12, totalPokemonCount - transferredCount); System.out.println("\n=== Iterace " + (transferredCount / 9 + 1) + " - Transferuji maximálně " + pokemonThisRound + " pokémonů ==="); @@ -610,7 +610,7 @@ public class PokemonGoAutomation { private int selectAllPokemonCount(int count) { System.out.println("Začínám označovat " + count + " pokémonů (pouze template matching)..."); - List positions = detectPokemonsByTemplateMatching(); + List positions = getPossitionsAbsolute(); int maxPokemon = Math.min(count, positions.size()); System.out.println("Budu označovat " + maxPokemon + " pokémonů..."); @@ -622,10 +622,9 @@ public class PokemonGoAutomation { robot.mouseMove(pos.x, pos.y); if (i == 0) { - robot.delay(500); System.out.println(" -> Dlouhé podržení (aktivace multi-select)"); robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); - robot.delay(800); + robot.delay(600); robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.delay(DELAY_AFTER_ACTION); } else { @@ -644,6 +643,39 @@ public class PokemonGoAutomation { return maxPokemon; } + private List getPossitionsAbsolute() { + List possitions = new ArrayList<>(); + + possitions.add(getAbsolutePoint(115, 240)); + possitions.add(getAbsolutePoint(307, 240)); + possitions.add(getAbsolutePoint(496, 240)); + + possitions.add(getAbsolutePoint(115, 460)); + possitions.add(getAbsolutePoint(307, 460)); + possitions.add(getAbsolutePoint(496, 460)); + + possitions.add(getAbsolutePoint(115, 680)); + possitions.add(getAbsolutePoint(307, 680)); + possitions.add(getAbsolutePoint(496, 680)); + + possitions.add(getAbsolutePoint(115, 900)); + possitions.add(getAbsolutePoint(307, 900)); + possitions.add(getAbsolutePoint(496, 900)); + return possitions; + } + + /** + * Převede relativní pozici v okně (0.0-1.0) na absolutní souřadnice obrazovky + * @param relativeX Relativní X pozice (0.0 = levý okraj, 1.0 = pravý okraj) + * @param relativeY Relativní Y pozice (0.0 = horní okraj, 1.0 = dolní okraj) + * @return Absolutní pozice na obrazovce + */ + private Point getAbsolutePoint(int relativeX, int relativeY) { + int absoluteX = windowBounds.x + relativeX; + int absoluteY = windowBounds.y + relativeY; + return new Point(absoluteX, absoluteY); + } + public static void main(String[] args) { System.out.println("=== Pokémon GO Automatizační Nástroj ==="); System.out.println("Ujistěte se, že je aplikace Pokémon GO spuštěná...");