PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

Snipe wait time is too low to allow the Pokemon to show up during consecutive snipings

Open Dr8g0n opened this issue 10 years ago • 4 comments

Expected Behavior

Longer wait time for Pokemon to appear before Teleport back to original location. The wait time is especially short ~1 sec after a recent snipe due to:

# Wait a maximum of MIN_SECONDS_ALLOWED_FOR_CELL_CHECK seconds before requesting nearby cells if (seconds_since_last_check < self.MIN_SECONDS_ALLOWED_FOR_CELL_CHECK): time.sleep(self.MIN_SECONDS_ALLOWED_FOR_CELL_CHECK - seconds_since_last_check)

Recommend adding time.sleep(randint(5,10))) outside of the MIN_SECONDS_ALLOWED_FOR_CELL_CHECK in pokemongo_bot/cell_workers/sniper.py

No longer miss any Pokemon after changing sleep time to allow more wait time especially during consecutive snipings.

Actual Behavior

Wait time too short and often miss the Pokemon. Recommend adding time.sleep(randint(5,10))) outside of the MIN_SECONDS_ALLOWED_FOR_CELL_CHECK in pokemongo_bot/cell_workers/sniper.py

# Wait a maximum of MIN_SECONDS_ALLOWED_FOR_CELL_CHECK seconds before requesting nearby cells if (seconds_since_last_check < self.MIN_SECONDS_ALLOWED_FOR_CELL_CHECK): print "MIN_SECONDS_ALLOWED_FOR_CELL_CHECK: " + str(self.MIN_SECONDS_ALLOWED_FOR_CELL_CHECK) + ", seconds_since_last_check: " + str(seconds_since_last_check) print "Sleeping due to MIN_SECONDS_ALLOWED_FOR_CELL_CHECK" print "Slept for: " + str(self.MIN_SECONDS_ALLOWED_FOR_CELL_CHECK - seconds_since_last_check) time.sleep(self.MIN_SECONDS_ALLOWED_FOR_CELL_CHECK - seconds_since_last_check) print "Slept a bit more... (randint(5,10))" time.sleep(randint(5,10)))

[2016-09-25 10:13:22] [ Sniper] [INFO] Teleporting to meet Geodude (12345, 6789)... [2016-09-25 10:13:31] [ Sniper] [INFO] Yay! There really is a wild Geodude nearby! [2016-09-25 10:13:32] [ Sniper] [INFO] Teleporting back to the old position (2345, 678)...

(It took 9 secs for the Geodude to show up here)

Adding debug prints: [2016-09-25 13:04:15] [ Sniper] [INFO] Teleporting to meet Golbat (25.2812366; 124.123096)... MIN_SECONDS_ALLOWED_FOR_CELL_CHECK: 10, seconds_since_last_check: 8.76021409035 Sleeping due to MIN_SECONDS_ALLOWED_FOR_CELL_CHECK Slept for: 1.23978590965 Slept a bit more... (randint(5,10)) [2016-09-25 13:04:25] [ Sniper] [INFO] Yay! There really is a wild Golbat nearby! [2016-09-25 13:04:25] [ Sniper] [INFO] Teleporting back to the old position (38.4093424156; -122.9522343296)... [2016-09-25 13:04:28] [PokemonCatchWorker] [INFO] A wild Golbat appeared! (CP: 1492) (NCP: 0.77) (Potential 1.0) (A/D/S 15/15/15) [2016-09-25 13:04:31] [PokemonCatchWorker] [INFO] This is a VIP pokemon. Catch!!! [2016-09-25 13:04:36] [PokemonCatchWorker] [INFO] Nice Curveball throw! Used Pokeball, with chance 11.52 (93 left) [2016-09-25 13:04:37] [PokemonCatchWorker] [INFO] Golbat capture failed.. trying again! [2016-09-25 13:04:44] [PokemonCatchWorker] [INFO] Nice throw! Used Pokeball, with chance 11.52 (92 left) [2016-09-25 13:04:44] [PokemonCatchWorker] [INFO] Captured Golbat! [CP 1492] [NCP 0.77] [Potential 1.0] 15/15/15 [+110 exp] [+100 stardust] [2016-09-25 13:04:44] [PokemonCatchWorker] [INFO] You now have 2616 Zubat candy!

Your FULL pokemongo_bot/cell_workers/sniper.py (remove your username, password, gmapkey and any other private info)

# Wait a maximum of MIN_SECONDS_ALLOWED_FOR_CELL_CHECK seconds before requesting nearby cells if (seconds_since_last_check < self.MIN_SECONDS_ALLOWED_FOR_CELL_CHECK): time.sleep(self.MIN_SECONDS_ALLOWED_FOR_CELL_CHECK - seconds_since_last_check) self._log('Slept {} secs due to MIN_SECONDS_ALLOWED_FOR_CELL_CHECK...'.format(str(self.MIN_SECONDS_ALLOWED_FOR_CELL_CHECK - seconds_since_last_check))) self._log('Sleep 5 to 10 secs more...') time.sleep(randint(5,10)) `

Output when issue occurred

[2016-09-25 09:35:59] [ Sniper] [INFO] Teleporting to meet Hitmonlee (38.476413; 0.39566)... [2016-09-25 09:36:00] [ Sniper] [INFO] Damn! Its not here. Reasons: too far, caught, expired or fake data. Skipping...

1 seconds (due to the subtraction from the seconds_since_last_check) is too short for the Pokemon to show up!!!

Adding some debug prints: [2016-09-25 12:34:15] [ Sniper] [INFO] Teleporting to meet Aerodactyl (21.365107502; 114.136364352)... MIN_SECONDS_ALLOWED_FOR_CELL_CHECK: 10, seconds_since_last_check: 8.91545796394 Time slept: 1.08454203606 [2016-09-25 12:34:19] [ Sniper] [INFO] Damn! Its not here. Reasons: too far, caught, expired or fake data. Skipping... [2016-09-25 12:34:19] [ Sniper] [INFO] Teleporting back to the old position (38.4107698195; -111.953253761)... [2016-09-25 12:34:25] [ Sniper] [INFO] Teleporting to meet Pinsir (1.50196799439; 109.849025589)... MIN_SECONDS_ALLOWED_FOR_CELL_CHECK: 10, seconds_since_last_check: 9.00401496887 Time slept: 0.995985031128 [2016-09-25 12:34:29] [ Sniper] [INFO] Damn! Its not here. Reasons: too far, caught, expired or fake data. Skipping... [2016-09-25 12:34:29] [ Sniper] [INFO] Teleporting back to the old position (38.4107698195; -111.953253761)...

Dr8g0n avatar Sep 25 '16 16:09 Dr8g0n

This is not sniping anymore if you do that. It is simply teleporting. The purpose of the 1 second is to send only one position update at that location to the server. If you send more, it will look like a teleport instead of a GPS mistake.

I believe the problem you see here is the fact that you are snipping consecutively in the same cell and cell data cannot be queried more than once every 10 seconds. The second time you teleport there, the cell query fail and return nothing until the 10 seconds have passed. So if I am right, the fix would be to save the cell content the first time you teleport so that you can reuse it for next teleport.

julienlavergne avatar Sep 25 '16 23:09 julienlavergne

@Anakin5, I am snipping consecutively in different cells every time, like below. What happens if I let the bot wait after teleporting long enough (anywhere between 5-10 sec) for the Pokemon to show up?

Right now, most of the time, if it falls into the if (seconds_since_last_check < self.MIN_SECONDS_ALLOWED_FOR_CELL_CHECK) statement, the wait time is around 1 second and that does not give enough time for the Pokemon to show up. It ended up missing some of the Pokemon.

Thanks!

Even on the 1st snipe, since the seconds_since_last_check is less than MIN_SECONDS_ALLOWED_FOR_CELL_CHECK - which is 10, it only waited 0.818922996521 and that is not long enough for the Pokemon to show up. As soon as I added the random sleep between 5-10 sec, it showed up as shown below.

[2016-09-25 17:09:55] [ Sniper] [INFO] Teleporting to meet Squirtle (21.9822447; 121.1105653)... [2016-09-25 17:09:59] [ Sniper] [INFO] Slept 0.818922996521 secs due to MIN_SECONDS_ALLOWED_FOR_CELL_CHECK... [2016-09-25 17:09:59] [ Sniper] [INFO] Sleep 5 to 10 secs more... [2016-09-25 17:10:07] [ Sniper] [INFO] Yay! There really is a wild Squirtle nearby! [2016-09-25 17:10:07] [ Sniper] [INFO] Teleporting back to the old position (37.4154185673; -121.954294556)... [2016-09-25 17:10:10] [PokemonCatchWorker] [INFO] A wild Squirtle appeared! (CP: 768) (NCP: 0.76) (Potential 0.91) (A/D/S 15/11/15) [2016-09-25 17:10:13] [PokemonCatchWorker] [INFO] This is a VIP pokemon. Catch!!! [2016-09-25 17:10:16] [PokemonCatchWorker] [INFO] Threw a Razz Berry! Catch rate with Pokeball is now: 17.29 [2016-09-25 17:10:21] [PokemonCatchWorker] [INFO] Great Curveball throw! Used Greatball, with chance 25.17 (0 left) [2016-09-25 17:10:22] [PokemonCatchWorker] [INFO] Squirtle capture failed.. trying again! [2016-09-25 17:10:27] [PokemonCatchWorker] [INFO] OK Curveball throw! Used Pokeball, with chance 11.52 (92 left) [2016-09-25 17:10:28] [PokemonCatchWorker] [INFO] Squirtle capture failed.. trying again! [2016-09-25 17:10:35] [PokemonCatchWorker] [INFO] Great Curveball throw! Used Pokeball, with chance 11.52 (91 left) [2016-09-25 17:10:35] [PokemonCatchWorker] [INFO] Captured Squirtle! [CP 768] [NCP 0.76] [Potential 0.91] 15/11/15 [+160 exp] [+100 stardust] [2016-09-25 17:10:35] [PokemonCatchWorker] [INFO] You now have 317 Squirtle candy!

[ { "name": "Squirtle", "lon": "121.1105653", "userId": "225778804576665089", "IV": "94", "lat": "21.9822447" } ]

Dr8g0n avatar Sep 26 '16 00:09 Dr8g0n

You can not request cell data too quickly. This waiting time has nothing to do with 'waiting pokemons to appear', therefore this is not an issue. Don't change this.

YvesHenri avatar Sep 26 '16 02:09 YvesHenri

Then how do you explain this???

I tested with 2 bots:

This one sleeps 3 secs (by default) and missed the Pokemon

[2016-09-26 20:19:52] [MoveToFort] [INFO] Moving towards pokestop USPS Sign - 0.05km [2016-09-26 20:19:57] [ Sniper] [INFO] Teleporting to meet Growlithe (41.7646115485; -72.9637643552)... [2016-09-26 20:19:57] [ Sniper] [INFO] Sleeping 3 secs during teleporting... [2016-09-26 20:20:00] [ Sniper] [INFO] Damn! Its not here. Reasons: too far, caught, expired or fake data. Skipping... [2016-09-26 20:20:00] [ Sniper] [INFO] Teleporting back to the old position (36.1876341128; -122.986435657)...

This one sleeps a little bit more and caught the same exact Pokemon

[2016-09-26 20:20:06] [ Sniper] [INFO] Teleporting to meet Growlithe (441.7646115485; -72.9637643552)... [2016-09-26 20:20:06] [ Sniper] [INFO] Sleeping 3 secs during teleporting... [2016-09-26 20:20:09] [ Sniper] [INFO] Waiting 8 secs for the Pokemon to appear... [2016-09-26 20:20:17] [ Sniper] [INFO] Yay! There really is a wild Growlithe nearby! [2016-09-26 20:20:17] [ Sniper] [INFO] Teleporting back to the old position (36.1250140604; -121.805482928)... [2016-09-26 20:20:17] [ Sniper] [INFO] Sleeping 3 secs during teleporting... [2016-09-26 20:20:20] [PokemonCatchWorker] [INFO] A wild Growlithe appeared! (CP: 1086) (NCP: 0.8) (Potential 1.0) (A/D/S 15/15/15) [2016-09-26 20:20:23] [PokemonCatchWorker] [INFO] This is a VIP pokemon. Catch!!! [2016-09-26 20:20:26] [PokemonCatchWorker] [INFO] Threw a Razz Berry! Catch rate with Pokeball is now: 25.46 [2016-09-26 20:20:31] [PokemonCatchWorker] [INFO] Great throw! Used Ultraball, with chance 46.60 (15 left) [2016-09-26 20:20:32] [PokemonCatchWorker] [INFO] Captured Growlithe! [CP 1086] [NCP 0.8] [Potential 1.0] 15/15/15 [+150 exp] [+100 stardust] [2016-09-26 20:20:32] [PokemonCatchWorker] [INFO] You now have 603 Growlithe candy!

Dr8g0n avatar Sep 27 '16 03:09 Dr8g0n