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

When CalcyIV doesn't find the arc-point, the previous clipboard bypasses the renamer as if it was a successful scan #23

Closed esauvisky closed 5 years ago

esauvisky commented 5 years ago

The title says it all. Very easy to fix.

We can either:

See persistent_clipboard_bug.log for an example with Kangaskhan, one that scans successfully and one that has the arc-point exactly besides its head.

The first solution looks more robust to me, but has the drawback of being more resource-intensive (i.e.: slower), the second solution follows the current implementation and is ridiculously easy to implement.

What do you think?

esauvisky commented 5 years ago

Just realized the script already checks for -1 on the RE_CALCY_IV's values["level"], and the issue seems intermittent.

I've managed to catch one log were it works once and fails on the next attempt, with a print(values) on success (unfortunately I've messed up and didn't add a print(values) before the check, so the first fail that actually was detected didn't print the values list, but I'm sure it was exactly the same).

:thinking:

scottarrr commented 5 years ago

I've been able to reproduce this.

I think this pulls '-1.0' type values for the level. I think it should be -1? Could be updated in the regex to grab only the integer string part maybe. I put together some spaghetti that seemed to work for me anyway with:

if '-1' in [values["cp"], values["level"]] or '-1.0' in [values["cp"], values["level"]]:

Here's what I got for the vals it incorrectly considered a successful scan {'name': 'Wailmer', 'id': '320', 'cp': '-1', 'max_hp': '150', 'dust_cost': '2200', 'level': '-1.0', 'fast_move': 'err', 'special_move': 'err', 'gender': '1', 'success': False, 'blacklist': False, 'appraised': False}

----edit---- I somehow managed to copy a bad test above. Here is a better example:

{'name': 'Wailmer', 'id': '320', 'cp': '602', 'max_hp': '142', 'dust_cost': '1900', 'level': '-1.0', 'fast_move': 'err', 'special_move': 'err', 'gender': '1', 'success': True, 'blacklist': False, 'appraised': False}

Azelphur commented 5 years ago

@kruppe11 submitted a PR for this which I have merged. Issue should be resolved now. Thanks again, good catch! :)