Skip to content

Commit

Permalink
Merge pull request tellomichmich#63 from gabi92a/patch-1
Browse files Browse the repository at this point in the history
Update: Added MaxPokeballsPerPokemon support
  • Loading branch information
tellomichmich authored Sep 7, 2016
2 parents 8c7ce17 + 8382ccb commit ffa02a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PokeNoxBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ def PokemonWorker(PokemonPosition):
ERROR_LOG("Mmmm, something really strange happened !")
return False
#Avoid too long pokemon fight, maybe the pokemon is far...
if ThrowCount > 30 :
ERROR_LOG("Pokemon too hard, exiting the fight !")
if ThrowCount == config['MaxPokeballsPerPokemon']:
WARNING_LOG("This pokemon has exceeded the "+str(config['MaxPokeballsPerPokemon'])+" attempts to be captured, exiting the fight...")
ClosePokemonFight()
#Return false to avoid refight this pokemon
return False
Expand All @@ -444,6 +444,7 @@ def PokemonWorker(PokemonPosition):
INFO_LOG("Throwing a %s (%d)" % (SelectedPokeball, LastPower))
ThrowPokeball(LastPower)
ThrowCount += 1
INFO_LOG("Attempt to catch "+str(ThrowCount)+" of "+str(config['MaxPokeballsPerPokemon']))
time.sleep(1)
bIsPokemonFightOpened = False
bIsCatchSuccess = False
Expand Down

0 comments on commit ffa02a3

Please sign in to comment.