Beispiel #1
0
async def do_stuff():
    account_manager = AsyncAccountManager.create_empty(args, loop)
    l5account = account_manager.add_account({"username": "******", "password": "******", "provider": "ptc"})
    worker = wrap_account_no_replace(l5account, account_manager, 25)

    pos = (59.934393, 10.718153, 10)
    map_objects = await worker.do_get_map_objects(pos)
    pokestops = inrange_pokstops(map_objects, pos)
    gyms = inrange_gyms(map_objects, pos)

    cp = catchable_pokemon(map_objects)
    to_catch = cp[0]
    encounter_id = to_catch.encounter_id
    spawn_point_id = to_catch.spawn_point_id
    pokemon_id = to_catch.pokemon_id
    encounter_response = await worker.do_encounter_pokemon(encounter_id, spawn_point_id, pos)
    probability = EncounterPokemon(encounter_response, encounter_id).probability()
    if probability and len([x for x in probability.capture_probability if x > 0.38]) > 0:
        caught = await beh_catch_encountered_pokemon(worker, pos, encounter_id, spawn_point_id, probability,
                                                     pokemon_id, False, fast=True)
        print(caught)


    gym = gyms[0]
    await worker.do_spin_pokestop(gym, pos)
Beispiel #2
0
    async def get_account_with_lures(self, pos):
        worker = wrap_account_no_replace(
            await self.account_manager.get_account(), self.account_manager)
        worker.account_info().update_position(pos)
        retries = 0
        success = False
        while not success:
            try:
                login_result = await worker.login(pos, self.proceed)
                if login_result:
                    success = True
                else:
                    log.info(u"Login not succesful {}".format(
                        str(login_result)))
                    worker = wrap_account_no_replace(
                        await self.account_manager.get_account(),
                        self.account_manager)
                    worker.account_info().update_position(pos)
                    await asyncio.sleep(10)
                    retries += 1
            except Exception as ex:
                log.exception(u"Login had exception {}".format(
                    str(type(ex).__name__)))
                worker = wrap_account_no_replace(
                    await self.account_manager.get_account(),
                    self.account_manager)
                worker.account_info().update_position(pos)
                await asyncio.sleep(10)
                retries += 1

        await worker.do_get_map_objects(pos)
        try:
            branded = await self.brander(worker)
        except LoginSequenceFail as e:
            log.warning("LSEIn branding")
            await self.account_manager.report_failure()
            return None
        await self.account_manager.clear_failure()
        return branded
Beispiel #3
0
    def replace_account(self, pos):
        self.replaced += 1
        if self.replaced % 20 == 0:
            log.warning("Sleeping 5 minutes because replaced over 20 account")
            sleep(300)
        worker = wrap_account_no_replace(self.account_manager.get_account(),
                                         self.account_manager)
        worker.account_info().update_position(pos)
        self.worker = worker
        self.inventory = None
        self.feedings = Counter()

        map_objects = self.safe_get_map_objects(pos)
        if not self.inventory:
            self.inventory = self.worker.account_info()["items"]

        map_objects = self.check_team(map_objects, pos, team=1)

        return worker
Beispiel #4
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")
Beispiel #5
0
async def next_worker():
    account = await account_manager.get_account()
    worker = wrap_account_no_replace(account, account_manager,
                                     int(args.fast_speed))
    return worker
Beispiel #6
0
g0g3m3sh89919:MKG#6s!E3
g0g3m3sh89890:#MBYk6uAa
g0g3m3sh89864:3&mjdpE^s
'''

loop = asyncio.get_event_loop()
account_manager = AsyncAccountManager.create_empty(args, loop)
l5account = account_manager.add_account({
    "username": "******",
    "password": "******",
    "provider": "ptc"
})
#l5account = account_manager.add_account({"username":"******","password":"******","provider":"ptc"})
#l5account = account_manager.add_account({"username":"******","password":"******","provider":"ptc"})
# l5account = account_manager.add_account({"username":"******","password":"******","provider":"ptc"})
worker = wrap_account_no_replace(l5account, account_manager, 25)

stop_1 = (((59.908411, 10.7760670), "1707f1339e454eaba3e69ff443729f9d.16"),
          ((59.910564, 10.7613160), "f3650447ae6048599655b034b478d5f7.16"))
stop_2 = (((59.907937, 10.7765390), "07ae3ee4757f4049b13811dabed2fdc0.11"),
          ((59.910775, 10.7607610), "d64de98d135d48bd884fa300c6ba53e4.16"))
stop_3 = (((59.907934, 10.7759700), "9f9196aa884949bc88bf7fdb32e4ec5f.16"),
          ((59.911297, 10.7577550), "783677808da1472b8ee1ac9ed02fc65d.11"))
stop_4 = (((59.904540, 10.7665610), "787da22ba5e54bf094210927b6716b85.16"),
          ((59.909709, 10.7473550), "49b6c17d820d42a7ab43b7b8075da170.16"))
stop_5 = (((59.904737, 10.7671730), "3d903c4baf0a46e3a74821168092cf11.16"),
          ((59.908853, 10.7559040), "04fb2625ff6345ba956d5bb12c557940.16"))
stop_6_3km = (((59.907326, 10.7853680), "09abf40d1abf413990a4ff12f81734fb.16"),
              ((59.912380, 10.7312300), "10e4324fc7684c3594b976a4b114d312.16"))

#travel_time = worker.getlayer(TravelTime)
Beispiel #7
0
 def replace_account(self, pos, worker):
     retryer = wrap_account_no_replace(
         self.account_manager.mark_lures_consumed(worker.name()),
         self.account_manager)
     retryer.account_info().update_position(pos)
     return retryer
Beispiel #8
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()

for thread in threads: