PokemonGoF / PokemonGo-Bot-Backup

The Pokemon Go Bot, baking with community.
http://maps.pikabot.org
MIT License
109 stars 15 forks source link

Serveral improvements to move_to_map_pokemon #9

Closed ProblemFactory closed 8 years ago

ProblemFactory commented 8 years ago
YvesHenri commented 8 years ago

@martixingwei Thank you for your work. Unfortunatelly, I'm pulling a request soon which will delete this old snipping system for a new one fully refactored. Although this can still be used if my request doesn't get approved, which I doubt. Anyways, for now please fix the 'map_path' attribute, which was deprecated in previous commits.

ProblemFactory commented 8 years ago

@YvesHenri Can you fix the get_nearest_fort_on_the_way function so that I can avoid making another PR? Also, I don't know the reason, but my sniping stopped working suddenly. All encounter status became 3 or 6 after sniping. (wild Pokemon are normal)

YvesHenri commented 8 years ago

@martixingwei We're currently trying to restore the repo to it's lastest version. Untill then, I can't pull my request, but you can do pull yours. What's "stopped working" for you, btw?

ProblemFactory commented 8 years ago

@YvesHenri The sniping. My bot cannot encounter the sniped pokemon correctly. The encounter dictionary would be empty with status 3 or 6. But the encounters while bot walking are fine.

ProblemFactory commented 8 years ago

@YvesHenri The log looks like: 2016-09-14 11:15:56] [MainThread] [MoveToMapPokemon] [INFO] Encountered Pokemon: Dratini [2016-09-14 11:15:59] [MainThread] [MoveToMapPokemon] [INFO] Teleporting back to previous location (35.6753617949, 139.755734634)... (My debug output here) {'ENCOUNTER': {'status': 3}} where the correct encounter would be: {'ENCOUNTER': {'status': 1, 'wild_pokemon': {'last_modified_timestamp_ms': 1473851434563L, 'longitude': 139.75630344614456, 'pokemon_data': {'move_1': 241, 'move_2': 95, 'pokemon_id': 111, 'height_m': 0.990321159362793, 'stamina_max': 116, 'weight_kg': 113.19532012939453, 'individual_defense': 10, 'cp_multiplier': 0.667934000492096, 'stamina': 116, 'individual_stamina': 14, 'individual_attack': 11, 'cp': 799}, 'latitude': 35.67628807546485, 'spawn_point_id': u'60188bf3c01', 'encounter_id': 12680748417189509885L, 'time_till_hidden_ms': 817569}, 'capture_probability': {'capture_probability': [0.299430787563324, 0.4136234521865845, 0.509202778339386], 'pokeball_type': [1, 2, 3]}}}

YvesHenri commented 8 years ago

@martixingwei You mean it teleports back but instead of catching the target (if exists) it just moves around? If that it, you can fix by changing the line that looks something like this:

if not pokemon['encounter_id'] or not pokemon['spawnpoint_id']:
   pokemon['encounter_id'] = nearby_pokemon['encounter_id']
   pokemon['spawn_point_id'] = nearby_pokemon['spawnpoint_id']

To this:

if not pokemon['encounter_id'] or not pokemon['spawn_point_id']: # <----
   pokemon['encounter_id'] = nearby_pokemon['encounter_id']
   pokemon['spawn_point_id'] = nearby_pokemon['spawn_point_id'] # <----

Whereas 'spawn_point_id' is the correct attribute name that can't be None or '' by the time it encounters with it. There were some issues related to this, but again the repo was deleted and I couldnt pull a request for this. Fix it yourself for now. The new snipper is ready to go. :)