Skip to content

Commit

Permalink
Step walker improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Yao committed Aug 19, 2016
1 parent 198510b commit dfcb989
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pokemongo_bot/walkers/step_walker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from math import sqrt

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

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

self.speed = self.bot.config.walk_max - random() * (self.bot.config.walk_max - self.bot.config.walk_min)
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.steps = 1
raise Exception("Walking speed cannot be 0!")
else:
self.steps = (self.dist + 0.0) / (self.speed + 0.0)

Expand Down

0 comments on commit dfcb989

Please sign in to comment.