Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
212 lines (149 sloc) 9.12 KB

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

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 these steps once

  1. Download all the files from this repository. Unzip everything into a directory.

  2. Install adb, and make sure it's on your system's PATH.

    Windows users can install the SDK Platform Tools via this link.

  3. Install clipper in your device and run the app/service.

  4. Install Python >=3.7 (older versions will not work).

    Windows users can go here and select Download Windows x86-64 executable installer under Stable Releases.

  5. Now, open a terminal in the repository directory you unzipped in step 1.

    Windows users can open a command prompt inside the folder (hover the link for TL;DR).

  6. Run pip install -r requirements.txt to install the required libraries for the script to work.

Configuration

You only need to perform these steps once

  • Copy or rename config.example.yaml to config.yaml.

  • Enable USB Debugging in Settings > Developer options in your device, and connect it to the computer.

  • In the command prompt, type adb devices -l and see if it properly detects the device.

  • Run python ivcheck.py --copy-calcy. This will copy into your device clipboard the renaming string the script needs to function.

  • In your device, open CalcyIV -> Renaming, go to the end of both your renaming strings and Paste. Check out the GIF in the FAQ if you're a bit confused.

    Don't worry! This will add a bunch of elements to the end of your renaming string and it's gonna look very funky. However, as PoGo's limit is 12 chars, when you rename a pokémon those elements are going to get stripped, making sure both manual pasting and the renamer will work just fine.

  • Edit config.yaml locations for your phone:

    • The defaults are for a Oneplus 3T and should work with any 1080p phone that does not have soft buttons.
    • Each setting is an X,Y location. You can turn on Settings > Developer options > Pointer location to assist you in gathering X,Y locations or run the code on question 1 in the FAQ.
    • Each location setting has a corresponding screenshot in docs/locations.
  • You're done! Move on to the next section Basic Usage whenever you want to use the renamer.

Usage

Basic Usage

  • Connect your device to the computer.
  • Open PoGo and CalcyIV.
  • Go to a pokémon screen, and run: python ivcheck.py

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:

  • name: The pokémon name.

  • iv: The exact IV

    Note: this will only be set if Calcy IV has discovered an exact IV. Use iv_avg for a solution.

  • iv_avg: The average between iv_min and iv_max below.

    Note: This is not the true average, Calcy is a bit smarter, but it works.

  • iv_min: The minimum possible IV.

    This will be set even if Calcy IV pulls an exact IV

  • iv_max: The maximum possible IV.

    This will be set even if Calcy IV pulls an exact IV

  • success: Whether the calcy IV scan succeeded [true / false].

    Note: Will be false if pokémon is blacklisted

  • blacklist: Whether the pokémon is in the blacklist [true / false].

  • appraised: Whether the pokémon has been appraised or not [true / false].

  • id: The pokémon pokedex ID.

  • cp: The pokémon CP.

  • max_hp: The pokémon max hp.

  • dust_cost: The dust cost to power up.

  • level: The pokémon level [1-40]

  • fast_move: The pokémon fast move.

    Usually only visible on fully evolved pokémon

  • special_move: The pokémon special/charged move.

    Usually only visible on fully evolved pokémon

  • gender: The pokémon gender [1 = male / 2 = female].

Conditions also support the following operators:

  • lt: Less than
  • le: Less than or equal to
  • eq: Equal to
  • ne: Not equal to
  • ge: Greater than or equal to
  • gt: Greater than
  • in: In list
  • not_in: Not in list

Actions:

  • rename: "string"

    Allows you to specify your own name for the pokémon.

    • The {calcy} variable uses the renaming scheme you defined on CalcyIV.

    • In addition, you can use any of the above conditions as variables, for example {name} {iv}.

  • favorite:

    Favorite the pokémon

  • appraise:

    Appraise the pokémon

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 without soft keys. 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 --touch-paste 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...

You can’t perform that action at this time.