예제 #1
0
    def execute(self):
        # already sleep in this one.
        BaseActionInfo.execute(self)

        matched, centerX, centerY = utils.sleep_detect_scroll_pattern(
            0, self.detect_times, self.pattern_file)
        if matched > 0:
            utils.tap_screen(centerX, centerY)
        else:
            ScenarioExecutor("s6_launch_app.json").execute()
            utils.exit_current_round = 1
예제 #2
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)
예제 #3
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.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.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.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)
예제 #4
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.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.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.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)
예제 #5
0
 def execute(self):
     utils.tap_screen(self.xpos, self.ypos)
     BaseActionInfo.execute(self)