-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Forget pokemon set to not capture #3175
Comments
Would you mind putting something like |
Have you tried adding said pokemon to the catch filter and marking it as "always_catch": false? I believe this is what you are looking for. |
@kyleboe Thanks for pointing this out mate, done! |
@nelsong by setting always_catch = false, does it mean that I will never catch that particular pokemon please? no matter its cp or lv? because I actually want to filter it by cp or lv |
@g2384 Do you think it is possible to 'completely' ignore this pokemon? e.g. not calling catchpokemonworker at all? I understand it may be a bit difficult, as the logic to evalulate whether to catch or not is inside catchpokemonworker, so that means we may have to return a value to its upper level to 'delete' or 'remove' this particular pokemon from the api response, and this is where I am stuck. |
The should_capture_pokemon funciton is however inside the catch_pokemon_worker, surely we can copy it, but to evaluate the CP and IV of this particular pokemon, it is done in the work in catch_pokemon_worker, that means we have to copy that part of code out and call it before we decide to call catch_pokemon_worker. Sounds like it is more like merging or basically embed half of the catch_pokemon_worker into other upper level modules, e.g catch_lured_pokemon.py and catch_visible_pokemon.py Does it sound right to you? |
That is very interesting, and i think u nail it. Using global variable so that two modules can communicate. I am not so good at coding, just in my early learning stage. May I ask what/why this code here for please? what is this magic number 20 please?
|
Just in case if the length of ignored_poke_arr becomes larger and larger. 20 is a rough estimation. It assumes that after ignoring 20 unique pokemon, the first pokemon has already disappeared/expired, so remove that one from the list. I didn't use timestamp here because for the lured pokemon, no timestamp is available. Two modules cannot communicate, the global variables are separate, although they have the same name. I'm really glad that you are interested in this question and discuss this issue with me. I'm disappointed by the contributors (lack of communication). So I won't post anything here anymore. |
Thank you! So why using pop but not remove please? and do you think that it could 'save' some time by ignoring the unwanted pokemon and hence increase the efficiency of catching wanted pokemon? |
I checked the differences and tested the speed.
Surprisingly, Reducing API calls will increase the efficiency, according to the discussion in another issue (I won't make a reference). The minimum interval between API calls is 5-10 sec if I understand it correctly. |
I am glad to have some discuss as well, and you answer questions very promptly. In fact, I forgot to ask, you say two modules cannot communicate, the global variables are separate, although they have the same name. I think u mean the global variable are the same variable, right? I mean it has to be the same variable so it can be called in different modules and act as a flag to decide whether to ignore or not. |
I hope that you are interested on discussing the code with me, as I just struggle to understand the following: In the original catch_visible_pokemon.py, I have insert a print statement to help me debug class CatchVisiblePokemon(BaseTask):
and the result on the console is 2016-08-11 08:26:18,991 [MoveToFort] [INFO] [moving_to_fort] Moving towards pokestop One Tree Hill - 0.07km so the question I have is, why this print statement would be called every time after moving_to_fort? I just don't see how the catch_visible_pokemon.work is called. |
It is not after moving_to_fort, it is before PokemonCatchWorker. I don't really understand the code either. But it starts with:
For the global variable part, I didn't test it so I don't know the exact answer. Please let me know if you discovered something. |
i agree with you, it is called before PokemonCatchWorker, but three times? and only after the last time, it shows 'A Wild Drowzee appeared' This is where I get lost.... |
It keeps checking catchable pokemon every tick (or every N ticks) even though there's no pokemon around you. That's why you see that print() frequently. |
but then, from where the catch_visible_pokemon is called?? CatchVisiblePokemon is set in my config, but i just don't see where it calls this function, apparently it is not from Move_to_Map_Pokemon, as I have added a statement there before pokemoncatchworker is called, but this statement never print... |
@luckyvictor fixed? |
my account is now permanently banned (I guess, because I have been seeing server is busy or offline for 3 days), so I can't do it anymore unless I create a new account |
Going to close, happy to reopen if any raises that it still needs to be done |
Please check configuration at http://jsonlint.com/ before posting an issue.
This is not exactly an issue but an improvement rather, just want to ask whether this can be implemented.
Expected Behavior
The bot to forget the pokemon that is filtered as not to capture
Actual Behavior
The bot keeps seeing the same pokemon that is filtered as not to capture, seems like time is wasted on this pokemon
Steps to Reproduce
Other Information
OS:
Git Commit: (run 'git log -n 1 --pretty=format:"%H"' and paste it here)
Python Version: (run 'python -V' and paste it here)
The text was updated successfully, but these errors were encountered: