Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gym changes #6109

Merged
merged 3 commits into from
Jul 23, 2017
Merged

Gym changes #6109

merged 3 commits into from
Jul 23, 2017

Conversation

davidakachaos
Copy link
Contributor

Short Description:

Multiple changes for the Gym feature.

  • Ignore the CP limit for certain Pokemon
  • Never place certain Pokemon in gyms
  • Leave at least X spots in gyms for normal players (don't rob the last spot!)
  • Take at most X gyms
  • Pick a random Pokemon from the "order_by" or pick the top one
  • Disable "drop chaining" Pokemon in gyms -> When we drop a Pokemon in a gym, give other workers a chance to work.

Removed all code about "feeding" Pokemon in gyms. This should be its own worker, or at least work. No need for this right now in the bot. (sorry @goedzo for kicking all that code out, you can leave it in your own fork!)

Added ability to limit the amount of gyms we are in
Added ability to leave a X number of spots open in gyms
Added ability to pick a random Pokemon or not
Added ability to disable chaining of placing Pokemon
@mention-bot
Copy link

@davidakachaos, thanks for your PR! By analyzing the history of the files in this pull request, we identified @goedzo, @supercourgette and @TheSavior to be potential reviewers.

@MerlionRock
Copy link
Contributor

MerlionRock commented Jul 23, 2017

👍

Approved with PullApprove

@MerlionRock MerlionRock merged commit 76887db into PokemonGoF:dev Jul 23, 2017
@goedzo
Copy link
Contributor

goedzo commented Jul 23, 2017

What did you change? It looks like gympokemon is not working anymore. I don't see any messages from it. Originally bot started with a message showing all mons in gyms. I don't see this message anymore, and don't see any messages that it is looking for gyms. It now appears af is this walker is never called anymore.

@davidakachaos
Copy link
Contributor Author

davidakachaos commented Jul 23, 2017 via email

@goedzo
Copy link
Contributor

goedzo commented Jul 23, 2017

I have no idea, what changed. It looks like MoveToFort is messing it up:

    {
        "type": "MoveToFort",
        "config": {
            "enabled": true,
            "lure_attraction": true,
            "lure_max_distance": 2000,
            "walker": "PolylineWalker",
            "log_interval": 60
        }
    },

Because that one is always working, and not gym pokemon. I suggest reverting this now, untill it works. I don't even see the starting message anymore that it has x pokes in gyms.

@goedzo
Copy link
Contributor

goedzo commented Jul 23, 2017

Oh wait, I am very stupid :)

    {
        "type": "GymPokemon",
        "config": {
            "enabled": false,
            "order_by": "cp",
            "min_interval":360,
            "min_recheck":30,
            "max_recheck":120,
            "chain_fill_gyms": true,
            "ignore_max_cp_pokemon": ["Blissey"],
            "never_place": ["Machamp"],
            "leave_at_least_spots": 0,
            "take_at_most": 20,
            "pick_random_pokemon": true
        }
    },

I had it set to false. Stupid me!

@goedzo
Copy link
Contributor

goedzo commented Jul 23, 2017

Yup, that was it :)

[2017-07-23 16:01:41] [GymPokemon] [INFO] Inspecting 15 gyms.
[2017-07-23 16:01:41] [GymPokemon] [INFO] Recent gyms: 0
[2017-07-23 16:01:41] [GymPokemon] [INFO] Active raid gyms: 0
[2017-07-23 16:01:41] [GymPokemon] [INFO] Gym Teams Instinct(6), Mystic(4), Valor(5)

Sorry about the confusion LOL

@davidakachaos
Copy link
Contributor Author

davidakachaos commented Jul 23, 2017 via email

@goedzo
Copy link
Contributor

goedzo commented Jul 23, 2017

Well got into another bug thoug. App crashes when deploying:

[2017-07-23 16:21:49] [ cli] [INFO] Most Perfect Pokemon: Swinub [CP: 10] [IV: 14/14/15] Potential: 0.96
Traceback (most recent call last):
File "pokecli.py", line 884, in
main()
File "pokecli.py", line 206, in main
bot.tick()
File "/usr/src/app/pokemongo_bot/init.py", line 834, in tick
if worker.work() == WorkerResult.RUNNING:
File "/usr/src/app/pokemongo_bot/cell_workers/gym_pokemon.py", line 154, in work
result = self.move_to_destination()
File "/usr/src/app/pokemongo_bot/cell_workers/gym_pokemon.py", line 320, in move_to_destination
self.drop_pokemon_in_gym(self.destination, current_pokemons)
File "/usr/src/app/pokemongo_bot/cell_workers/gym_pokemon.py", line 438, in drop_pokemon_in_gym
stdout.write("\033[1A\033[0K\r")
NameError: global name 'stdout' is not defined

@goedzo
Copy link
Contributor

goedzo commented Jul 23, 2017

You're missing:
from sys import stdout
Adding a hotfix now to code.

@davidakachaos
Copy link
Contributor Author

davidakachaos commented Jul 23, 2017 via email

@goedzo
Copy link
Contributor

goedzo commented Jul 23, 2017

Still crashing. Please test properly before pulling.

[2017-07-23 16:45:09] [ cli] [INFO] Most Perfect Pokemon: Goldeen [CP: 388] [IV: 15/7/14] Potential: 0.8
Traceback (most recent call last):
File "pokecli.py", line 884, in
main()
File "pokecli.py", line 206, in main
bot.tick()
File "/usr/src/app/pokemongo_bot/init.py", line 834, in tick
if worker.work() == WorkerResult.RUNNING:
File "/usr/src/app/pokemongo_bot/cell_workers/gym_pokemon.py", line 156, in work
result = self.move_to_destination()
File "/usr/src/app/pokemongo_bot/cell_workers/gym_pokemon.py", line 322, in move_to_destination
self.drop_pokemon_in_gym(self.destination, current_pokemons)
File "/usr/src/app/pokemongo_bot/cell_workers/gym_pokemon.py", line 465, in drop_pokemon_in_gym
if not first_time:
UnboundLocalError: local variable 'first_time' referenced before assignment

@davidakachaos davidakachaos deleted the gym_changes branch August 23, 2017 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants