def start_feed(self): """喂猫""" action_list = [ gamex.Action(99, '猫粮不足', '领猫粮', delay=5, perform=self.perform), # 下一状态置为 0 ,重新搜索 gamex.Action(2, '拍照结果', '关闭按钮', 0, delay=1), gamex.Action(1, '首页', '喂养', 0, delay=5), ] game = gamex.GameX(self.config_path, self.screenshot, action_list, adb=self.adb, debug=True) game.run()
def __init__(self): self.screenshot_path = 'ignore/screenshot.png' """截图路径""" self.config_path = '1080_1920' """配置路径""" self.game_count = 0 """记录游戏次数""" self.adb = adbx.Adb() """adb""" try: self.statistics = RemainingTimeStatistics(50) except NameError: self.statistics = None self.game = gamex.GameX(self.config_path, self.screenshot_path, [], adb=self.adb, debug=True) self.store_home_action = gamex.Action(3, '店铺首页', '猫猫出现啦', 4) self.store_home_action_2 = gamex.Action(3, '店铺首页', '猫猫出现了', 0)
def start_game(self): """游戏流程""" version = 3 if version == 2: # 后来更新 action_list = [ # 下一状态置为 0 ,重新搜索, gamex.Action(1, '首页', '召唤理想猫', 2), gamex.Action(2, '首页弹窗', '逛店铺', self.next_status, delay=15), self.store_home_action, gamex.Action(4, '成功抓到猫猫', '开心收下', 0), ] elif version == 3: action_list = [ # 下一状态置为 0 ,重新搜索, gamex.Action(1, '首页', '合合卡', 2), gamex.Action(2, '首页弹窗', '进店领取', self.next_status, delay=15), self.store_home_action, gamex.Action(4, '成功抓到猫猫', '开心收下', 0), ] else: # 旧版本 action_list = [ # 下一状态置为 0 ,重新搜索, gamex.Action(1, '首页', '领喵币', 2), gamex.Action(2, '领喵币中心', '去浏览', self.next_status, delay=25), gamex.Action(2, '领喵币中心', '去逛店', self.next_status, delay=15), self.store_home_action, gamex.Action(4, '成功抓到猫猫', '开心收下', 0), ] for action in action_list: if action.delay == 1: # 修改默认 # action.delay = 5 pass action.perform = self.perform self.game.action_list = action_list self.game.run()
def start_game(self): """游戏流程""" action_list = [ # 下一状态置为 0 ,重新搜索 gamex.Action(99, '没中', '这次没中', 0), gamex.Action(10, '抽奖', '马上抽', 11), gamex.Action(1, '首页', '快速抢红包', 0), gamex.Action(2, '打气球游戏', '打气球', 5), gamex.Action(3, '取猫粮游戏', '取猫粮', 6), gamex.Action(4, '左右滑游戏', '甩猫爪', 7), # 因为 5 中的点猫页面会误判,所以放到后面 gamex.Action(8, '游戏结果', '再玩一次', next_status=self.next_status), gamex.Action(9, '游戏结果', '关闭按钮', 0), gamex.Action(11, '抽奖结果', '关闭按钮', 0), # 只需点击关闭 gamex.Action(5, '打气球界面', '点击猫爪', 0), gamex.Action(6, '取猫粮界面', '点击猫爪', 0, delay=10), gamex.Action(7, '左右滑界面', '关闭按钮', 0), # 关闭按钮只用来校验 gamex.Action(100, '弹出广告', '关闭按钮2', 0), # 关闭按钮只用来校验 ] for action in action_list: if action.delay == 1: # 修改默认 action.delay = 5 action.perform = self.perform game = gamex.GameX(self.config_path, self.screenshot, action_list, adb=self.adb, debug=True) game.run()