示例#1
0
    def execute(self):
        #nothing just return
        BaseActionInfo.execute(self)

        notEnoughEnergy, _, _ = utils.patternDetect(
            "no_enough_engergy_pattern.png")
        if notEnoughEnergy:
            hasAdsEnergy, _, _ = utils.patternDetect(
                "energy_watch_ads_patten.png")
            if hasAdsEnergy > 0:
                # click the ads energy
                ScenarioExecutor("s6_watch_energy_ads.json").execute()
            elif utils.use_energy_ball > 0:
                hasEnergyBall, _, _ = utils.patternDetect(
                    "energy_ball_pattern.png")
                if hasEnergyBall > 0:
                    ScenarioExecutor("s6_use_energy_ball.json").execute()
                else:
                    sys.exit(0)
            else:
                sys.exit(0)
        else:
            return

        #nothing just return
        BaseActionInfo.execute(self)
示例#2
0
    def execute(self):
        for i in range(0, 10):
            easymatch, xpox, ypos = utils.patternDetect("match_easy.png")
            print("Easy match result {}  {}   {}!".format(
                easymatch, xpox, ypos))
            if easymatch > 0:
                utils.accurate_tap_screen(xpox, ypos)
                utils.sleep_wait(1)
                ScenarioExecutor("s6_partial_match.json").execute()
                return
            elif utils.run_middle > 0:
                middleMatch, xpox, ypos = utils.patternDetect(
                    "match_middle.png")
                print("Middle match result {}  {}   {}!".format(
                    middleMatch, xpox, ypos))
                if middleMatch > 0:
                    utils.accurate_tap_screen(xpox, ypos)
                    utils.sleep_wait(1)
                    ScenarioExecutor("s6_partial_match.json").execute()
                    return
                elif utils.run_hard > 0:
                    hard_match, xpox, ypos = utils.patternDetect(
                        "match_hard.png")
                    print("Hard match result {}  {}   {}!".format(
                        hard_match, xpox, ypos))
                    if hard_match > 0:
                        utils.accurate_tap_screen(xpox, ypos)
                        utils.sleep_wait(1)
                        ScenarioExecutor("s6_partial_match.json").execute()
                        return
                #dd
            # not found
            utils.vertical_swipe_screen_down()

        BaseActionInfo.execute(self)
示例#3
0
    def execute(self):
        # only check for not play first.
        if utils.has_easy > 0:
            for i in range(0, 7):
                all_match, xpox, ypos = utils.patternDetect(
                    "all_match_left_pattern.png")
                print("Find all_match match result {}  {}   {}!".format(
                    all_match, xpox, ypos))
                if all_match > 0:
                    utils.accurate_tap_screen(xpox, ypos)
                    utils.sleep_wait(1)
                    ScenarioExecutor(
                        "s6_check_all_match_run_easy.json").execute()
                    # execute the script
                    return

                print("swipe")
                utils.horizontal_swipe_screen_once()

            #swipe back
            utils.horizontal_swipe_screen_back()
            utils.sleep_wait(1)

        # check others.
        for i in range(0, 7):
            middle_match, xpox, ypos = utils.patternDetect(
                "only_easy_done_pattern.png")
            print("Find middle match result {}  {}   {}!".format(
                middle_match, xpox, ypos))
            if middle_match > 0:
                utils.accurate_tap_screen(xpox, ypos)
                utils.sleep_wait(1)
                ScenarioExecutor(
                    "s6_check_all_match_run_others.json").execute()
                return
            elif utils.run_hard > 0:
                hard_match, xpox, ypos = utils.patternDetect(
                    "only_hard_left_pattern.png")
                print("Find hard match result {}  {}   {}!".format(
                    hard_match, xpox, ypos))
                if hard_match > 0:
                    utils.accurate_tap_screen(xpox, ypos)
                    utils.sleep_wait(1)
                    ScenarioExecutor(
                        "s6_check_all_match_run_others.json").execute()
                    return
                #dd
            # not found
            print("swipe")
            utils.horizontal_swipe_screen_once()

        print("No Game category available!")
        BaseActionInfo.execute(self)
示例#4
0
    def execute(self):
        BaseActionInfo.execute(self)
        containsPattern = 0
        for j in range(self.detect_times):
            print("Detect rounds {}!".format(j))
            utils.tap_screen(1760, 1030)
            utils.pure_sleep(1)
            containsPattern, _, _ = utils.patternDetect(self.pattern_file)
            if containsPattern > 0:
                break

        if containsPattern > 0:
            #found it.
            return
        else:
            print("No Sharing at all")
            sys.exit(0)
示例#5
0
    def execute(self):
        BaseActionInfo.execute(self)
        containsPattern = 0
        for j in range(self.detect_times):
            print("Detect rounds {}!".format(j))
            containsPattern, _, _ = utils.patternDetect(self.pattern_file)
            if containsPattern > 0:
                break

        if containsPattern > 0 and len(self.success_script) > 1:
            print("Run success script {} ".format(self.success_script))
            ScenarioExecutor(self.success_script).execute()
            #found it.
            return
        else:
            if len(self.fallback_script) > 1:
                print("Run fallback script {} ".format(self.fallback_script))
                ScenarioExecutor(self.fallback_script).execute()