Пример #1
0
def one_battle():
    AdbServer.tap(Button.WorkFlow.KaiShiRenWu.random_point)
    wait_action()

    servant_skill(Button.OnBattle.Skill.Skill8)
    servant_skill(Button.OnBattle.Skill.Skill9)
    servant_skill(Button.OnBattle.Skill.Skill1,
                  Button.OnBattle.Skill.Servant.p2)
    choose_card(Button.OnBattle.NoblePhantasm.NP2, Button.OnBattle.Card.Card1,
                Button.OnBattle.Card.Card2)
    servant_skill(Button.OnBattle.Skill.Skill7,
                  Button.OnBattle.Skill.Servant.p2)
    change_servant(Button.OnBattle.MasterMenu.Exchange.p3,
                   Button.OnBattle.MasterMenu.Exchange.p4)
    servant_skill(Button.OnBattle.Skill.Skill7,
                  Button.OnBattle.Skill.Servant.p2)
    servant_skill(Button.OnBattle.Skill.Skill9,
                  Button.OnBattle.Skill.Servant.p2)
    servant_skill(Button.OnBattle.Skill.Skill6)
    choose_card(Button.OnBattle.NoblePhantasm.NP2, Button.OnBattle.Card.Card1,
                Button.OnBattle.Card.Card2)
    servant_skill(Button.OnBattle.Skill.Skill3,
                  Button.OnBattle.Skill.Servant.p2)
    servant_skill(Button.OnBattle.Skill.Skill2)
    servant_skill(Button.OnBattle.Skill.Skill8)
    master_skill(Button.OnBattle.MasterMenu.Skill1)
    choose_card(Button.OnBattle.NoblePhantasm.NP2, Button.OnBattle.Card.Card1,
                Button.OnBattle.Card.Card2)
Пример #2
0
def end_battle():
    wait_appear(Asset.WorkFlow.ZhanDouJieGuo, 1)
    while Asset.WorkFlow.ZhanDouJieGuo.match():
        AdbServer.tap(Button.WorkFlow.DianJiHuaMian.random_point)
        AdbServer.screen_cap()
    while Asset.WorkFlow.XiaYiBu.match():
        AdbServer.tap(Button.WorkFlow.XiaYiBu.random_point)
        AdbServer.screen_cap()
    AdbServer.wait_second(10)
Пример #3
0
def wait_action():
    AdbServer.screen_cap()
    while not Asset.OnBattle.Attack.match():
        Log.record('waiting...')
        AdbServer.wait_second(0.5)
        AdbServer.screen_cap()
    AdbServer.wait_second(1)  # 这个地方要加一点延迟,否则会有BUG,具体的原因我也不是很清楚
Пример #4
0
def check_ap() -> bool:
    AdbServer.screen_cap()
    if Asset.WorkFlow.ApNotEnough.match():
        Log.record('ApNotEnough')
        AdbServer.tap(Button.WorkFlow.Apple.Golden.random_point)
        AdbServer.wait_second(0.5)
        AdbServer.tap(Button.WorkFlow.Apple.JueDing.random_point)
        return False
    else:
        return True
Пример #5
0
def servant_skill(skill: BaseButton, servant=Button.NullButton):
    wait_action()
    Log.record('servant_skill')
    AdbServer.tap(skill.random_point)
    if servant != Button.NullButton:
        AdbServer.wait_second(0.25)
        AdbServer.tap(servant.random_point)
Пример #6
0
def change_servant(servant1: BaseButton, servant2: BaseButton):
    wait_action()
    Log.record('change_servant')
    AdbServer.tap(Button.OnBattle.MasterMenu.Open.random_point)
    AdbServer.wait_second(0.25)
    AdbServer.tap(Button.OnBattle.MasterMenu.Skill3.random_point)
    AdbServer.wait_second(0.5)
    AdbServer.tap(servant1.random_point)
    AdbServer.wait_second(0.1)
    AdbServer.tap(servant2.random_point)
    AdbServer.wait_second(0.1)
    AdbServer.tap(Button.OnBattle.MasterMenu.Exchange.Change.random_point)
    AdbServer.wait_second(5)
Пример #7
0
def master_skill(skill: BaseButton):
    wait_action()
    Log.record('master_skill')
    AdbServer.tap(Button.OnBattle.MasterMenu.Open.random_point)
    AdbServer.wait_second(0.25)
    AdbServer.tap(skill.random_point)
Пример #8
0
def wait_appear(asset, wait_time):
    AdbServer.screen_cap()
    while not asset.match():
        AdbServer.wait_second(wait_time)
        AdbServer.screen_cap()
Пример #9
0
def choose_card(card1: BaseButton, card2: BaseButton, card3: BaseButton):
    wait_action()
    Log.record('choosing cards')
    AdbServer.tap(Button.OnBattle.Attack.random_point)
    AdbServer.wait_second(1)
    AdbServer.tap(card3.random_point)
    AdbServer.wait_second(0.2)
    AdbServer.tap(card3.random_point)
    AdbServer.wait_second(0.2)
    AdbServer.tap(card1.random_point)
    AdbServer.wait_second(0.2)
    AdbServer.tap(card2.random_point)
    AdbServer.wait_second(0.2)
    AdbServer.tap(card3.random_point)
    AdbServer.wait_second(10)
Пример #10
0
def battle_start():
    wait_appear(Asset.RenWuXvanZe.ShanShanJi.JueSai_GuangChangHuaYuan, 1)
    AdbServer.tap(Button.WorkFlow.GuanQia.random_point)
    AdbServer.wait_second(0.5)
    if not check_ap():
        AdbServer.tap(Button.WorkFlow.GuanQia.random_point)
Пример #11
0
                  Button.OnBattle.Skill.Servant.p2)
    choose_card(Button.OnBattle.NoblePhantasm.NP2, Button.OnBattle.Card.Card1,
                Button.OnBattle.Card.Card2)
    servant_skill(Button.OnBattle.Skill.Skill7,
                  Button.OnBattle.Skill.Servant.p2)
    change_servant(Button.OnBattle.MasterMenu.Exchange.p3,
                   Button.OnBattle.MasterMenu.Exchange.p4)
    servant_skill(Button.OnBattle.Skill.Skill7,
                  Button.OnBattle.Skill.Servant.p2)
    servant_skill(Button.OnBattle.Skill.Skill9,
                  Button.OnBattle.Skill.Servant.p2)
    servant_skill(Button.OnBattle.Skill.Skill6)
    choose_card(Button.OnBattle.NoblePhantasm.NP2, Button.OnBattle.Card.Card1,
                Button.OnBattle.Card.Card2)
    servant_skill(Button.OnBattle.Skill.Skill3,
                  Button.OnBattle.Skill.Servant.p2)
    servant_skill(Button.OnBattle.Skill.Skill2)
    servant_skill(Button.OnBattle.Skill.Skill8)
    master_skill(Button.OnBattle.MasterMenu.Skill1)
    choose_card(Button.OnBattle.NoblePhantasm.NP2, Button.OnBattle.Card.Card1,
                Button.OnBattle.Card.Card2)


if __name__ == '__main__':
    AdbServer.start_server()
    while True:
        battle_start()
        choose_support()
        one_battle()
        end_battle()