def do_transfer(self, num_pokemon): print("initiating transfer routine in 10s") time.sleep(10) print("initiating for: ") for i in range(num_pokemon): print(i / num_pokemon, '% left: ', num_pokemon - i) android_phone.swipe(step1, step1) time.sleep(long_d) android_phone.swipe(step2, step2) time.sleep(short_d) android_phone.swipe(step3, step3) time.sleep(short_d) android_phone.swipe(step4, step4) time.sleep(med_d) android_phone.swipe(step5, step5) time.sleep(long_d)
def find_locations(img): img2 = get_pokestop_area(img) picture, peaks = pokestop_detector.find_locations(img2) print(np.array(p_xy), np.array(np.flip(img.shape)[1:], dtype=np.float)) print(peaks) offset = np.array(np.flip(p_xy), dtype=np.float) * np.array(img.shape[:-1], dtype=np.float) print(peaks) print(offset) for index, p in enumerate(peaks): p += offset.astype(int) p = np.flip(p) if index > 3: break print("CLICKING ON: ", p) android_phone.swipe(p, p) # time.sleep(0.7) # android_phone.swipe(*swipe) # time.sleep(0.3) # android_phone.swipe(click, click) time.sleep(1) print("==============")
def send_gift(): print("Send Click") send_button = np.array([0.20185185, 0.85]) android_phone.swipe(send_button, send_button, True) time.sleep(3) print("Gift Click") gift_button = np.array([0.5, 0.35]) android_phone.swipe(gift_button, gift_button, True) time.sleep(2) print("Send Confirm") send_confirm = np.array([0.5, 0.83]) android_phone.swipe(send_confirm, send_confirm, True) android_phone.swipe(send_confirm, send_confirm, True) time.sleep(5)
def catch(): pokeball_select_location = np.array([0.43, 0.4]) * 2 pokeball_master_location = np.array([0.415, 0.4]) * 2 pokeball_hold = np.array([0.25, 0.42]) * 2 # select master -> great ->pokeball print("SELECTING POKEBALL") android_phone.swipe(pokeball_select_location, pokeball_select_location) time.sleep(1) android_phone.swipe(pokeball_master_location, pokeball_master_location) time.sleep(1) print("SEARCHING") android_phone.hold(pokeball_hold, True) time.sleep(0.5) c1 = find_circles(android_phone.latest_frame, np.array([.05, .4]), np.array([0, 0.3, 1, .3])) while not len(c1) > 0: print("ATTEMPT, FIND") c1 = find_circles(android_phone.latest_frame, np.array([.05, .4]), np.array([0, 0.3, 1, .3])) time.sleep(1) print("FOUND, SWIPING") x, y, r = c1[0] android_phone.release(pokeball_hold, True) time.sleep(0.5) android_phone.swipe( pokeball_hold, np.array([x, y]) / np.array(np.flip(android_phone.latest_frame.shape[:2])), as_percent=True, step_pixels=10, step_delay=0.001) # hold down # detect circle # throw ball into circle. pass
def open_gift(): click_wabble_gift() print("Open Click") open = np.array([0.5, 0.86]) android_phone.swipe(open, open, True) time.sleep(2) print("Open Click") time.sleep(1) if open_gift_page(): print("GIFT LIMIT REACHED .....") leave_page() return False android_phone.swipe(open, open, True) time.sleep(0.3) android_phone.swipe(open, open, True) time.sleep(0.2) android_phone.swipe(open, open, True) time.sleep(0.2) android_phone.swipe(open, open, True) time.sleep(0.2) android_phone.swipe(open, open, True) time.sleep(5) return True
def click_wabble_gift(): rand = np.array([0.5, 0.5]) print("Random Click") android_phone.swipe(rand, rand, True) time.sleep(3)
def change_profile(): print("============[ NEXT PROFILE ]===========") android_phone.swipe(np.array([0.93518519, 0.86]), np.array([0.1537037, 0.86]), True, step_pixels=10, step_delay=0.02) time.sleep(2) pass
def leave_page(): print("LEAVINNG PAGE") btn = np.array([0.5, 0.96]) android_phone.swipe(btn, btn, True) time.sleep(1)
def next_profile(self): android_phone.swipe()