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

Sniper missing to catch pokemon #5715

Closed
iruy opened this issue Sep 27, 2016 · 5 comments
Closed

Sniper missing to catch pokemon #5715

iruy opened this issue Sep 27, 2016 · 5 comments

Comments

@iruy
Copy link

iruy commented Sep 27, 2016

I noticed (with a little debug) that Sniper catches only the first pokemon in the targets list, then it continue sniping instaed of going through list. By adding

    if success:
        shots = 0

to the code, it will catch all the pokemon sniped. Is this a legit change?

    for index, target in enumerate(targets):
        if shots < self.bullets:
            success = self.snipe(target)
            shots += 1

            # Homing shots are supposed to hit the target (capture). Rollback
            if self.homing_shots and not success:
                shots -= 1

            # Wait a bit if were going to snipe again (bullets and targets left)
            if shots < self.bullets and index < len(targets):
                self._trace('Waiting a few seconds to teleport again to another target...')
                time.sleep(3)
            if success:
                shots = 0
@YvesHenri
Copy link

Sniper TRIES to catch the N best (according to the order specified) targets, where N is the bullets value. If you have enabled homing_shots, it'll end up CATCHING (for sure) the N best targets.

@GhosterBot
Copy link
Contributor

GhosterBot commented Sep 27, 2016

it'll end up CATCHING (for sure) the N best targets

Except if the Pokemon vanish

@iruy
Copy link
Author

iruy commented Sep 27, 2016

Accordin to docs

*bullets- Each bullet corresponds to an **ATTEMPT** of catching a pokemon. (default: 1)

I understand that bullets is the number of attempt of catching each pokemon.
But, instead, it is the number of sniped pokemon to catch, right? Why shouldn't the bot try to catch ALL the pokemon?

@YvesHenri
Copy link

An attempt of capturing a pokemon might succeed or not (vanish). bullets IS the number of MAX attempts (as long as there's enough pokemon to snipe). homing_shots will consider that those "Damn! It's not here" messages are failed attempts and so it will not waste a bullet (retry a different target).

@iruy
Copy link
Author

iruy commented Sep 27, 2016

Thank you

@iruy iruy closed this as completed Sep 27, 2016
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

No branches or pull requests

3 participants