Exemple #1
0
 def inner(*args, **kwargs):
     try:
         ret = f(*args, **kwargs)
         return ret
     except OvertimeError as e:
         game_log.error(e.type)
         args[0].restart_game()
         args[0].action()
         sleep(5)
Exemple #2
0
 def inner(*args, **kwargs):
     try:
         ret = f(*args, **kwargs)
         return ret
     except Watererror as e:
         game_log.error(e.type)
         args[0].all_time_use = 0
         sleep(5)
         return
Exemple #3
0
def boss(groups: fightmod):
    """boss战斗"""
    if select_bossfight(1):
        return
    else:
        abnormal = usegroup(groups, 1)

    if select_bossfight(abnormal):
        return
    else:
        abnormal = usegroup(groups, 2)

    if select_bossfight(abnormal):
        return
    else:
        abnormal = usegroup(groups, 3)

    if select_wavefight(abnormal):
        return
    else:
        game_log.error("boss:no end")
Exemple #4
0
 def start(self):
     """远征全家桶"""
     if not (self.skill_room or self.receive_march or self.send_march):
         return
     try:
         # 道场续书
         exit_to_main()
         if self.skill_room:
             skill_room()
             sleep(3)
         if not mainpage_marchfind():
             mode = (self.receive_march, self.send_march)
             # 在"收+发"和"收"模式时,如果没有远征可以收就退出远征模式
             if mode == (1, 1) or mode == (1, 0):
                 game_log.info("no march is done")
                 click(1472, 717)
                 return
         go_to_march()
         # 收远征
         if self.receive_march:
             self.receive()
         # 发远征
         if not self.send_march:
             exit_to_main()
             click(1472, 717)
             sleep(3)
             return
         # 初始化
         march_list = March.initialize()
         # 远征优先级
         modelist = ["gold2", "gold1", "power", "card", "book", "nothing"]
         # 做远征
         self.send(march_list, modelist)
         game_log.info("march done")
         exit_to_main()
         click(1472, 717)
         sleep(3)
     except OvertimeError as err:
         game_log.error(err.type)
         self.start()
Exemple #5
0
def wave3(groups: fightmod):
    """三波战斗"""

    if select_wavefight():
        return
    else:
        abnormal = usegroup(groups, 1)

    if select_wavefight(abnormal):
        return
    else:
        abnormal = usegroup(groups, 2)

    if select_wavefight(abnormal):
        return
    else:
        abnormal = usegroup(groups, 3)

    if select_wavefight(abnormal):
        return
    else:
        game_log.error("wave3:no end")