Example #1
0
                                 replace_warned=False)
account_manager.loader = load_accounts_for_blindcheck
account_manager.initialize(args.accountcsv, ())
log.info("{} accounts to check".format(str(account_manager.size())))

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()
Example #2
0
        id_ = gym["gym_id"]
        if id_ not in all_scanned_gyms:
            result[id_] = gym
            all_scanned_gyms[id_] = gym
        if len(result) > n:
            break
    return result

all_scanned_gyms = {}
for crook in args.crooks:
    crook_gyms = most_recent_trainer_gyms(crook)
    gym_map = find_top_n(crook_gyms, all_scanned_gyms, 30)
    #gym_map = filter_for_geofence(gym_map, args.geofence, args.fencename)
    print("There are {} gyms in scan with fence {}".format(str(len(gym_map)), str(args.fencename)))
    scanners = []
    threads = []
    for idx, stream in gym_map.items():
        account = account_manager.get_account(False)
        scanner = wrap_account(account, account_manager)
        scanners.append(scanner)
        thread = Thread(target=beh_safe_scanner_bot, args=(scanner, cycle([stream])))
        threads.append(thread)
        thread.start()
        time.sleep(2)

for thread in threads:
    thread.join()

log.info("exiting scanner")
sys.exit()
Example #3
0
            log.info("Created stream " + str(len(streams)) + ", with " +
                     str(len(stream)) + " gyms, length " +
                     str(int(length_of_route(stream))) + " meters")
            stream = []
            distance = 0
        stream.append(next_gym)
        distance += 250  # add 250 m per gym
        prev = next_gym
    log.info("Created stream " + str(len(streams)) + ", with " +
             str(len(stream)) + " gyms, length " +
             str(int(length_of_route(stream))) + " meters")
    streams.append(stream)

scanners = []
threads = []
for stream in streams:
    account = account_manager.get_account()
    scanner = wrap_account(account, account_manager)
    scanners.append(scanner)
    thread = Thread(target=beh_safe_do_gym_scan,
                    args=(scanner, gym_moves_generator(stream)))
    threads.append(thread)
    thread.start()
    time.sleep(2)

for thread in threads:
    thread.join()

log.info("exiting scanner")
sys.exit()