def enhance(): Utils.wait_till_find("factory") Utils.touch_randomly(regions["enhance"]) Utils.wait_till_find_touch("select_character") Utils.script_sleep(1) gun = None gun = Utils.find("enhance_1_l") if not gun: gun = Utils.find("enhance_1") if not gun: gun = Utils.find("enhance_2_l") if not gun: gun = Utils.find("enhance_2") if not gun: gun = Region(150, 400, 0, 0) Utils.touch_randomly(gun) Utils.wait_till_find_touch("select_character_2") Utils.wait_till_find_touch("smart_select") Utils.script_sleep(2) if not Utils.find("smart_select"): Utils.touch_randomly(regions["ok"]) Utils.script_sleep(1) Utils.touch_randomly(regions["ok"]) Utils.script_sleep(2) Utils.find_and_touch("ls_ok_restart") Utils.touch_randomly(regions["ok"]) Utils.script_sleep(1) Factory.enhance() else: Utils.touch_randomly(regions["return"]) Utils.touch_randomly(regions["return"]) Utils.wait_till_find("test")
def executeOrders(self): while True: n = self.nextOrder() if n[0] == 'end': break if n[0] == 'swipe': Utils.swipe(int(n[1]), int(n[2]), int(n[3]), int(n[4]), 1000) continue if n[0] == 'tap': Utils.touch_randomly(Region(int(n[1]), int(n[2]), 0, 0)) continue if n[0] == 'wait': Utils.script_sleep(int(n[1])) continue if n[0] == 'find_touch': if Utils.find_and_touch(n[1]): if n[1] == 'dock_full': Factory.enhance() return 1 continue if n[0] == 'wait_find': Utils.wait_till_find(n[1]) continue if n[0] == 'wait_find_touch': Utils.wait_till_find_touch(n[1]) continue if n[0] == 'swipe_topleft': Utils.swipe_top_left() continue if n[0] == 'log_info': Logger.log_info(n[1].replace('_', ' ')) continue if n[0] == 'deploy': if n[1] == 'start': self.deploy() else: self.deploy(False) continue print(n) return 0