Ejemplo n.º 1
0
async def start():
    account_manager = await AsyncAccountManager.create_standard(args, load_accounts_for_blindcheck)
    log.info("{} accounts to check".format(str(account_manager.size())))

    for pos in range(0, account_manager.size()):
        account = wrap_account_no_replace(await account_manager.get_account(), account_manager)
        split[pos % num_threads].append(account)

    loc = with_gmaps_altitude(location(args),args.gmaps_key)
    print("Checking at {}".format(str(loc)))
    threads = []
    pause_at = len( args.proxy) if args.proxy else 1

    for idx,x in enumerate(split):
        asyncio.ensure_future(safe_check_workers(x, loc, args.accountcsv))
        if (idx % pause_at) == 0:
            asyncio.sleep(5)

    print("Done checking all")
Ejemplo n.º 2
0
    ))
parser.add_argument('-stop',
                    '--stop-at',
                    default=None,
                    help='Time of day to stop in 24-hr clock: eg 18:02')

add_webhooks(parser)
add_geofence(parser)

args = parser.parse_args()
load_proxies(args)
set_args(args)
set_account_db_args(args)

pokemonhandler.set_args(args)
position = location(args)
args.player_locale = gmaps_reverse_geolocate(
    args.gmaps_key, args.locale,
    str(position[0]) + ', ' + str(position[1]))

install_thread_excepthook()

stop_at = None
if args.stop_at:
    dur_str = "100:00:00"
    h, m = list(map(int, args.stop_at.split(':')))
    stop_at = datetime.now().replace(hour=h, minute=m)
    msg = "Stopping at {}".format(str(stop_at))
    if stop_at < datetime.now():
        stop_at += timedelta(days=1)
        msg = "Stopping at {} (tomorrow)".format(str(stop_at))
Ejemplo n.º 3
0
num_threads = args.threads_per_proxy

if args.proxy and len(args.proxy) > 0:
    num_threads = max(1, len(args.proxy)) * args.threads_per_proxy

split = []
for x in range(0, num_threads):
    split.append([])

for pos in range(0, account_manager.size()):
    account = wrap_account_no_replace(account_manager.get_account(),
                                      account_manager)
    split[pos % num_threads].append(account)

loc = with_gmaps_altitude(location(args), args.gmaps_key)
print("Checking at {}".format(str(loc)))
threads = []
pause_at = len(args.proxy) if args.proxy else 1

for idx, x in enumerate(split):
    thread = Thread(target=safe_check_workers, args=(x, loc, args.accountcsv))
    threads.append(thread)
    if (idx % pause_at) == 0:
        sleep(5)
    thread.start()

for thread in threads:
    thread.join()

    print("Done checking all")
Ejemplo n.º 4
0
    length = 0
    prev_gym = None
    for gym in current_route:
        if prev_gym is not None:
            length += equi_rect_distance_m(prev_gym, gym["coordinates"])
        prev_gym = gym["coordinates"]
    return length


gym_map = gymscannercoordinates()
gym_map = filter_for_geofence(gym_map, args.geofence, args.fencename)
log.info(u"There are {} gyms in scan with fence {}".format(
    str(len(gym_map)), str(args.fencename)))
streams = []

initialPosition = location(args)
if args.radius is not None:
    filtered = [
        x for x in gym_map if
        equi_rect_distance_m(initialPosition, x["coordinates"]) < args.radius
    ]
    gym_map = filtered

while len(gym_map) > 0:
    prev = gym_map[0]
    stream = [prev]
    del gym_map[0]
    distance = 0
    while len(gym_map) > 0:
        next_gym = find_closest(gym_map, prev)
        distance += equi_rect_distance_m(prev["coordinates"],