Skip to content

Commit

Permalink
Allow speed of 0 by moving very slowly
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Yao committed Aug 18, 2016
1 parent e2e6d48 commit 663238a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pokemongo_bot/step_walker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from math import sqrt
from sys import maxsize

from random import random, uniform
from random import uniform
from cell_workers.utils import distance
from human_behaviour import random_lat_long_delta, sleep

Expand All @@ -19,17 +20,17 @@ def __init__(self, bot, dest_lat, dest_lng):
dest_lat,
dest_lng
)

self.speed = uniform(self.bot.config.walk_min, self.bot.config.walk_max)

self.destLat = dest_lat
self.destLng = dest_lng
self.totalDist = max(1, self.dist)

if self.speed == 0:
self.speed = uniform(3,5)

self.steps = (self.dist + 0.0) / (self.speed + 0.0)
self.steps = maxsize
else:
self.steps = (self.dist + 0.0) / (self.speed + 0.0)

if self.dist < self.speed or int(self.steps) <= 1:
self.dLat = 0
Expand Down

0 comments on commit 663238a

Please sign in to comment.