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

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

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

 源石换理智刷取分支

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

 

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)

 模拟点击

尝试识别

若成功模拟点击

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

 

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

你可能感兴趣的:(python,开发语言,自动化)