Azelphur / PokemonGo-CalcyIV-Renamer

Uses adb to send fake tap events to your phone, alongside Calcy IV to automatically rename all your pokemon.
GNU General Public License v3.0
77 stars 32 forks source link

For support, development, shenanigans: check out the Discord.

This project is old/dead

I don't play Pokemon GO anymore (and haven't for a long time) - thus this code hasn't been updated for changes in the game. It probably doesn't work any more. I'll leave the code here though, as it's something that could totally be fixed up by someone who has an interest in doing so. If you do fix it, file an issue and I'll put a link to your fork here.

Description

This is a small script which uses adb to send touch and key events to your phone, in combination with Calcy IV it can automatically rename all of your pokémon. This script doesn't login to the pokémon go servers using the "unofficial API" and only relies on an Android phone (sorry, iPhone users). The upside to this is that you're very unlikely to get banned for using it. The downside is that it's a lot slower, and that you can't use your phone while it's running.

Warnings

This script essentially blindly sends touch events to your phone. If a popup appears over where the script thinks a button is, or if your phone lags, it can do unintended things. Please keep an eye on your phone while it is running. If it transfers your shiny 100% Dragonite, it's because you weren't watching it.

Installation

Prerequisites

You only need to perform this steps once

Configuration

You only need to perform this steps once

Usage

Basic Usage

That's it! :D

Rulesets

Rulesets allow you to define new ways of renaming your pokémon, outside of the usual Calcy IV renaming scheme. Rulesets are processed from first to last, and the first one to have all its conditions pass is used.

Conditions:

Conditions also support the following operators:

Actions:

Ruleset Examples

Check docs/actions for fully featured examples. Also, check ACTIONS.md for a sorting table of special characters, for those who'd like to sort by A-Z in a custom order.

  1. Faster rename run by skipping renaming pokémons with less than 90% IVs. Rename any pokémon that failed to scan as ".FAILED" so you know which ones failed to scan, and which ones are skipped as trash.

    actions:
      - conditions:
          success: false
        actions:
          rename: ".FAILED"
      - conditions:
          iv_max__ge: 90
        actions:
          rename: "{calcy}"
  2. Rename bad IV Abra, Gastly and Machop to ".TRADE" so you can trade them later.

    actions:
      - conditions:
          name__in:
              - Abra
              - Gastly
              - Machop
          iv_max__lt: 90
          actions:
          rename: ".TRADE"
  3. Rename babies pokémons with a custom syntax, bypassing Calcy's renaming scheme. A 78IV Magby would become "♥ Magby78".

    actions:
      - conditions:
          name__in:
            - Pichu
            - Togepi
            - Igglybuff
            - Cleffa
            - Elekid
            - Smoochum
            - Magby
            - Budew
            - Wynaut
            - Tyrogue
            - Azurill
        actions:
          rename: "♥ {name}{iv_avg}"

(now, a decent) FAQ

  1. It taps in the wrong locations / doesn't work / automatically called my mother:

    You probably need to edit the locations: in config.yaml, the defaults are for a 1080p phone. You can find where the spots are supposed to be in docs/locations!

    To find out the coordinates, enable Pointer Location in your phone's Developer Settings. If you're lazy like me, just type the code below with your phone connected:

    • To enable:

      adb shell content insert --uri content://settings/system --bind name:s:pointer_location --bind value:i:1
          # If that doesn't work, use this:
      adb shell settings put system pointer_location 1
    • To disable

      adb shell content insert --uri content://settings/system --bind name:s:pointer_location --bind value:i:0
          # If that doesn't work, use this:
      adb shell settings put system pointer_location 0
  2. It's not pasting the pokémon's name!

    Unfortunately, the paste key event doesn't work on older versions of Android. Use the --nopaste argument to paste it by tapping (make sure you edit the locations: accordingly).

  3. It's going too fast for my phone! :O

    This is being developed and tested on a OnePlus 3T and a Google Pixel, so the script runs quite fast (until the phone gets hot, that is). You can slow it down by increasing the waits: in config.yaml.

  4. Can it do multiple phones at the same time?

    Sure, you just have to run multiple instances. Run adb devices to get the device ids for your phones, then run multiple instances of the script with --device_id=XXXXX.

  5. I don't quite get the --copy-calcy thingamabove...