基于python的明日方舟自动刷取理智的脚本(三)———与当前时间产生关联的策略

使用药剂刷取思路(药剂提供理智刷取芯片)

 源石换理智刷取分支

 

def Start_Collection(a,b):
    end = 0
    t = time.ctime()
    day = t[0:3]
    while True:
        if end ==0:
            if day =="Mon":
                n = Smash_Defense_collection()
                if n==0:
                    try:
                        Rational_Medicine()###喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    n = Smash_Defense_collection()
                    if a==1:
                        Strongly_Fortified()##激进策略
                        end = 1
                        break
                    else:
                        Strongly_Fortified_collection_pre()#保守策略
                        end = 1
                        break
                else:
                    try:
                        Rational_Medicine()#喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    if a==1:
                        Strongly_Fortified()##激进策略
                        end  = 1
                        break
                    else:
                        Strongly_Fortified_collection_pre()#保守策略
                        end  =1
                        break
            elif day =="Tue":
                n = LongMeng_collection()
                if n==0:
                    try:
                        Rational_Medicine()###喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    n = LongMeng_collection()
                    if a==1:
                        Stand_Ahead_collection()##激进策略
                        end = 1
                        break
                    else:
                        Stand_Ahead_collection_pre()#保守策略
                        end = 1
                        break
                else:
                    try:
                        Rational_Medicine()#喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    if a==1:
                        Stand_Ahead_collection()##激进策略
                        end  = 1
                        break
                    else:
                        Stand_Ahead_collection_pre()#保守策略
                        end  =1
                        break
            elif day =="Wed":
                n = Aerial_Threat_collection()
                if n==0:
                    try:
                        Rational_Medicine()###喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    n = Aerial_Threat_collection()
                    if a==1:
                        Unstoppble_collection()##激进策略
                        end = 1
                        break
                    else:
                        Unstoppble_collection_pre()#保守策略
                        end = 1
                        break
                else:
                    try:
                        Rational_Medicine()#喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    if a==1:
                        Unstoppble_collection()##激进策略
                        end  = 1
                        break
                    else:
                        Unstoppble_collection_pre()#保守策略
                        end  =1
                        break
            elif day == "Thu":
                n = LongMeng_collection()
                if n==0:
                    try:
                        Rational_Medicine()###喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    n = LongMeng_collection()
                    if a==1:
                        Unstoppble_collection()##激进策略
                        end = 1
                        break
                    else:
                        Unstoppble_collection_pre()#保守策略
                        end = 1
                        break
                else:
                    try:
                        Rational_Medicine()#喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    if a==1:
                        Unstoppble_collection()##激进策略
                        end  = 1
                        break
                    else:
                        Unstoppble_collection_pre()#保守策略
                        end  =1
                        break
            elif day == "Fri":
                n = EX_collection()
                if n==0:
                    try:
                        Rational_Medicine()###喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    n = EX_collection()
                    if a==1:
                        All_Powerful_collection()##激进策略
                        end = 1
                        break
                    else:
                        All_Powerful_collection_pre()#保守策略
                        end = 1
                        break
                else:
                    try:
                        Rational_Medicine()#喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    if a==1:
                        All_Powerful_collection()##激进策略
                        end  = 1
                        break
                    else:
                        All_Powerful_collection_pre()#保守策略
                        end  =1
                        break
            elif day =="Sat":
                n = LongMeng_collection()
                if n==0:
                    try:
                        Rational_Medicine()###喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    n = LongMeng_collection()
                    if a==1:
                        Stand_Ahead_collection()##激进策略
                        end = 1
                        break
                    else:
                        Stand_Ahead_collection_pre()#保守策略
                        end = 1
                        break
                else:
                    try:
                        Rational_Medicine()#喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    if a==1:
                        Stand_Ahead_collection()##激进策略
                        end  = 1
                        break
                    else:
                        Stand_Ahead_collection_pre()#保守策略
                        end  =1
                        break
            elif day =="Sun":
                n = EX_collection()
                if n==0:
                    try:
                        Rational_Medicine()###喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    n = EX_collection()
                    if a==1:
                        Strongly_Fortified()##激进策略
                        end = 1
                        break
                    else:
                        Strongly_Fortified_collection_pre()#保守策略
                        end = 1
                        break
                else:
                    try:
                        Rational_Medicine()#喝药
                    except:
                        print('检测到当前理智药物已无剩余')
                        end = 1
                        break
                    if a==1:
                        Strongly_Fortified()##激进策略
                        end  = 1
                        break
                    else:
                        Strongly_Fortified_collection_pre()#保守策略
                        end  =1
                        break
        else:
            pass#结束刷取
            

源石换理智部分

end = 0
    if b == 20021118:#验证口令
        while True:
            try:
                Apply_Stone()##吃石头
            except:
                print("当前未检测到源石存储")
                end = 1
                break
            if end ==0:
                if day =="Mon":
                    n =Smash_Defense_collection()
                    try:
                        Apply_Stone()##吃石头
                    except:
                        print("当前未检测到源石存储")
                        end = 1
                        break
                    if a ==1:
                        Strongly_Fortified()##激进策略
                        continue
                    else:
                        Strongly_Fortified_collection_pre()##保守策略
                        continue
                elif day =="Tue":
                    n =LongMeng_collection()
                    try:
                        Apply_Stone()##吃石头
                    except:
                        print("当前未检测到源石存储")
                        end = 1
                        break
                    if a ==1:
                        Stand_Ahead_collection()##激进策略
                        continue
                    else:
                        Stand_Ahead_collection_pre()##保守策略
                        continue
                elif day =="Wed":
                    n =Aerial_Threat_collection()
                    try:
                        Apply_Stone()##吃石头
                    except:
                        print("当前未检测到源石存储")
                        end = 1
                        break
                    if a ==1:
                        Unstoppble_collection()##激进策略
                        continue
                    else:
                        Unstoppble_collection_pre()##保守策略
                        continue
                elif day == "Thu":
                    n = LongMeng_collection()
                    try:
                        Apply_Stone()##吃石头
                    except:
                        print("当前未检测到源石存储")
                        end = 1
                        break
                    if a ==1:
                        Unstoppble_collection()##激进策略
                        continue
                    else:
                        Unstoppble_collection_pre()##保守策略
                        continue
                elif day == "Fri":
                    n = EX_collection()
                    try:
                        Apply_Stone()##吃石头
                    except:
                        print("当前未检测到源石存储")
                        end = 1
                        break
                    if a ==1:
                        All_Powerful_collection()##激进策略
                        continue
                    else:
                        All_Powerful_collection_pre()##保守策略
                        continue
                elif day =="Sat":
                    n = LongMeng_collection()
                    try:
                        Apply_Stone()##吃石头
                    except:
                        print("当前未检测到源石存储")
                        end = 1
                        break
                    if a ==1:
                        Stand_Ahead_collection()##激进策略
                        continue
                    else:
                        Stand_Ahead_collection_pre()##保守策略
                        continue
                elif day =="Sun":
                    n = EX_collection()
                    try:
                        Apply_Stone()##吃石头
                    except:
                        print("当前未检测到源石存储")
                        end = 1
                        break
                    if a ==1:
                        Strongly_Fortified()##激进策略
                        continue
                    else:
                        Strongly_Fortified_collection_pre()##保守策略
                        continue
            else:
                pass#结束刷取

具体的思路在文章开头的导图中已经呈现出来

Apply_Stone函数———————————————————————

def Apply_Stone():
    MoveAndClick(r'\Arknight\picture\Add lizhi.png',0.8)
    try:
        x,y = pyautogui.locateCenterOnScreen(r'\Arknight\picture\use stone.png',confidence = 0.8)
        MoveAndClick(r'\Arknight\picture\Confirm_lizhi.png',0.8)
    except:
        x,y = pyautogui.locateCenterOnScreen(r'\Arknight\picture\use stone_s.png')
        MoveAndClick(r'\Arknight\picture\Confirm_lizhi.png',0.8)

 模拟点击

尝试识别

成功则模拟点击

若不成功则识别

后模拟点击

——————————————————————————————————————————-

 Rational_Medicine 函—————————————————————

def Rational_Medicine():
    MoveAndClick(r'\Arknight\picture\Add lizhi.png',0.8)
    print("尝试使用理智药剂")
    try:
        time.sleep(1)
        x,y =pyautogui.locateCenterOnScreen(r'\Arknight\picture\medic.png')
        MoveAndClick(r'\Arknight\picture\Confirm_lizhi.png',0.8)
    except:
        MoveAndClick(r'\Arknight\picture\error.png',0.8)

 模拟点击

尝试识别

若成功模拟点击

否则主动报错(识别一张当前屏幕不存在的图片,然后主动抛出函数)(这是由本代码的结构决定的)

 

———————————————————————————————————————————

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值