|
@@ -0,0 +1,559 @@
|
|
|
|
+# -*- coding: utf-8 -*-
|
|
|
|
+from scriptBase.imgFind import pcacc_img, savePic
|
|
|
|
+from scriptBase.mouseClick import pcacc_mouse
|
|
|
|
+from scriptBase.ocr import capture_and_ocr
|
|
|
|
+
|
|
|
|
+import scriptBase.base
|
|
|
|
+from scriptBase.comon import *
|
|
|
|
+from scriptBase.ocr import *
|
|
|
|
+from apscheduler.schedulers.blocking import BlockingScheduler
|
|
|
|
+import pyautogui
|
|
|
|
+import random
|
|
|
|
+import sys
|
|
|
|
+import math
|
|
|
|
+import os
|
|
|
|
+import time
|
|
|
|
+from dongri_define import *
|
|
|
|
+from dongri_pic import *
|
|
|
|
+import subprocess
|
|
|
|
+import socket
|
|
|
|
+from dongri_pic import _imported
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+'''
|
|
|
|
+基础配置说明:
|
|
|
|
+600*800(DPI 300)
|
|
|
|
+游戏画面:流畅
|
|
|
|
+高帧率关闭
|
|
|
|
+町中模式:旧版
|
|
|
|
+
|
|
|
|
+'''
|
|
|
|
+
|
|
|
|
+def task_getComputerName():
|
|
|
|
+ return socket.gethostname()
|
|
|
|
+
|
|
|
|
+def task_acceptTask():
|
|
|
|
+ while True:
|
|
|
|
+ myTimeSleep_big()
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def init():
|
|
|
|
+ global _imported
|
|
|
|
+ if not _imported:
|
|
|
|
+ acceptTask = threading.Thread(target=task_acceptTask)
|
|
|
|
+ acceptTask.daemon = True
|
|
|
|
+ if acceptTask.is_alive() == False:
|
|
|
|
+ acceptTask.start()
|
|
|
|
+ _imported = True
|
|
|
|
+
|
|
|
|
+class basic_operate:
|
|
|
|
+ @staticmethod
|
|
|
|
+ def do_back():
|
|
|
|
+ task_return_game()
|
|
|
|
+ ret = False
|
|
|
|
+ ret |= waitClickImg_noWait_withBool(place_img.back1, 0.6, 0)
|
|
|
|
+ if ret:
|
|
|
|
+ return
|
|
|
|
+ ret |= waitClickImg_noWait_withBool(place_img.back2, 0.6, 0)
|
|
|
|
+ if ret:
|
|
|
|
+ return
|
|
|
|
+ ret |= waitClickImg_noWait_withBool(place_img.back3, 0.6, 0)
|
|
|
|
+ if ret:
|
|
|
|
+ return
|
|
|
|
+ ret, pos = waitFindImg(place_img.title, 1, 0)
|
|
|
|
+ if ret:
|
|
|
|
+ pcacc_mouse.click(pos[0], pos[1] + 40)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ def backToGame(preTime = 0):
|
|
|
|
+ tryMaxTimes = 5
|
|
|
|
+ while tryMaxTimes > 0:
|
|
|
|
+ tryMaxTimes -= 1
|
|
|
|
+ if waitFindImg_withBool(place_img.gameIn, 1, preTime) == False:
|
|
|
|
+ basic_operate.do_back()
|
|
|
|
+ else:
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ @staticmethod
|
|
|
|
+ def go_town(preTime = 0):
|
|
|
|
+ if basic_operate.backToGame(preTime) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ waitClickImg_noWait_withBool(place_img.outside, 0.6, 0)
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ @staticmethod
|
|
|
|
+ def go_outside(preTime = 0):
|
|
|
|
+ if basic_operate.backToGame(preTime) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ waitClickImg_noWait_withBool(place_img.town, 0.6, 0)
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ @staticmethod
|
|
|
|
+ def click_outside_search():
|
|
|
|
+ taskListRet, taskListPos = waitFindImg(monster_img.tasklist, 2, 3)
|
|
|
|
+ if taskListRet == False:
|
|
|
|
+ return False
|
|
|
|
+ else:
|
|
|
|
+ pcacc_mouse.click(taskListPos[0], taskListPos[1] - 110)#click search
|
|
|
|
+
|
|
|
|
+ myTimeSleep_big()
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ @staticmethod
|
|
|
|
+ def enter_auto_supply_resource(enter_pic):
|
|
|
|
+ if waitClickImg_noWait_withBool(enter_pic, 2, 2) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ if waitClickImg_noWait_withBool(train_img.getAll, 2, 1) == False:
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ if waitClickImg_noWait_withBool(train_img.enter, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ if waitClickImg_noWait_withBool(enter_pic, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+ @staticmethod
|
|
|
|
+ def return_line():
|
|
|
|
+ if waitClickImg_noWait_withBool(monster_img.returnLine, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(monster_img.enter, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def task_return_game():
|
|
|
|
+ tryTimes = 3
|
|
|
|
+ while tryTimes > 0:
|
|
|
|
+ if False == waitFindImg_withBool([place_img.title], 1, 1):
|
|
|
|
+ waitClickImg_noWait([place_img.ico, place_img.ico2], 1, 0)
|
|
|
|
+ myTimeSleep_big()
|
|
|
|
+ tryTimes -= 1
|
|
|
|
+ if tryTimes == 0:
|
|
|
|
+ return False
|
|
|
|
+ else:
|
|
|
|
+ break
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def task_save_compress_pic():
|
|
|
|
+ # 截取屏幕截图
|
|
|
|
+ screenshot = pyautogui.screenshot()
|
|
|
|
+ compressed_data = compress_image(screenshot)
|
|
|
|
+
|
|
|
|
+ # 保存压缩后的图像到文件
|
|
|
|
+ with open('compressed_screenshot.jpg', 'wb') as f:
|
|
|
|
+ f.write(compressed_data)
|
|
|
|
+
|
|
|
|
+def task_close_game():
|
|
|
|
+ subprocess.call(f"taskkill /f /im MuMuPlayer.exe")
|
|
|
|
+ subprocess.call(f"taskkill /f /im MuMuVMMHeadless.exe")
|
|
|
|
+ subprocess.call(f"taskkill /f /im MuMuVMMSVC.exe")
|
|
|
|
+ myTimeSleep_big()
|
|
|
|
+
|
|
|
|
+def task_start_game():
|
|
|
|
+ isSuccess = True
|
|
|
|
+ path1 = R'C:\\Program Files\\Netease\\MuMuPlayer-12.0\\shell\\MuMuPlayer.exe'
|
|
|
|
+ path2 = R'C:\Program Files\Netease\MuMu Player 12\shell\MuMuPlayer.exe'
|
|
|
|
+ if os.path.exists(path1):
|
|
|
|
+ subprocess.Popen(path1)
|
|
|
|
+ elif os.path.exists(path2):
|
|
|
|
+ subprocess.Popen(path2)
|
|
|
|
+ if waitClickImg_withBool(gameStart_img.ico, 100, 20) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ waitFindImg_withBool(place_img.gameIn, 10, 20)
|
|
|
|
+ basic_operate.go_town()
|
|
|
|
+ waitFindImg_withBool(place_img.gameIn, 10, 20)
|
|
|
|
+ basic_operate.go_town()
|
|
|
|
+ if waitFindImg_withBool(place_img.gameIn, 10, 20) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ myTimeSleep_big()
|
|
|
|
+
|
|
|
|
+ return isSuccess
|
|
|
|
+
|
|
|
|
+class dongri_task:
|
|
|
|
+ def __init__(self, name):
|
|
|
|
+ self.name = name
|
|
|
|
+
|
|
|
|
+ def run(self):
|
|
|
|
+ print(f"Running task: {self.name}")
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+class task_fightMonster(dongri_task):
|
|
|
|
+ def __init__(self, add_strengh, fight_bigMonster):
|
|
|
|
+ super().__init__(f"战斗怪物")
|
|
|
|
+ self.add_strengh = add_strengh
|
|
|
|
+ if fight_bigMonster == True:
|
|
|
|
+ self.monster = monster_img.bigMonster
|
|
|
|
+ self.attack = monster_img.muti_team
|
|
|
|
+ else:
|
|
|
|
+ self.monster = monster_img.wolf
|
|
|
|
+ self.attack = monster_img.attack
|
|
|
|
+
|
|
|
|
+ def run(self):
|
|
|
|
+ basic_operate.go_outside()
|
|
|
|
+
|
|
|
|
+ if False == basic_operate.click_outside_search():
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ if False == waitFindImg_withBool(monster_img.enough_strengh, 2, 1):
|
|
|
|
+ print("没有足够的体力了")
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ if waitFindImg_withBool(monster_img.search, 2, 1):
|
|
|
|
+ myTimeSleep_big()
|
|
|
|
+ yys_dragAuto(monster_img.move_left)
|
|
|
|
+ if waitClickImg_noWait_withBool(self.monster, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(monster_img.search, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(self.attack, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ waitClickImg_noWait_withBool(monster_img.begin_multi, 2, 1)
|
|
|
|
+ if waitClickImg_noWait_withBool(monster_img.line1, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitFindImg_withBool(monster_img.no_hero, 2, 1) == True:
|
|
|
|
+ return False
|
|
|
|
+ waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
|
|
|
|
+ waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
|
|
|
|
+
|
|
|
|
+ maxTryTimes = 3
|
|
|
|
+ while maxTryTimes > 0:
|
|
|
|
+ maxTryTimes -= 1
|
|
|
|
+ waitClickImg_withBool([monster_img.fight, monster_img.fight2], 2, 1)
|
|
|
|
+ waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
|
|
|
|
+
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+class task_collect(dongri_task):
|
|
|
|
+ def __init__(self, type = 0):
|
|
|
|
+ if type == 0:
|
|
|
|
+ typeArr = [4,3,2,1]
|
|
|
|
+ type = typeArr[random.randint(0, len(typeArr) - 1)]
|
|
|
|
+ elif type == 5:
|
|
|
|
+ typeArr = [2,1]
|
|
|
|
+ type = typeArr[random.randint(0, len(typeArr) - 1)]
|
|
|
|
+
|
|
|
|
+ if type == 1:
|
|
|
|
+ self.type = monster_img.meat
|
|
|
|
+ self.line = monster_img.line2
|
|
|
|
+ super().__init__(f"采集肉")
|
|
|
|
+ elif type == 2:
|
|
|
|
+ self.type = monster_img.wood
|
|
|
|
+ self.line = monster_img.line3
|
|
|
|
+ super().__init__(f"采集木头")
|
|
|
|
+ elif type == 3:
|
|
|
|
+ self.type = monster_img.mine
|
|
|
|
+ self.line = None
|
|
|
|
+ super().__init__(f"采矿石")
|
|
|
|
+ elif type == 4:
|
|
|
|
+ self.type = monster_img.iron
|
|
|
|
+ self.line = None
|
|
|
|
+ super().__init__(f"采集铁矿石")
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ def run(self):
|
|
|
|
+ basic_operate.go_outside()
|
|
|
|
+ if False == basic_operate.click_outside_search():
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ if waitFindImg_withBool(monster_img.search, 2, 1):
|
|
|
|
+ myTimeSleep_big()
|
|
|
|
+ yys_dragAuto(monster_img.move_right)
|
|
|
|
+
|
|
|
|
+ if waitClickImg_noWait_withBool(self.type, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(monster_img.search, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_withBool(monster_img.collect, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ if self.line != None:
|
|
|
|
+ waitClickImg_noWait_withBool(self.line, 2, 1)
|
|
|
|
+
|
|
|
|
+ waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
|
|
|
|
+ waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
|
|
|
|
+
|
|
|
|
+ maxTryTimes = 3
|
|
|
|
+ while maxTryTimes > 0:
|
|
|
|
+ maxTryTimes -= 1
|
|
|
|
+ waitClickImg_withBool([monster_img.fight, monster_img.fight2], 2, 1)
|
|
|
|
+ waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+class task_train(dongri_task):
|
|
|
|
+ def __init__(self):
|
|
|
|
+ super().__init__(f"检查训练")
|
|
|
|
+ def run(self):
|
|
|
|
+ basic_operate.go_town()
|
|
|
|
+ if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(train_img.train_success, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ tryTimes = 3
|
|
|
|
+ while tryTimes > 0:
|
|
|
|
+ tryTimes -= 1
|
|
|
|
+ waitClickImg_noWait_withBool([train_img.dun, train_img.gong, train_img.mao], 2, 1)
|
|
|
|
+
|
|
|
|
+ if waitClickImg_noWait_withBool(train_img.train, 2, 1):
|
|
|
|
+ break
|
|
|
|
+ return basic_operate.enter_auto_supply_resource(train_img.begin_train)
|
|
|
|
+
|
|
|
|
+class task_checkHelp(dongri_task):
|
|
|
|
+ def __init__(self, isOutSide = False):
|
|
|
|
+ super().__init__(f"检查帮助")
|
|
|
|
+ self.isOutSide = isOutSide
|
|
|
|
+ def run(self):
|
|
|
|
+ if self.isOutSide:
|
|
|
|
+ basic_operate.go_outside()
|
|
|
|
+ else:
|
|
|
|
+ basic_operate.go_town()
|
|
|
|
+ waitClickImg_noWait_withBool(place_img.help, 2, 1)
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+class task_checkStoreRoom(dongri_task):
|
|
|
|
+ def __init__(self):
|
|
|
|
+ super().__init__(f"检查仓库")
|
|
|
|
+ def run(self):
|
|
|
|
+ basic_operate.go_town()
|
|
|
|
+ if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ myTimeSleep_big()
|
|
|
|
+ yys_dragAuto(check_img.move_down)
|
|
|
|
+ if waitClickImg_noWait_withBool(train_img.train_success, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ myTimeSleep_big()
|
|
|
|
+ pcacc_mouse.quickclick_current()
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.storeroom, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+class task_checkConfilits(dongri_task):
|
|
|
|
+ def __init__(self):
|
|
|
|
+ super().__init__(f"检查集结")
|
|
|
|
+ def run(self):
|
|
|
|
+ basic_operate.go_outside()
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.conflits, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.paticipate, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.auto_confilit, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+class task_checkDonata(dongri_task):
|
|
|
|
+ def __init__(self):
|
|
|
|
+ super().__init__(f"检查捐献")
|
|
|
|
+ def run(self):
|
|
|
|
+ basic_operate.go_town()
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.union, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.union_technology, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.technology_better, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_withBool([check_img.donate, check_img.donate2], 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ else:
|
|
|
|
+ maxTryTimes = 3
|
|
|
|
+ while waitClickImg_withBool([check_img.donate, check_img.donate2], 1, 0) and maxTryTimes > 0:
|
|
|
|
+ maxTryTimes -= 1
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+class task_checkAdventure(dongri_task):
|
|
|
|
+ def __init__(self):
|
|
|
|
+ super().__init__(f"检查冒险")
|
|
|
|
+ def run(self):
|
|
|
|
+ basic_operate.go_town()
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.adventure, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.get, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.bigGet, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+class task_waitTime(dongri_task):
|
|
|
|
+ def __init__(self):
|
|
|
|
+ super().__init__(f"等待时间")
|
|
|
|
+ def run(self):
|
|
|
|
+ myTimeSleep(300)
|
|
|
|
+
|
|
|
|
+class check_buildOrResearch(dongri_task):
|
|
|
|
+ def __init__(self):
|
|
|
|
+ super().__init__(f"检查建筑或研究")
|
|
|
|
+ def run(self):
|
|
|
|
+ basic_operate.go_town()
|
|
|
|
+ if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.needgo, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ dstType = 'none'
|
|
|
|
+ while True:
|
|
|
|
+ if waitFindImg_withBool([check_img.upgrade_done, check_img.upgrade_done2, check_img.upgrade_done3, check_img.upgrade_next], 2, 1):
|
|
|
|
+ dstType = 'build'
|
|
|
|
+ break
|
|
|
|
+ handRet, handPos = waitFindImg(check_img.hand, 2, 1)
|
|
|
|
+ if not handRet:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ detailRet, detailPos = waitFindImg(check_img.detail, 2, 1)
|
|
|
|
+ dstPos = [0, 0]
|
|
|
|
+ if not detailRet:
|
|
|
|
+ # 如果找不到详细信息,兵营之类的,需点中间
|
|
|
|
+ dstPos = [handPos[0] - 70, handPos[1] + 120]
|
|
|
|
+ else:
|
|
|
|
+ dstPos = [detailPos[0] + 70, detailPos[1] - 100]
|
|
|
|
+
|
|
|
|
+ tryTimes = 5
|
|
|
|
+
|
|
|
|
+ while tryTimes > 0:
|
|
|
|
+ tryTimes -= 1
|
|
|
|
+ myTimeSleep_big()
|
|
|
|
+ pcacc_mouse.click(dst_x=dstPos[0], dst_y=dstPos[1])
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.research, 2, 1):
|
|
|
|
+ dstType = 'research'
|
|
|
|
+ break
|
|
|
|
+ elif waitClickImg_noWait_withBool(check_img.build_upgrade, 2, 1):
|
|
|
|
+ dstType = 'build'
|
|
|
|
+ break
|
|
|
|
+ break
|
|
|
|
+ if dstType == 'none':
|
|
|
|
+ print('没有找到建筑或研究')
|
|
|
|
+ return False
|
|
|
|
+ elif dstType == 'build':
|
|
|
|
+ while basic_operate.enter_auto_supply_resource([check_img.upgrade_done, check_img.upgrade_done2, check_img.upgrade_done3, check_img.upgrade_next]):
|
|
|
|
+ continue
|
|
|
|
+ elif dstType == 'research':
|
|
|
|
+ if waitClickImg_withBool([check_img.research_type1, check_img.research_type2], 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if basic_operate.enter_auto_supply_resource(check_img.research_done) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ waitClickImg_withBool([check_img.help, check_img.help2, check_img.help3], 2, 2)
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+class task_information(dongri_task):
|
|
|
|
+ def __init__(self):
|
|
|
|
+ super().__init__(f"检查情报")
|
|
|
|
+ def run(self):
|
|
|
|
+ basic_operate.go_outside()
|
|
|
|
+ if waitClickImg_noWait_withBool(information_img.information, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ if waitClickImg_noWait_withBool([information_img.hero0, information_img.hero1, information_img.hero2], 2, 1):
|
|
|
|
+ if waitClickImg_noWait_withBool(information_img.gotosee, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(information_img.explore, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(information_img.hero_fight, 2, 1) == False:
|
|
|
|
+ waitClickImg_noWait(information_img.add_strength, 1, 1)
|
|
|
|
+ waitClickImg_noWait(information_img.add_strength, 1, 1)
|
|
|
|
+ waitClickImg_noWait(information_img.add_strength, 1, 1)
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ myTimeSleep_big()
|
|
|
|
+ return True
|
|
|
|
+ elif waitClickImg_noWait_withBool([information_img.camp1, information_img.camp2], 2, 1):
|
|
|
|
+ if waitClickImg_noWait_withBool(information_img.gotosee, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(information_img.survive, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ waitClickImg_noWait(information_img.add_strength, 1, 1)
|
|
|
|
+ waitClickImg_noWait(information_img.add_strength, 1, 1)
|
|
|
|
+ waitClickImg_noWait(information_img.add_strength, 1, 1)
|
|
|
|
+ return True
|
|
|
|
+ elif waitClickImg_noWait_withBool([information_img.wolf0, information_img.wolf1, information_img.wolf2], 2, 1):
|
|
|
|
+ if waitClickImg_noWait_withBool(information_img.gotosee, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(information_img.fight, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(monster_img.line1, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_withBool([monster_img.fight, monster_img.fight2], 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ waitClickImg_noWait(information_img.add_strength, 1, 1)
|
|
|
|
+ waitClickImg_noWait(information_img.add_strength, 1, 1)
|
|
|
|
+ waitClickImg_noWait(information_img.add_strength, 1, 1)
|
|
|
|
+ return True
|
|
|
|
+ else:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+class task_returnAllLine(dongri_task):
|
|
|
|
+ def __init__(self):
|
|
|
|
+ super().__init__(f"返回所有路线")
|
|
|
|
+ def run(self):
|
|
|
|
+ basic_operate.go_outside()
|
|
|
|
+ basic_operate.return_line()
|
|
|
|
+ basic_operate.return_line()
|
|
|
|
+ basic_operate.return_line()
|
|
|
|
+ basic_operate.return_line()
|
|
|
|
+ basic_operate.return_line()
|
|
|
|
+ basic_operate.return_line()
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+class task_paticipateInTeam(dongri_task):
|
|
|
|
+ def __init__(self):
|
|
|
|
+ super().__init__(f"参与队伍")
|
|
|
|
+ def run(self):
|
|
|
|
+ basic_operate.go_outside()
|
|
|
|
+ if waitClickImg_noWait_withBool(check_img.conflits, 2, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+ if waitClickImg_noWait_withBool(monster_img.participate, 1, 1) == False:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ while True:
|
|
|
|
+ if waitClickImg_noWait_withBool(monster_img.line1, 0.1, 1) == False:
|
|
|
|
+ break
|
|
|
|
+ if waitFindImg_withBool(monster_img.no_hero, 0.1, 1) == False:
|
|
|
|
+ break
|
|
|
|
+ if waitClickImg_noWait_withBool(monster_img.line4, 0.1, 1) == False:
|
|
|
|
+ break
|
|
|
|
+ if waitFindImg_withBool(monster_img.no_hero, 0.1, 1) == False:
|
|
|
|
+ break
|
|
|
|
+ break
|
|
|
|
+
|
|
|
|
+ waitClickImg_noWait_withBool(monster_img.all_select, 0.1, 1)
|
|
|
|
+ waitClickImg_noWait_withBool(monster_img.all_select, 0.1, 1)
|
|
|
|
+
|
|
|
|
+ maxTryTimes = 3
|
|
|
|
+ while maxTryTimes > 0:
|
|
|
|
+ maxTryTimes -= 1
|
|
|
|
+ waitClickImg_withBool([monster_img.fight, monster_img.fight2], 1, 1)
|
|
|
|
+ if False == waitClickImg_noWait_withBool(monster_img.all_select, 1, 1):
|
|
|
|
+ break
|
|
|
|
+ return True
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+if __name__ == '__main__':
|
|
|
|
+ #basic_operate.go_town()
|
|
|
|
+ #task_fightMonster(False, True).run()
|
|
|
|
+ #task_checkHelp().run()
|
|
|
|
+ #task_checkStoreRoom().run()
|
|
|
|
+ #task_collect().run()
|
|
|
|
+ #task_train().run()
|
|
|
|
+ #task_information().run()
|
|
|
|
+ #check_buildOrResearch().run()
|
|
|
|
+ task_checkDonata().run()
|
|
|
|
+ #task_collect(1).run()
|
|
|
|
+ #task_collect(2).run()
|
|
|
|
+ #task_collect(3).run()
|
|
|
|
+ #task_collect(4).run()
|
|
|
|
+ #task_returnAllLine().run()
|
|
|
|
+ #task_paticipateInTeam().run()
|