def auto_continue(): pos = wait(GLOBAL_SIFT_SHARE, timeout=MAX_WAIT_TIME, interval=2) touch_pos(random_pos(pos, 50, 100)) pos = wait(GLOBAL_SIFT_CONTINUE, timeout=MAX_WAIT_TIME) time.sleep(4) touch_pos(random_pos(pos, 50, 100, 0, 1), 2)
def challenge(): touch(wait(step4, timeout=60)) pos = wait(GLOBAL_SIFT_SHARE, timeout=5 * 60, interval=2) touch_pos(random_pos(pos, 50, 100)) pos = wait(GLOBAL_SIFT_CONTINUE, timeout = 60) time.sleep(4) touch_pos(random_pos(pos, 50, 100, 0, 1), 2)
def f**k(idx, pos): # 选择进攻 touch_pos(pos) time.sleep(0.5) button = exists(challenge_button) if not button: print(f"第{idx + 1}号结界已挑战过,跳过") return -1 # 确认进攻 touch_pos(button, 2) if (exists(tip_noticket)): print("挑战券不足,脚本终止") return -2 # 等待挑战结束 ret, _ = select((GLOBAL_SIFT_VICTORY, GLOBAL_SIFT_FAILED), timeout=MAX_WAIT_TIME) # 挑战失败 if ret == 1: print(f"第{idx + 1}号结界挑战失败,请注意更换阵容") return -3 # 再次确认跳过等待时间 pos = wait(GLOBAL_SIFT_CONTINUE, timeout=MAX_WAIT_TIME) touch_pos(random_pos(pos, 50, 100, 0, 1), 2) time.sleep(4) touch_pos(random_pos(pos, 50, 100, 0, 1), 2) return 0
def leader_continue(): def _wait_teammates(pos): if not pos or len(pos) >= 2: return False return True # 二次确认,防止界面加载瞬间 for _ in range(2): wati_util(GLOBAL_TEAMMATES_SLOT, _wait_teammates, MAX_WAIT_TIME, 1) time.sleep(1.5) touch(GLOBAL_TEAM_CHALLENGE) pos = wait(GLOBAL_SIFT_CONTINUE, timeout=MAX_WAIT_TIME) touch_pos(random_pos(pos, 50, 100, 0, 1), 2) time.sleep(4) touch_pos(random_pos(pos, 50, 100, 0, 1), 2)
def run(args): print("个人突破 自动挂机脚本运行...") targets = calc_pos() while (True): cnt = 0 for idx, pos in enumerate(targets): ret = f**k(idx, pos) if ret == -2: return if ret in (0, -1): cnt += 1 # 每三次成功额外奖励结算时间 if not ret and cnt and cnt % 3 == 0: print("等待额外奖励结算...") time.sleep(5) touch_pos(pos) time.sleep(1) if cnt < 9: print("部分挑战失败,请更换阵容再试!") break
def challenge(): touch(wait(step1, timeout=60)) pos = wait(GLOBAL_SIFT_CONTINUE, timeout=120) touch_pos(random_pos(pos, 50, 100, 0, 1), 2) time.sleep(4) touch_pos(random_pos(pos, 50, 100, 0, 1), 2)