Skip to content

Commit

Permalink
MoveToMap: Add minimum balls to run (#3166)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmquan authored and elicwhite committed Aug 9, 2016
1 parent 5e3179b commit e4c54dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions configs/config.json.map.example
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"address": "http://localhost:5000",
"max_distance": 500,
"min_time": 60,
"min_ball": 50,
"prioritize_vips": true,
"snipe": false,
"update_map": true,
Expand Down
3 changes: 2 additions & 1 deletion pokemongo_bot/cell_workers/move_to_map_pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def initialize(self):
self.pokemon_data = self.bot.pokemon_list
self.unit = self.bot.config.distance_unit
self.caught = []
self.min_ball = self.config.get('min_ball', 1)

data_file = 'data/map-caught-{}.json'.format(self.bot.config.username)
if os.path.isfile(data_file):
Expand Down Expand Up @@ -250,7 +251,7 @@ def work(self):
pokemon = pokemon_list[0]

# if we only have ultraballs and the target is not a vip don't snipe/walk
if (pokeballs + superballs) < 1 and not pokemon['is_vip']:
if (pokeballs + superballs) < self.min_ball and not pokemon['is_vip']:
return WorkerResult.SUCCESS

if self.config['snipe']:
Expand Down

1 comment on commit e4c54dc

@DimaVIII
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#3271 is this somehow related?

Please sign in to comment.