dongri_task.py 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805
  1. # -*- coding: utf-8 -*-
  2. import threading
  3. from scriptBase.imgFind import pcacc_img, savePic, set_isDown
  4. from scriptBase.mouseClick import pcacc_mouse
  5. from scriptBase.ocr import capture_and_ocr
  6. import scriptBase.base
  7. from scriptBase.comon import *
  8. from scriptBase.ocr import *
  9. from apscheduler.schedulers.blocking import BlockingScheduler
  10. import pyautogui
  11. import random
  12. import sys
  13. import math
  14. import os
  15. import time
  16. from dongri_define import *
  17. from dongri_pic import *
  18. import subprocess
  19. import socket
  20. from datetime import datetime, timedelta
  21. import datetime as dt
  22. '''
  23. 基础配置说明:
  24. 600*800(DPI 300)
  25. 游戏画面:流畅
  26. 高帧率关闭
  27. 町中模式:旧版
  28. '''
  29. todo_msg = ''
  30. todo_list = []
  31. g_task_lineCheck = False
  32. g_nextTaskTime = time.time()
  33. def set_nextTaskTime(val):
  34. global g_nextTaskTime
  35. g_nextTaskTime = val + time.time()
  36. def get_nextTaskTime():
  37. global g_nextTaskTime
  38. ret = g_nextTaskTime - time.time()
  39. if ret < 0:
  40. return 0
  41. return ret
  42. def set_lineCheck(val):
  43. global g_task_lineCheck
  44. g_task_lineCheck = val
  45. def get_todo_msg():
  46. global todo_msg
  47. return todo_msg
  48. def get_todo_msgList():
  49. global todo_list
  50. todo_str = ''
  51. for item in todo_list:
  52. todo_str += f'{item["item"]}:{item["time"]}</br>'
  53. return todo_str
  54. def get_todo_time(todo_str):
  55. global todo_list
  56. for item in todo_list:
  57. if item['item'] == todo_str:
  58. return item['time']
  59. return None
  60. def is_within_n_minutes(target_time_str, n_minutes_left, n_minutes_right):
  61. if target_time_str == None or type(target_time_str) is not str:
  62. return False
  63. # 获取当前时间
  64. now = datetime.now()
  65. # 解析目标时间字符串
  66. try:
  67. target_time = datetime.strptime(target_time_str, "%H:%M")
  68. # 将目标时间的日期部分设置为当前日期
  69. target_time = target_time.replace(year=now.year, month=now.month, day=now.day)
  70. except ValueError:
  71. return False
  72. # 计算时间范围
  73. start_time = target_time - timedelta(minutes=n_minutes_left)
  74. end_time = target_time + timedelta(minutes=n_minutes_right)
  75. # 检查当前时间是否在范围内
  76. return start_time <= now <= end_time
  77. def fing_todoList_time(taskStr):
  78. for item in todo_list:
  79. if item['task'] == taskStr:
  80. return item['time']
  81. def task_getComputerName():
  82. return socket.gethostname()
  83. def task_acceptTask():
  84. while True:
  85. myTimeSleep_big()
  86. class basic_operate:
  87. @staticmethod
  88. def do_back():
  89. task_return_game()
  90. ret = False
  91. if waitFindImg_withBool([place_img.outside, place_img.town], 0.1, 0) == True:
  92. return True
  93. ret |= waitClickImg_noWait_withBool(place_img.back1, 0.6, 0)
  94. if ret:
  95. return ret
  96. ret |= waitClickImg_noWait_withBool([place_img.back2, place_img.back4], 0.6, 0)
  97. if ret:
  98. return ret
  99. ret, pos = waitFindImg(place_img.title, 1, 0)
  100. if ret:
  101. pcacc_mouse.click(pos[0] - 20, pos[1] + 80)
  102. @staticmethod
  103. def backToGame(preTime = 0):
  104. tryMaxTimes = 5
  105. while tryMaxTimes > 0:
  106. tryMaxTimes -= 1
  107. if waitFindImg_withBool((place_img.gameIn, place_img.gameIn2), 1, preTime) == False:
  108. basic_operate.do_back()
  109. else:
  110. return True
  111. return False
  112. @staticmethod
  113. def go_town(preTime = 0):
  114. if basic_operate.backToGame(preTime) == False:
  115. return False
  116. waitClickImg_noWait_withBool(place_img.outside, 0.6, 0.5)
  117. waitFindImg_withBool(place_img.town, 2, 0.5)
  118. return True
  119. @staticmethod
  120. def go_outside(preTime = 0):
  121. if basic_operate.backToGame(preTime) == False:
  122. return False
  123. waitClickImg_noWait_withBool(place_img.town, 0.6, 0.5)
  124. waitFindImg_withBool(place_img.outside, 2, 0.5)
  125. return True
  126. @staticmethod
  127. def click_outside_search():
  128. taskListRet, taskListPos = waitFindImg(monster_img.tasklist, 2, 3)
  129. if taskListRet == False:
  130. return False
  131. else:
  132. pcacc_mouse.click(taskListPos[0], taskListPos[1] - 110)#click search
  133. myTimeSleep_big()
  134. return True
  135. @staticmethod
  136. def enter_auto_supply_resource(enter_pic):
  137. if waitClickImg_noWait_withBool(enter_pic, 2, 2) == False:
  138. return False
  139. if waitClickImg_noWait_withBool(train_img.getAll, 2, 1) == False:
  140. return True
  141. if waitClickImg_noWait_withBool(train_img.enter, 2, 1) == False:
  142. return False
  143. if waitClickImg_noWait_withBool(enter_pic, 2, 1) == False:
  144. return False
  145. return True
  146. @staticmethod
  147. def return_line():
  148. if waitClickImg_noWait_withBool(monster_img.returnLine, 1, 0.5) == False:
  149. return False
  150. if waitClickImg_noWait_withBool(monster_img.enter, 2, 1) == False:
  151. return False
  152. return True
  153. @staticmethod
  154. def add_strength():
  155. if waitClickImg_noWait_withBool(check_img.no_strength, 2, 1) == False:
  156. return False
  157. if waitClickImg_noWait_withBool(check_img.add_strength, 2, 1) == False:
  158. return False
  159. if waitClickImg_noWait_withBool(information_img.add_strength, 2, 1) == False:
  160. return False
  161. if waitClickImg_noWait_withBool(information_img.add_strength, 2, 1) == False:
  162. return False
  163. if waitClickImg_noWait_withBool(information_img.add_strength, 2, 1) == False:
  164. return False
  165. return True
  166. @staticmethod
  167. def get_line_num2():
  168. lineStr = yys_ocrAuto(check_img.line_orc)
  169. if len(lineStr) == 0:
  170. return 0
  171. match = re.search(r'\d', lineStr[0]) # 查找第一个数字
  172. if match:
  173. first_digit = match.group()
  174. print("第一个数字:", first_digit)
  175. return int(first_digit)
  176. else:
  177. print("未找到数字")
  178. return 0
  179. @staticmethod
  180. def get_line_num():
  181. meat_num = len(pcacc_img.find_all_image_locations(check_img.on_meat))
  182. wood_num = len(pcacc_img.find_all_image_locations(check_img.on_wood))
  183. mine_num = len(pcacc_img.find_all_image_locations(check_img.on_mine))
  184. stone_num = len(pcacc_img.find_all_image_locations(check_img.on_stone))
  185. return meat_num + wood_num + mine_num + stone_num
  186. @staticmethod
  187. def get_line_num_mix():
  188. num1 = basic_operate.get_line_num()
  189. num2 = basic_operate.get_line_num2()
  190. return max(num1, num2)
  191. def task_return_game():
  192. tryTimes = 3
  193. while tryTimes > 0:
  194. if False == waitFindImg_withBool([place_img.title], 2, 0):
  195. waitClickImg_noWait([place_img.ico, place_img.ico2, place_img.ico3], 1, 0)
  196. myTimeSleep_big()
  197. tryTimes -= 1
  198. if tryTimes == 0:
  199. return False
  200. else:
  201. break
  202. def task_save_compress_pic():
  203. # 截取屏幕截图
  204. screenshot = pyautogui.screenshot()
  205. compressed_data = compress_image(screenshot)
  206. # 保存压缩后的图像到文件
  207. with open('compressed_screenshot.jpg', 'wb') as f:
  208. f.write(compressed_data)
  209. def task_close_game():
  210. subprocess.call(f"taskkill /f /im MuMuNxDevice.exe")
  211. subprocess.call(f"taskkill /f /im MuMuNxMain.exe")
  212. subprocess.call(f"taskkill /f /im MuMuVMMHeadless.exe")
  213. subprocess.call(f"taskkill /f /im MuMuVMMSVC.exe")
  214. myTimeSleep_big()
  215. def task_start_game(type=0):
  216. isSuccess = True
  217. path1 = R'C:\\Program Files\\Netease\\MuMu Player 12\\nx_main\\MuMuNxMain.exe'
  218. path2 = R'C:\Program Files\Netease\MuMuPlayer-12.0\nx_main\MuMuNxMain.exe'
  219. param = " -v 0"
  220. if os.path.exists(path1):
  221. subprocess.Popen(path1 + param)
  222. elif os.path.exists(path2):
  223. subprocess.Popen(path2 + param)
  224. waitClickImg_withBool(gameStart_img.not_upgrade, 20, 10)
  225. if type == 0:
  226. if waitClickImg_withBool(gameStart_img.ico, 100, 0) == False:
  227. return False
  228. else:
  229. waitClickImg_withBool(gameStart_img.second_game, 100, 0)
  230. if waitClickImg_withBool(gameStart_img.ico, 5, 1) == False:
  231. return False
  232. waitTime = 10
  233. if waitClickImg_withBool(check_img.auto_download, 10, 20) == True:
  234. waitTime += 200
  235. waitFindImg_withBool(place_img.gameIn, waitTime, 20)
  236. basic_operate.go_town()
  237. if waitFindImg_withBool(place_img.gameIn, waitTime, 20) == False:
  238. return False
  239. myTimeSleep_big()
  240. return isSuccess
  241. class dongri_task:
  242. def __init__(self, name):
  243. self.name = name
  244. def run(self):
  245. print(f"Running task: {self.name}")
  246. class task_fight_yongbing(dongri_task):
  247. def __init__(self, add_strengh):
  248. super().__init__("战斗佣兵")
  249. self.add_strengh = add_strengh
  250. def run(self):
  251. basic_operate.go_outside()
  252. if False == waitFindImg_withBool(monster_img.enough_strengh, 2, 1):
  253. if self.add_strengh:
  254. basic_operate.add_strength()
  255. basic_operate.go_outside()
  256. else:
  257. print("没有足够的体力了")
  258. return False
  259. if basic_operate.get_line_num_mix() >= 6:
  260. return False
  261. if waitClickImg_noWait_withBool(check_img.yongbing, 2, 1) == False:
  262. return False
  263. waitClickImg_noWait_withBool(check_img.detect, 2, 1)
  264. if waitClickImg_noWait_withBool(check_img.yongbing_fight, 2, 1) == False:
  265. return False
  266. if waitClickImg_noWait_withBool(monster_img.line1, 2, 1) == False:
  267. return False
  268. if waitFindImg_withBool(monster_img.no_hero, 2, 1) == True:
  269. return False
  270. if waitClickImg_noWait_withBool(monster_img.all_select, 2, 1) == False:
  271. return False
  272. waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
  273. maxTryTimes = 3
  274. while maxTryTimes > 0:
  275. maxTryTimes -= 1
  276. waitClickImg_withBool([monster_img.fight, monster_img.fight2], 1, 1)
  277. waitClickImg_noWait_withBool(monster_img.all_select, 1, 1)
  278. if waitFindImg_withBool(monster_img.all_select, 1, 1) == False:
  279. break
  280. return True
  281. class task_fight_jina_only(dongri_task):
  282. def __init__(self):
  283. super().__init__("战斗召唤的吉娜")
  284. def run(self):
  285. basic_operate.go_outside()
  286. #必须加体力
  287. if False == waitFindImg_withBool(monster_img.enough_strengh, 2, 1):
  288. basic_operate.add_strength()
  289. basic_operate.go_outside()
  290. if waitClickImg_noWait_withBool((check_img.talk_in,check_img.talk_in2), 2, 1) == False:
  291. return False
  292. waitClickImg_noWait_withBool(check_img.talkin_person, 2, 1)
  293. if waitClickImg_noWait_withBool(check_img.talkin_jina, 2, 1) == False:
  294. return False
  295. myTimeSleep_big()
  296. yys_dragAuto(check_img.move_down)
  297. yys_dragAuto(check_img.move_down)
  298. myTimeSleep_big()
  299. if waitClickImg_noWait_withBool(check_img.xiaohao_jina, 2, 1) == False:
  300. return False
  301. if waitClickImg_noWait_withBool((check_img.jina_pic, check_img.jina_pic2), 2, 1) == False:
  302. return False
  303. if waitClickImg_noWait_withBool(monster_img.muti_team, 2, 1) == False:
  304. return False
  305. waitClickImg_noWait_withBool(monster_img.begin_multi, 2, 1)
  306. if waitClickImg_noWait_withBool(monster_img.line1, 2, 1) == False:
  307. return False
  308. if waitFindImg_withBool(monster_img.no_hero, 2, 1) == True:
  309. return False
  310. if waitClickImg_noWait_withBool(monster_img.all_select, 2, 1) == False:
  311. return False
  312. waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
  313. maxTryTimes = 3
  314. while maxTryTimes > 0:
  315. maxTryTimes -= 1
  316. waitClickImg_withBool([monster_img.fight, monster_img.fight2], 1, 1)
  317. waitClickImg_noWait_withBool(monster_img.all_select, 1, 1)
  318. if waitFindImg_withBool(monster_img.all_select, 1, 1) == False:
  319. break
  320. return True
  321. class task_call_jina(dongri_task):
  322. def __init__(self):
  323. super().__init__("召唤吉娜")
  324. def run(self):
  325. basic_operate.go_outside()
  326. if waitClickImg_noWait_withBool(check_img.pack, 2, 1) == False:
  327. return False
  328. if waitClickImg_noWait_withBool((check_img.other, check_img.other2), 2, 1) == False:
  329. return False
  330. if waitClickImg_noWait_withBool(check_img.jina_jiao, 2, 1) == False:
  331. return False
  332. if waitClickImg_noWait_withBool(check_img.use, 2, 1) == False:
  333. return False
  334. if waitClickImg_noWait_withBool(check_img.share, 2, 1) == False:
  335. return False
  336. if waitClickImg_noWait_withBool(check_img.to_pcacc, 2, 1) == False:
  337. return False
  338. if waitClickImg_noWait_withBool(check_img.share_btn, 2, 1) == False:
  339. return False
  340. return True
  341. class task_fight_jina(dongri_task):
  342. def __init__(self, add_strengh):
  343. super().__init__("战斗吉娜")
  344. self.add_strengh = add_strengh
  345. def run(self):
  346. basic_operate.go_outside()
  347. if False == waitFindImg_withBool(monster_img.enough_strengh, 2, 1):
  348. if self.add_strengh:
  349. basic_operate.add_strength()
  350. basic_operate.go_outside()
  351. else:
  352. print("没有足够的体力了")
  353. return False
  354. if waitClickImg_noWait_withBool(check_img.pack, 2, 1) == False:
  355. return False
  356. if waitClickImg_noWait_withBool((check_img.other, check_img.other2), 2, 1) == False:
  357. return False
  358. if waitClickImg_noWait_withBool(check_img.jina_jiao, 2, 1) == False:
  359. return False
  360. if waitClickImg_noWait_withBool(check_img.use, 2, 1) == False:
  361. return False
  362. if waitClickImg_noWait_withBool(monster_img.muti_team, 2, 1) == False:
  363. return False
  364. waitClickImg_noWait_withBool(monster_img.begin_multi, 2, 1)
  365. if waitClickImg_noWait_withBool(monster_img.line1, 2, 1) == False:
  366. return False
  367. if waitFindImg_withBool(monster_img.no_hero, 2, 1) == True:
  368. return False
  369. if waitClickImg_noWait_withBool(monster_img.all_select, 2, 1) == False:
  370. return False
  371. waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
  372. maxTryTimes = 3
  373. while maxTryTimes > 0:
  374. maxTryTimes -= 1
  375. waitClickImg_withBool([monster_img.fight, monster_img.fight2], 1, 1)
  376. waitClickImg_noWait_withBool(monster_img.all_select, 1, 1)
  377. if waitFindImg_withBool(monster_img.all_select, 1, 1) == False:
  378. break
  379. return True
  380. class task_fightMonster(dongri_task):
  381. def __init__(self, add_strengh, fight_bigMonster, isSimple):
  382. self.add_strengh = add_strengh
  383. self.isSimple = isSimple
  384. if fight_bigMonster == True:
  385. super().__init__(f"战斗大怪物")
  386. self.monster = monster_img.bigMonster
  387. self.attack = monster_img.muti_team
  388. else:
  389. super().__init__(f"战斗小怪物")
  390. self.monster = monster_img.wolf
  391. self.attack = monster_img.attack
  392. def run(self):
  393. global g_task_lineCheck
  394. now = datetime.now()
  395. target_time = datetime.combine(now.date(), dt.time(21, 00))
  396. end_time = datetime.combine(now.date(), dt.time(22, 00))
  397. # 判断当前时间是否超过20:30
  398. if now > target_time and now < end_time:
  399. print("当前时间已超过21:00,不执行操作")
  400. return False
  401. basic_operate.go_outside()
  402. if False == waitFindImg_withBool(monster_img.enough_strengh, 2, 1):
  403. if self.add_strengh:
  404. basic_operate.add_strength()
  405. basic_operate.go_outside()
  406. else:
  407. print("没有足够的体力了")
  408. return False
  409. maxLineNum = 6
  410. if basic_operate.get_line_num_mix() >= maxLineNum:
  411. return False
  412. if False == basic_operate.click_outside_search():
  413. return False
  414. if waitFindImg_withBool(monster_img.search, 2, 1):
  415. myTimeSleep_big()
  416. yys_dragAuto(monster_img.move_left)
  417. if waitClickImg_noWait_withBool(self.monster, 2, 1) == False:
  418. return False
  419. if waitClickImg_noWait_withBool(monster_img.search, 2, 1) == False:
  420. return False
  421. if waitClickImg_noWait_withBool(self.attack, 2, 1) == False:
  422. return False
  423. waitClickImg_noWait_withBool(monster_img.begin_multi, 2, 1)
  424. if not self.isSimple:
  425. if waitClickImg_noWait_withBool(monster_img.line1, 2, 1) == False:
  426. return False
  427. if waitFindImg_withBool(monster_img.no_hero, 2, 1) == True:
  428. return False
  429. if waitClickImg_noWait_withBool(monster_img.all_select, 2, 1) == False:
  430. return False
  431. waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
  432. maxTryTimes = 3
  433. while maxTryTimes > 0:
  434. maxTryTimes -= 1
  435. waitClickImg_withBool([monster_img.fight, monster_img.fight2], 1, 1)
  436. waitClickImg_noWait_withBool(monster_img.all_select, 1, 1)
  437. if waitFindImg_withBool(monster_img.all_select, 1, 1) == False:
  438. break
  439. return True
  440. class task_collect(dongri_task):
  441. def __init__(self, type = 0, isSimple = False, isAddStrenghth = False):
  442. self.isSimple = isSimple
  443. self.isAddStrenghth = isAddStrenghth
  444. if isinstance(type, (list, tuple)):
  445. typeArr = type
  446. type = typeArr[random.randint(0, len(typeArr) - 1)]
  447. elif type == 0:
  448. typeArr = [4,3,2,1]
  449. type = typeArr[random.randint(0, len(typeArr) - 1)]
  450. elif type == 5:
  451. typeArr = [2,1]
  452. type = typeArr[random.randint(0, len(typeArr) - 1)]
  453. if type == 1:
  454. self.type = monster_img.meat
  455. self.line = monster_img.line2
  456. super().__init__(f"采集肉")
  457. elif type == 2:
  458. self.type = monster_img.wood
  459. self.line = monster_img.line3
  460. super().__init__(f"采集木头")
  461. elif type == 3:
  462. self.type = monster_img.mine
  463. self.line = monster_img.line4
  464. super().__init__(f"采矿石")
  465. elif type == 4:
  466. self.type = monster_img.iron
  467. self.line = monster_img.line5
  468. super().__init__(f"采集铁矿石")
  469. else:
  470. self.type = None
  471. self.line = None
  472. super().__init__(f"采集None")
  473. if isSimple:
  474. self.line = None
  475. def run(self):
  476. global g_task_lineCheck
  477. if self.type == None:
  478. return True
  479. basic_operate.go_outside()
  480. maxLineNum = 6
  481. if self.isAddStrenghth:
  482. maxLineNum -= 1
  483. if g_task_lineCheck:
  484. maxLineNum -= 1
  485. if basic_operate.get_line_num_mix() >= maxLineNum:
  486. return False
  487. if False == basic_operate.click_outside_search():
  488. return False
  489. if waitFindImg_withBool(monster_img.search, 2, 1):
  490. myTimeSleep_big()
  491. yys_dragAuto(monster_img.move_right)
  492. if waitClickImg_noWait_withBool(self.type, 2, 1) == False:
  493. return False
  494. if waitClickImg_noWait_withBool(monster_img.search, 2, 1) == False:
  495. return False
  496. if waitClickImg_withBool(monster_img.collect, 2, 1) == False:
  497. return False
  498. if self.line != None:
  499. waitClickImg_noWait_withBool(self.line, 2, 1)
  500. waitClickImg_noWait_withBool(monster_img.all_select, 2, 1)
  501. maxTryTimes = 3
  502. while maxTryTimes > 0:
  503. maxTryTimes -= 1
  504. waitClickImg_withBool([monster_img.fight, monster_img.fight2], 1, 1)
  505. waitClickImg_noWait_withBool(monster_img.all_select, 1, 1)
  506. if waitFindImg_withBool(monster_img.all_select, 1, 1) == False:
  507. break
  508. return True
  509. class task_train(dongri_task):
  510. def __init__(self, train_type = None):
  511. super().__init__(f"检查训练{train_type}")
  512. self.train_type = train_type
  513. def run(self):
  514. basic_operate.go_town()
  515. if self.train_type == 'None':
  516. return True
  517. if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
  518. return False
  519. if waitClickImg_noWait_withBool(train_img.train_success, 2, 1) == False:
  520. return False
  521. tryTimes = 3
  522. isSuccess = False
  523. while tryTimes > 0:
  524. tryTimes -= 1
  525. waitClickImg_noWait_withBool([train_img.dun, train_img.gong, train_img.mao], 2, 1)
  526. if waitClickImg_noWait_withBool(train_img.train, 2, 1):
  527. isSuccess = True
  528. break
  529. if isSuccess == False:
  530. pcacc_mouse.quickclick_current()
  531. myTimeSleep_big()
  532. pcacc_mouse.quickclick_current()
  533. if waitClickImg_noWait_withBool(train_img.train, 2, 1) == False:
  534. return False
  535. if self.train_type == 'lv1':
  536. myTimeSleep_big()
  537. yys_dragAuto(train_img.move_left)
  538. yys_dragAuto(train_img.move_left)
  539. waitClickImg_noWait_withBool(train_img.soilder_lv1, 2, 1)
  540. elif self.train_type == 'lv8':
  541. waitClickImg_noWait_withBool(train_img.soilder_lv8, 2, 1)
  542. elif self.train_type == 'lv9':
  543. waitClickImg_noWait_withBool(train_img.soilder_lv9, 2, 1)
  544. elif self.train_type == 'upgrade':
  545. waitClickImg_noWait_withBool(train_img.upgrade_small, 2, 1)
  546. waitClickImg_noWait_withBool(train_img.upgrade_big, 2, 1)
  547. return basic_operate.enter_auto_supply_resource([train_img.begin_train,train_img.begin_train2])
  548. class task_checkHelp(dongri_task):
  549. def __init__(self, isOutSide = False):
  550. super().__init__(f"检查帮助")
  551. self.isOutSide = isOutSide
  552. def run(self):
  553. if self.isOutSide:
  554. basic_operate.go_outside()
  555. else:
  556. basic_operate.go_town()
  557. waitClickImg_noWait_withBool(place_img.help, 2, 1)
  558. return True
  559. class task_gotoTree(dongri_task):
  560. def __init__(self):
  561. super().__init__(f"查看生命之树")
  562. def run(self):
  563. basic_operate.go_town()
  564. if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
  565. return False
  566. myTimeSleep_big()
  567. yys_dragAuto(check_img.move_down)
  568. yys_dragAuto(check_img.move_down)
  569. myTimeSleep_big()
  570. if waitClickImg_noWait_withBool(check_img.life_tree, 2, 1) == False:
  571. return False
  572. myTimeSleep_big()
  573. pcacc_mouse.quickclick_current()
  574. myTimeSleep_big()
  575. waitClickImg_noWait_withBool((check_img.life_jam, check_img.life_jam2), 2, 1)
  576. waitClickImg_noWait_withBool((check_img.life_jam, check_img.life_jam2), 2, 1)
  577. return True
  578. class task_getStrength(dongri_task):
  579. def __init__(self):
  580. super().__init__(f"获取体力")
  581. def run(self):
  582. basic_operate.go_town()
  583. if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
  584. return False
  585. if waitClickImg_noWait_withBool(check_img.pannel_research, 2, 1) == False:
  586. return False
  587. myTimeSleep_big()
  588. yys_dragAuto(change_direction(special_activity_img.champion_move))
  589. myTimeSleep_big()
  590. if waitClickImg_noWait_withBool(check_img.store_strength, 3, 1):
  591. waitClickImg_noWait_withBool((check_img.get,check_img.bigGet), 2, 1)
  592. return True
  593. class task_checkAdventure2(dongri_task):
  594. def __init__(self):
  595. super().__init__(f"检查游历")
  596. def run(self):
  597. basic_operate.go_town()
  598. if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
  599. return False
  600. myTimeSleep_big()
  601. yys_dragAuto(check_img.move_down)
  602. yys_dragAuto(check_img.move_down)
  603. yys_dragAuto(check_img.move_down)
  604. yys_dragAuto(check_img.move_down)
  605. myTimeSleep_big()
  606. if waitClickImg_noWait_withBool(check_img.pannel_adventure, 2, 1) == False:
  607. return False
  608. if waitClickImg_noWait_withBool(check_img.adventure_random, 2, 1) == False:
  609. return False
  610. if waitClickImg_noWait_withBool(check_img.adventure_bag, 2, 1) == False:
  611. return False
  612. if waitClickImg_noWait_withBool(check_img.adventure_get, 2, 1) == False:
  613. return False
  614. return True
  615. class task_checkStoreRoom(dongri_task):
  616. def __init__(self):
  617. super().__init__(f"检查仓库或招募")
  618. def run(self):
  619. basic_operate.go_town()
  620. if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
  621. return False
  622. myTimeSleep_big()
  623. yys_dragAuto(check_img.move_down)
  624. yys_dragAuto(check_img.move_down)
  625. myTimeSleep_big()
  626. if waitClickImg_noWait_withBool((train_img.train_success, check_img.needgo), 2, 1) == False:
  627. return False
  628. myTimeSleep_big()
  629. if waitFindImg_withBool(check_img.pet_findtreature, 2, 1) == False:# storeroom
  630. waitClickImg_noWait_withBool((check_img.bigGet, check_img.chenxi_get2), 2, 1)
  631. pcacc_mouse.quickclick_current()
  632. myTimeSleep_big()
  633. if waitClickImg_noWait_withBool((check_img.detail,check_img.detail2), 2, 1):
  634. myTimeSleep_big()
  635. basic_operate.go_town()
  636. myTimeSleep_big()
  637. if waitClickImg_noWait_withBool((check_img.storeroom, check_img.storeroom2, check_img.invite_free), 2, 1) == False:
  638. return False
  639. myTimeSleep_big()
  640. pcacc_mouse.quickclick_current()
  641. myTimeSleep_big()
  642. waitClickImg_noWait_withBool(check_img.store_strength, 2, 1)
  643. waitClickImg_noWait_withBool((check_img.get,check_img.bigGet), 2, 1)
  644. else:
  645. if waitClickImg_noWait_withBool(check_img.pet_success, 2, 1):
  646. myTimeSleep_big()
  647. dstPos = get_yys_random_point(check_img.pet_getRegion)
  648. pcacc_mouse.click(dstPos[0], dstPos[1])
  649. myTimeSleep_big()
  650. elif waitClickImg_noWait_withBool((check_img.pet_advance, check_img.pet_senior, check_img.pet_junior), 2, 1):
  651. waitClickImg_noWait_withBool(check_img.pet_gotreature, 2, 1)
  652. waitClickImg_noWait_withBool(check_img.pet_begintreature, 2, 1)
  653. return True
  654. class task_checkConfilits(dongri_task):
  655. def __init__(self):
  656. super().__init__(f"检查集结")
  657. def run(self):
  658. basic_operate.go_outside()
  659. if waitClickImg_noWait_withBool(check_img.conflits, 2, 1) == False:
  660. return False
  661. if waitClickImg_noWait_withBool(check_img.paticipate, 2, 1) == False:
  662. return False
  663. if waitFindImg_withBool(check_img.conflict_50, 2, 1) == True:
  664. waitClickImg_noWait_withBool(check_img.conflict_stop, 2, 1)
  665. return True
  666. if waitClickImg_noWait_withBool(check_img.auto_confilit, 2, 1) == False:
  667. return False
  668. return True
  669. class task_checkDonata(dongri_task):
  670. def __init__(self):
  671. super().__init__(f"检查捐献")
  672. def run(self):
  673. basic_operate.go_town()
  674. if waitClickImg_noWait_withBool(check_img.union, 2, 1) == False:
  675. return False
  676. if waitClickImg_noWait_withBool(check_img.union_technology, 2, 1) == False:
  677. return False
  678. if waitClickImg_noWait_withBool(check_img.technology_better, 2, 1) == False:
  679. return False
  680. if waitClickImg_withBool([check_img.donate, check_img.donate2], 2, 1) == False:
  681. return False
  682. else:
  683. maxTryTimes = 3
  684. while waitClickImg_withBool([check_img.donate, check_img.donate2], 1, 0) and maxTryTimes > 0:
  685. maxTryTimes -= 1
  686. return True
  687. class task_checkUnionTreasure(dongri_task):
  688. def __init__(self):
  689. super().__init__(f"检查联盟宝藏")
  690. def run(self):
  691. basic_operate.go_town()
  692. if waitClickImg_noWait_withBool(check_img.union, 2, 1) == False:
  693. return False
  694. if waitClickImg_noWait_withBool(check_img.union_treasure, 2, 1) == False:
  695. return False
  696. waitClickImg_noWait_withBool(check_img.union_gift, 2, 1)
  697. while waitClickImg_noWait_withBool((check_img.union_get), 2, 0) == True:
  698. continue
  699. waitClickImg_noWait_withBool(check_img.union_gain, 2, 1)
  700. while waitClickImg_noWait_withBool((check_img.union_get), 2, 0) == True:
  701. continue
  702. waitClickImg_noWait_withBool(check_img.union_bigtreasure, 2, 1)
  703. return True
  704. class task_checkAdventure(dongri_task):
  705. def __init__(self):
  706. super().__init__(f"检查冒险")
  707. def run(self):
  708. basic_operate.go_town()
  709. if waitClickImg_noWait_withBool(check_img.adventure, 2, 1) == False:
  710. return False
  711. if waitClickImg_noWait_withBool(check_img.get, 2, 1) == False:
  712. return False
  713. if waitClickImg_noWait_withBool(check_img.bigGet, 2, 1) == False:
  714. return False
  715. return True
  716. class task_waitTime(dongri_task):
  717. def __init__(self):
  718. super().__init__(f"等待时间")
  719. def run(self):
  720. myTimeSleep(300)
  721. class task_check_Research(dongri_task):
  722. def __init__(self):
  723. super().__init__(f"检查研究")
  724. def run(self):
  725. basic_operate.go_town()
  726. if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
  727. return False
  728. if waitClickImg_noWait_withBool(check_img.pannel_research, 2, 1) == False:
  729. return False
  730. handRet, handPos = waitFindImg(check_img.hand, 2, 1)
  731. if not handRet:
  732. return False
  733. detailRet, detailPos = waitFindImg((check_img.detail,check_img.detail2), 2, 1)
  734. dstPos = [0, 0]
  735. if not detailRet:
  736. # 如果找不到详细信息,兵营之类的,需点中间
  737. dstPos = [handPos[0] - 70, handPos[1] + 120]
  738. else:
  739. dstPos = [detailPos[0] + 70, detailPos[1] - 100]
  740. tryTimes = 3
  741. while tryTimes > 0:
  742. tryTimes -= 1
  743. myTimeSleep_big()
  744. pcacc_mouse.click(dst_x=dstPos[0], dst_y=dstPos[1])
  745. if waitClickImg_noWait_withBool(check_img.research, 2, 1):
  746. break
  747. if waitFindImg_withBool(check_img.research_speedup, 2, 1) == True:
  748. return False
  749. if waitClickImg_withBool([check_img.research_from0, check_img.research_from1, check_img.research_from2, check_img.research_from3, check_img.research_from4], 2, 1) == False:
  750. return False
  751. if basic_operate.enter_auto_supply_resource(check_img.research_done) == False:
  752. return False
  753. waitClickImg_withBool([check_img.help, check_img.help2, check_img.help3], 2, 2)
  754. class check_buildOrResearch(dongri_task):
  755. def __init__(self):
  756. super().__init__(f"检查建筑或研究")
  757. def run(self):
  758. basic_operate.go_town()
  759. if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
  760. return False
  761. if waitClickImg_noWait_withBool(check_img.needgo, 2, 1) == False:
  762. return False
  763. dstType = 'none'
  764. while True:
  765. if waitFindImg_withBool([check_img.upgrade_done, check_img.upgrade_done2, check_img.upgrade_done3, check_img.upgrade_next, check_img.upgrade_done4], 2, 1):
  766. dstType = 'build'
  767. break
  768. handRet, handPos = waitFindImg(check_img.hand, 2, 1)
  769. if not handRet:
  770. return False
  771. detailRet, detailPos = waitFindImg((check_img.detail,check_img.detail2), 2, 1)
  772. dstPos = [0, 0]
  773. if not detailRet:
  774. # 如果找不到详细信息,兵营之类的,需点中间
  775. dstPos = [handPos[0] - 70, handPos[1] + 120]
  776. else:
  777. dstPos = [detailPos[0] + 70, detailPos[1] - 100]
  778. tryTimes = 5
  779. while tryTimes > 0:
  780. tryTimes -= 1
  781. myTimeSleep_big()
  782. pcacc_mouse.click(dst_x=dstPos[0], dst_y=dstPos[1])
  783. if waitClickImg_noWait_withBool(check_img.research, 2, 1):
  784. dstType = 'research'
  785. break
  786. elif waitClickImg_noWait_withBool(check_img.build_upgrade, 2, 1):
  787. dstType = 'build'
  788. break
  789. break
  790. if dstType == 'none':
  791. print('没有找到建筑或研究')
  792. return False
  793. elif dstType == 'build':
  794. buildtimes = 4
  795. while basic_operate.enter_auto_supply_resource([check_img.upgrade_done, check_img.upgrade_done2, check_img.upgrade_done3, check_img.upgrade_next, check_img.upgrade_done4]):
  796. buildtimes -= 1
  797. if buildtimes == 0:
  798. break
  799. continue
  800. elif dstType == 'research':
  801. if waitClickImg_withBool([check_img.research_type1, check_img.research_type2], 2, 1) == False:
  802. return False
  803. if basic_operate.enter_auto_supply_resource(check_img.research_done) == False:
  804. return False
  805. waitClickImg_withBool([check_img.help, check_img.help2, check_img.help3], 2, 2)
  806. return True
  807. class task_information(dongri_task):
  808. def __init__(self, isAddStrengh = False):
  809. super().__init__(f"检查情报")
  810. self.isAddStrengh = isAddStrengh
  811. def run(self):
  812. basic_operate.go_outside()
  813. if waitClickImg_noWait_withBool(information_img.information, 1, 1) == False:
  814. return False
  815. waitClickImg_noWait_withBool(information_img.information_suc, 1, 1)
  816. hero_arr = [information_img.hero0, information_img.hero1, information_img.hero2, information_img.hero3, information_img.hero4]
  817. camp_arr = [information_img.camp1, information_img.camp2, information_img.camp3, information_img.camp4]
  818. wolf_arr = [information_img.wolf0, information_img.wolf1, information_img.wolf2, information_img.wolf3, information_img.wolf4, information_img.huojing1, information_img.wolf5, information_img.wolf6, information_img.wolf7]
  819. total_arr = hero_arr + camp_arr + wolf_arr
  820. if waitFindImg_withBool(total_arr, 2, 1) == False:
  821. return False
  822. if waitClickImg_noWait_withBool(hero_arr, 0.5, 0.5):
  823. if waitClickImg_noWait_withBool(information_img.gotosee, 1, 1) == False:
  824. return False
  825. if waitClickImg_noWait_withBool(information_img.explore, 1, 1) == False:
  826. return False
  827. if waitClickImg_noWait_withBool(information_img.hero_fight, 1, 1) == False:
  828. return False
  829. myTimeSleep_big()
  830. return True
  831. elif waitClickImg_noWait_withBool(camp_arr, 0.5, 0.5):
  832. if waitClickImg_noWait_withBool(information_img.gotosee, 1, 1) == False:
  833. return False
  834. if waitClickImg_noWait_withBool(information_img.survive, 1, 1) == False:
  835. return False
  836. return True
  837. elif waitClickImg_noWait_withBool(wolf_arr, 0.5, 0.5):
  838. if waitClickImg_noWait_withBool(information_img.gotosee, 1, 1) == False:
  839. return False
  840. if waitClickImg_noWait_withBool(information_img.fight, 1, 1) == False:
  841. return False
  842. if waitClickImg_noWait_withBool(monster_img.line1, 1, 1) == False:
  843. return False
  844. if waitClickImg_noWait_withBool(monster_img.all_select, 2, 1) == False:
  845. return False
  846. waitClickImg_noWait_withBool(monster_img.all_select, 0.1, 1)
  847. maxTryTimes = 3
  848. while maxTryTimes > 0:
  849. maxTryTimes -= 1
  850. waitClickImg_withBool([monster_img.fight, monster_img.fight2], 1, 1)
  851. if False == waitClickImg_noWait_withBool(monster_img.all_select, 1, 1):
  852. break
  853. return True
  854. else:
  855. return False
  856. class task_returnAllLine(dongri_task):
  857. def __init__(self):
  858. super().__init__(f"返回所有路线")
  859. def run(self):
  860. basic_operate.go_town()
  861. basic_operate.go_outside()
  862. maxTryTimes = 6
  863. while maxTryTimes > 0:
  864. maxTryTimes -= 1
  865. if basic_operate.return_line() == False:
  866. break
  867. return True
  868. class task_paticipateInTeam2(dongri_task):
  869. def __init__(self, checkPower=True):
  870. typeArr = [1,3,4]
  871. type = typeArr[random.randint(0, len(typeArr) - 1)]
  872. if type == 1:
  873. self.line = monster_img.line1
  874. elif type == 2:
  875. self.line = monster_img.line2
  876. elif type == 3:
  877. self.line = monster_img.line3
  878. elif type == 4:
  879. self.line = monster_img.line4
  880. self.checkPower = checkPower
  881. hint = "&检查实力"
  882. if checkPower == False:
  883. hint = "&不检查"
  884. super().__init__(f"union队伍{type}{hint}")
  885. def run(self):
  886. basic_operate.go_outside()
  887. if waitClickImg_noWait_withBool((check_img.talk_in,check_img.talk_in2, check_img.talk_in3), 2, 1) == False:
  888. return False
  889. waitClickImg_noWait_withBool(check_img.talkin_union, 1, 0)
  890. if waitClickImg_noWait_withBool(check_img.bear_team, 1, 1, True) == False:
  891. return False
  892. if waitClickImg_noWait_withBool(check_img.bear_add, 1, 1) == False:
  893. return False
  894. waitClickImg_noWait_withBool(self.line, 0.1, 1)
  895. if waitFindImg_withBool(special_activity_img.power0, 0.1, 0) == False:# 实力不为0
  896. if self.checkPower:
  897. if waitFindImg_withBool(check_img.enough_soilder, 1, 0) == False:
  898. return False
  899. waitClickImg_withBool([monster_img.fight, monster_img.fight2, monster_img.fight3], 1, 0)
  900. return True
  901. return False
  902. class task_paticipateInTeam(dongri_task):
  903. def __init__(self, checkPower=True):
  904. typeArr = [1,3,4]
  905. type = typeArr[random.randint(0, len(typeArr) - 1)]
  906. if type == 1:
  907. self.line = monster_img.line1
  908. elif type == 2:
  909. self.line = monster_img.line2
  910. elif type == 3:
  911. self.line = monster_img.line3
  912. elif type == 4:
  913. self.line = monster_img.line4
  914. self.checkPower = checkPower
  915. hint = "&检查实力"
  916. if checkPower == False:
  917. hint = "&不检查"
  918. super().__init__(f"参与队伍{type}{hint}")
  919. def run(self):
  920. basic_operate.go_outside()
  921. if waitClickImg_noWait_withBool(check_img.conflits, 2, 1) == False:
  922. return False
  923. myTimeSleep_big()
  924. dragTimes = 5
  925. for i in range(dragTimes):
  926. yys_dragAuto(check_img.move_down_big, True)
  927. myTimeSleep(0.02)
  928. myTimeSleep_small()
  929. ret = False
  930. for i in range(dragTimes*2):
  931. ret = waitClickImg_noWait_withBool(monster_img.participate, 1, 0, True)
  932. if ret == True:
  933. break
  934. else:
  935. yys_dragAuto(check_img.move_down_big, True)
  936. myTimeSleep_small()
  937. if ret == False:
  938. return False
  939. waitClickImg_noWait_withBool(self.line, 0.1, 1)
  940. if waitFindImg_withBool(special_activity_img.power0, 0.1, 0) == False:# 实力不为0
  941. if self.checkPower:
  942. if waitFindImg_withBool(check_img.enough_soilder, 1, 0) == False:
  943. return False
  944. waitClickImg_withBool([monster_img.fight, monster_img.fight2, monster_img.fight3], 1, 0)
  945. if waitFindImg_withBool(check_img.auto_confilit, 2, 0) == False:
  946. return False
  947. return True
  948. class task_cure(dongri_task):
  949. def __init__(self, continueCure = False, cureNum = None):
  950. cureStr = ""
  951. if continueCure:
  952. cureStr = f"连续"
  953. super().__init__(f"{cureStr}治疗{cureNum}")
  954. self.continueCure = continueCure
  955. self.cureNum = cureNum
  956. def run(self):
  957. basic_operate.go_town()
  958. basic_operate.go_outside()
  959. if waitClickImg_noWait_withBool([check_img.already_cure,check_img.cure_help], 2, 1) == True:
  960. if waitClickImg_noWait_withBool(check_img.cancel_cure, 2, 1) == False:
  961. return False
  962. if waitClickImg_noWait_withBool(check_img.visit_enter, 2, 1) == False:
  963. return False
  964. elif waitClickImg_noWait_withBool(check_img.soilder_cure, 2, 1) == False:
  965. return False
  966. myTimeSleep(5)
  967. while waitFindImg_withBool(special_activity_img.done_immediately, 1, 0.5) == False:
  968. if waitClickImg_noWait_withBool(special_activity_img.quick_choose, 1, 0.5) == False:
  969. return False
  970. while waitFindImg_withBool(special_activity_img.done_immediately, 1, 0.5):
  971. if waitClickImg_noWait_withBool(special_activity_img.choose_zero, 1, 0.5) == False:
  972. return False
  973. else:
  974. myTimeSleep_big()
  975. pcacc_mouse.input_string(str(self.cureNum))
  976. if self.continueCure == False:
  977. if waitClickImg_noWait_withBool(check_img.cure, 2, 1) == False:
  978. return False
  979. if waitClickImg_noWait_withBool(check_img.help4, 2, 1) == False:
  980. return False
  981. else:
  982. maxCureSoilder = 50000
  983. maxTryTimes = int(maxCureSoilder) // int(self.cureNum) * 2
  984. while waitClickImg_noWait_withBool((check_img.cure, check_img.help4, check_img.help5), 10, 0.2) and maxTryTimes >= 0:
  985. maxTryTimes -= 1
  986. continue
  987. waitClickImg_noWait_withBool((check_img.help4, check_img.help5), 1, 1)
  988. return True
  989. class task_useAnnimalSkill(dongri_task):
  990. def __init__(self, isFight = False):
  991. self.isFight = isFight
  992. super().__init__(f"使用动物技能")
  993. def run(self):
  994. basic_operate.go_outside()
  995. if waitClickImg_noWait_withBool(check_img.annimal_skill, 2, 1) == False:
  996. return False
  997. research_skill = [check_img.wolf_skill, check_img.elephant_skill, check_img.lu_skill]
  998. fight_skill = [check_img.fightWolf_skill, check_img.bird_skill, check_img.bear_skill, check_img.lion_skill, check_img.tiger_skill, check_img.unicow_skill]
  999. if self.isFight == False:
  1000. if waitClickImg_noWait_withBool(research_skill, 2, 1) == False:
  1001. return False
  1002. else:
  1003. if waitClickImg_noWait_withBool(fight_skill, 2, 1) == False:
  1004. return False
  1005. if waitClickImg_noWait_withBool((check_img.use, check_img.use2), 2, 1) == False:
  1006. return False
  1007. class task_activity_lianmeng(dongri_task):
  1008. def __init__(self):
  1009. super().__init__(f"联盟总动员")
  1010. def run(self):
  1011. basic_operate.go_town()
  1012. myTimeSleep_big()
  1013. if waitClickImg_noWait_withBool(special_activity_img.normal, 1, 0.5) == False:
  1014. return False
  1015. lianmeng_arr = [special_activity_img.lianmeng, special_activity_img.lianmeng2, special_activity_img.lianmeng3]
  1016. while waitClickImg_noWait_withBool(lianmeng_arr, 1, 0.5) == False:
  1017. yys_dragAuto(special_activity_img.move_left)
  1018. myTimeSleep_small()
  1019. if waitClickImg_noWait_withBool(lianmeng_arr, 1, 0.5) == True:
  1020. break
  1021. yys_dragAuto(special_activity_img.move_left)
  1022. myTimeSleep_small()
  1023. if waitClickImg_noWait_withBool(lianmeng_arr, 1, 0.5) == True:
  1024. break
  1025. yys_dragAuto(special_activity_img.move_right_little)
  1026. myTimeSleep_small()
  1027. if waitClickImg_noWait_withBool(lianmeng_arr, 1, 0.5) == True:
  1028. break
  1029. yys_dragAuto(special_activity_img.move_right_little)
  1030. myTimeSleep_small()
  1031. if waitClickImg_noWait_withBool(lianmeng_arr, 1, 0.5) == True:
  1032. break
  1033. return False
  1034. doTask_arr = [special_activity_img.shili_120_2, special_activity_img.shili_860_2, special_activity_img.shili_430, special_activity_img.bigMonster_2]
  1035. waitClickImg_noWait_withBool(special_activity_img.task_done, 1, 0.5)
  1036. if waitFindImg_withBool(special_activity_img.doing_task, 1, 0.5) == False:
  1037. down_tryTimes = 3
  1038. while down_tryTimes > 0:
  1039. down_tryTimes -= 1
  1040. if waitClickImg_noWait_withBool(doTask_arr, 1, 0.5, True) == True:
  1041. if waitClickImg_noWait_withBool(special_activity_img.accept_task, 2, 1) == False:
  1042. return False
  1043. break
  1044. elif waitFindImg_withBool(special_activity_img.shili_2, 1, 0.5) == True:
  1045. save_game_screen("shili")
  1046. yys_dragAuto(special_activity_img.move_down)
  1047. up_tryTimes = 5
  1048. while up_tryTimes > 0:
  1049. up_tryTimes -= 1
  1050. myTimeSleep_small()
  1051. yys_dragAuto(change_direction(special_activity_img.move_down))
  1052. if waitFindImg_withBool((special_activity_img.shili_120, special_activity_img.shili_860_2), 2, 1, True) == False:
  1053. maxTryTimes = 2
  1054. while waitClickImg_noWait_withBool((special_activity_img.owning2), 2, 1) == True:
  1055. waitClickImg_noWait_withBool(special_activity_img.refresh_task, 2, 1)
  1056. waitClickImg_noWait_withBool(special_activity_img.refresh, 2, 1)
  1057. maxTryTimes -= 1
  1058. if maxTryTimes <= 0:
  1059. break
  1060. return True
  1061. class task_checkMaster(dongri_task):
  1062. def __init__(self):
  1063. super().__init__(f"检查统帅")
  1064. def run(self):
  1065. basic_operate.go_town()
  1066. if waitClickImg_noWait_withBool(check_img.master, 2, 1) == False:
  1067. return False
  1068. if waitClickImg_noWait_withBool(check_img.master_get, 2, 1) == False:
  1069. return False
  1070. myTimeSleep_big()
  1071. pcacc_mouse.quickclick_current()
  1072. if waitClickImg_noWait_withBool(check_img.little_treasure, 2, 1) == False:
  1073. return False
  1074. return True
  1075. class task_checkActivities(dongri_task):
  1076. def __init__(self):
  1077. super().__init__(f"检查各种活动时间")
  1078. def find_all_matching_events(self, parts, input_word):
  1079. results = []
  1080. # 查找所有包含输入关键词的项
  1081. matches = [i for i, part in enumerate(parts) if input_word in part]
  1082. for match_index in matches:
  1083. # 从匹配项开始向后查找第一个时间或状态
  1084. for i in range(match_index + 1, len(parts)):
  1085. current_part = parts[i]
  1086. # 检查是否是时间(如 19:30)或状态(如 已结束)
  1087. if re.match(r'^\d{1,2}:\d{2}$', current_part) or current_part in ["已结束"]:
  1088. dst = {"item":parts[match_index], "time":current_part}
  1089. results.append(dst)
  1090. break # 找到第一个匹配就停止
  1091. return results
  1092. def run(self):
  1093. global todo_msg, todo_list
  1094. basic_operate.go_outside()
  1095. if waitClickImg_noWait_withBool(check_img.activity_open, 2, 1) == False:
  1096. return False
  1097. if waitFindImg_withBool(check_img.todoList, 2, 0) == False:
  1098. return False
  1099. myTimeSleep_small()
  1100. yys_dragAuto(check_img.move_down)
  1101. yys_dragAuto(check_img.move_down)
  1102. myTimeSleep_small()
  1103. activityStr = yys_ocrAuto(check_img.todo_region)
  1104. if activityStr:
  1105. todo_msg = activityStr
  1106. print(todo_msg)
  1107. date_pattern = r"\d{4}-\d{2}-\d{2}"
  1108. for i, item in enumerate(todo_msg):
  1109. if re.fullmatch(date_pattern, item): # 检查是否完全匹配日期格式
  1110. activityStr = todo_msg[:i] # 保留日期之前的内容
  1111. break
  1112. else:
  1113. activityStr = todo_msg # 如果没有找到日期,保留全部
  1114. print("去掉日期",activityStr)
  1115. result = []
  1116. judianArr = self.find_all_matching_events(activityStr, "据点")
  1117. #result.extend(judianArr)
  1118. baoleiArr = self.find_all_matching_events(activityStr, "堡垒")
  1119. #result.extend(baoleiArr)
  1120. juxiongArr = self.find_all_matching_events(activityStr, "巨熊")
  1121. result.extend(juxiongArr)
  1122. binggongchangArr = self.find_all_matching_events(activityStr, "兵工厂")
  1123. result.extend(binggongchangArr)
  1124. yaosaiArr = self.find_all_matching_events(activityStr, "要塞")
  1125. #result.extend(yaosaiArr)
  1126. todo_list = result
  1127. print(todo_list)
  1128. print(get_todo_time("巨熊行动"))
  1129. return activityStr
  1130. class task_visit_island(dongri_task):
  1131. def __init__(self):
  1132. super().__init__(f"访问岛屿")
  1133. def run(self):
  1134. basic_operate.go_outside()
  1135. if waitClickImg_noWait_withBool(check_img.visit_island_small, 2, 1) == False:
  1136. return False
  1137. if waitClickImg_noWait_withBool(check_img.visit_enter, 2, 1) == False:
  1138. return False
  1139. if waitClickImg_noWait_withBool(check_img.visit_island_big, 2, 1) == False:
  1140. return False
  1141. return True
  1142. class task_fight_ranshuang(dongri_task):
  1143. def __init__(self):
  1144. super().__init__(f"打燃霜")
  1145. def run(self):
  1146. basic_operate.backToGame()
  1147. while True:
  1148. if waitClickImg_noWait_withBool(monster_img.ranshuang_search, 0.5, 0.5) == False:
  1149. return False
  1150. if waitClickImg_noWait_withBool(monster_img.ranshuang_attack, 0.5, 0.5) == False:
  1151. firstPos = get_yys_random_point(special_activity_img.mid_enemy_region)
  1152. pcacc_mouse.click(firstPos[0], firstPos[1])
  1153. myTimeSleep_big()
  1154. if waitClickImg_noWait_withBool(monster_img.ranshuang_attack, 1, 0.5) == False:
  1155. break
  1156. break
  1157. if waitClickImg_noWait_withBool([monster_img.fight, monster_img.fight2], 1, 0.5) == False:
  1158. return False
  1159. return True
  1160. class task_fight_enemy(dongri_task):
  1161. def __init__(self):
  1162. super().__init__(f"打敌人or王城")
  1163. def run(self):
  1164. basic_operate.go_town()
  1165. basic_operate.go_outside()
  1166. if waitClickImg_noWait_withBool(special_activity_img.collection, 2, 1) == False:
  1167. return False
  1168. if waitClickImg_noWait_withBool(special_activity_img.enemy, 2, 1) == False:
  1169. return False
  1170. attackArr = [monster_img.attack, monster_img.attack2, monster_img.ranshuang_attack, monster_img.outside_attack, monster_img.defend]
  1171. myTimeSleep_big()
  1172. firstPos = get_yys_random_point(special_activity_img.first_enemy_region)
  1173. pcacc_mouse.click(firstPos[0], firstPos[1])
  1174. maxTryTimes = 5
  1175. if waitFindImg_withBool(special_activity_img.visit_island, 1, 1) == True:
  1176. return False
  1177. while waitFindImg_withBool(attackArr, 1, 0) == False and maxTryTimes > 0:
  1178. if waitClickImg_noWait_withBool(special_activity_img.outside_soilder, 1, 1) == True:
  1179. break
  1180. #if waitFindImg_withBool(special_activity_img.outside_pcacc, 1, 1) == True:
  1181. # break
  1182. #else:
  1183. # return False
  1184. maxTryTimes -= 1
  1185. myTimeSleep_big()
  1186. mid_enemy_pos = get_yys_random_point(special_activity_img.mid_enemy_region)
  1187. pcacc_mouse.click(mid_enemy_pos[0], mid_enemy_pos[1])
  1188. myTimeSleep_big()
  1189. if waitFindImg_withBool(special_activity_img.visit_island, 1, 1) == True:
  1190. return False
  1191. if waitClickImg_noWait_withBool(attackArr, 1, 0) == False:
  1192. return False
  1193. waitClickImg_noWait_withBool(monster_img.team_go, 2, 1)#派遣队伍
  1194. if waitClickImg_noWait_withBool(monster_img.line1, 2, 1) == False:
  1195. return False
  1196. if waitClickImg_noWait_withBool([monster_img.fight, monster_img.fight2], 2, 1) == False:
  1197. return False
  1198. return True
  1199. class task_get_redPackage(dongri_task):
  1200. def __init__(self):
  1201. super().__init__(f"领取红包")
  1202. def run(self):
  1203. basic_operate.go_outside()
  1204. if waitClickImg_noWait_withBool((check_img.talk_in,check_img.talk_in2, check_img.talk_in3), 2, 1) == False:
  1205. return False
  1206. waitClickImg_noWait_withBool(check_img.talkin_world, 2, 1)
  1207. oldTime = time.time()
  1208. max_waitTime = get_nextTaskTime()
  1209. print(f"max_waitTime:{max_waitTime}")
  1210. if max_waitTime == 0:
  1211. max_waitTime = 150
  1212. red_package_pics = [special_activity_img.red_package, special_activity_img.red_package2, special_activity_img.red_package3, special_activity_img.msg_new, special_activity_img.red_package_open]
  1213. runTimes = 0
  1214. while True:
  1215. if time.time() - oldTime > max_waitTime:
  1216. break
  1217. if runTimes % 10 == 0:
  1218. if waitFindImg_withBool([special_activity_img.red_package_end, special_activity_img.red_package_end2], 1, 0) == True:
  1219. waitClickImg_noWait_withBool(special_activity_img.red_package_close, 2, 0)
  1220. myTimeSleep_small()
  1221. yys_dragAuto(special_activity_img.move_down)
  1222. if True == waitClickImg_noWait_withBool(red_package_pics, 2, 0):
  1223. start_screenshot_thread("redPackage")
  1224. max_waitTime += 5
  1225. runTimes += 1
  1226. return True
  1227. class task_read_mails(dongri_task):
  1228. def __init__(self):
  1229. super().__init__(f"读邮件")
  1230. def run(self):
  1231. basic_operate.go_town()
  1232. if waitClickImg_noWait_withBool(check_img.mail_btn, 2, 1) == False:
  1233. return False
  1234. waitClickImg_noWait_withBool(check_img.mail_collect, 2, 1)
  1235. if waitClickImg_noWait_withBool(check_img.mail_union, 2, 1) == False:
  1236. return False
  1237. if waitClickImg_noWait_withBool(check_img.mail_read, 2, 1) == False:
  1238. return False
  1239. if waitClickImg_noWait_withBool(check_img.mail_system, 2, 1) == False:
  1240. return False
  1241. if waitClickImg_noWait_withBool(check_img.mail_read, 2, 1) == False:
  1242. return False
  1243. if waitClickImg_noWait_withBool(check_img.mail_reports, 2, 1) == False:
  1244. return False
  1245. if waitClickImg_noWait_withBool(check_img.mail_read, 2, 1) == False:
  1246. return False
  1247. return True
  1248. class task_checkBenifitStatus(dongri_task):
  1249. def __init__(self):
  1250. super().__init__(f"查看增益状态")
  1251. def run(self):
  1252. basic_operate.go_town()
  1253. if waitFindImg_withBool(check_img.benefit_collect, 2, 1) == True:
  1254. return True
  1255. if waitClickImg_noWait_withBool(check_img.add_benefit, 2, 1) == False:
  1256. return False
  1257. waitClickImg_noWait_withBool(check_img.benefit_evolve, 2, 1)
  1258. if waitClickImg_noWait_withBool(check_img.benefit_collect_info, 2, 1) == False:
  1259. return False
  1260. myTimeSleep_big()
  1261. dstPos = get_yys_random_point(check_img.benefit_use_region)
  1262. pcacc_mouse.click(dstPos[0], dstPos[1])
  1263. myTimeSleep_big()
  1264. if waitClickImg_noWait_withBool(check_img.benefit_buy, 2, 1) == False:
  1265. return False
  1266. waitClickImg_noWait_withBool(check_img.buy_enter, 2, 1)
  1267. return True
  1268. class task_checkDiamond(dongri_task):
  1269. def __init__(self):
  1270. super().__init__(f"查看钻石活动")
  1271. def run(self):
  1272. basic_operate.go_town()
  1273. if waitClickImg_noWait_withBool(check_img.worthy_activity, 2, 1) == False:
  1274. return False
  1275. myTimeSleep_big()
  1276. yys_dragAuto(change_direction(special_activity_img.move_left))
  1277. myTimeSleep_big()
  1278. yys_dragAuto(change_direction(special_activity_img.move_left))
  1279. myTimeSleep_big()
  1280. yys_dragAuto(change_direction(special_activity_img.move_left))
  1281. if waitClickImg_noWait_withBool(check_img.diamond_activity, 2, 1) == False:
  1282. return False
  1283. waitClickImg_noWait_withBool(check_img.gain_diamond, 2, 1)
  1284. dstPos = get_yys_random_point(check_img.diamond_save)
  1285. pcacc_mouse.click(dstPos[0], dstPos[1])
  1286. myTimeSleep_big()
  1287. dstPos = get_yys_random_point(check_img.diamond_saveMax)
  1288. pcacc_mouse.click(dstPos[0], dstPos[1])
  1289. myTimeSleep_big()
  1290. if waitClickImg_noWait_withBool(check_img.diamond_save_btn, 2, 1) == False:
  1291. return False
  1292. return True
  1293. class task_invite_hero(dongri_task):
  1294. def __init__(self):
  1295. super().__init__(f"邀请英雄")
  1296. def run(self):
  1297. basic_operate.go_town()
  1298. if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
  1299. return False
  1300. myTimeSleep_big()
  1301. if waitClickImg_noWait_withBool(special_activity_img.goto_arrow, 2, 1) == False:
  1302. return False
  1303. if waitClickImg_noWait_withBool(check_img.build_hero, 2, 1) == False:
  1304. return False
  1305. if waitClickImg_noWait_withBool(check_img.invite_free, 2, 1) == False:
  1306. return False
  1307. return True
  1308. class task_fight_campion(dongri_task):
  1309. def __init__(self):
  1310. super().__init__(f"打竞技场")
  1311. def run(self):
  1312. basic_operate.go_town()
  1313. if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
  1314. return False
  1315. myTimeSleep_big()
  1316. if waitClickImg_noWait_withBool(special_activity_img.goto_arrow, 2, 1) == False:
  1317. return False
  1318. myTimeSleep_big()
  1319. maxMoveTimes = 2
  1320. while maxMoveTimes > 0:
  1321. maxMoveTimes -= 1
  1322. yys_dragAuto(special_activity_img.champion_move)
  1323. myTimeSleep_big()
  1324. if waitClickImg_noWait_withBool(special_activity_img.enter_champion, 2, 1) == True:
  1325. break
  1326. if waitClickImg_noWait_withBool(special_activity_img.champion_fight, 2, 1) == False:
  1327. return False
  1328. myTimeSleep_big()
  1329. dstPos = get_yys_random_point(special_activity_img.fight_last)
  1330. pcacc_mouse.click(dstPos[0], dstPos[1])
  1331. myTimeSleep_big()
  1332. if waitClickImg_noWait_withBool(special_activity_img.champion_fight2, 2, 1) == False:
  1333. return False
  1334. return True
  1335. class check_safe_collect(dongri_task):
  1336. def __init__(self):
  1337. super().__init__(f"检查安全收集")
  1338. def run(self):
  1339. basic_operate.go_outside()
  1340. if waitClickImg_noWait_withBool(special_activity_img.collection, 2, 1) == False:
  1341. return False
  1342. if waitClickImg_noWait_withBool(special_activity_img.collection_friend, 2, 1) == False:
  1343. return False
  1344. myTimeSleep_big()
  1345. firstPos = get_yys_random_point(special_activity_img.first_enemy_region)
  1346. pcacc_mouse.click(firstPos[0], firstPos[1])
  1347. maxTryTimes = 2
  1348. while waitClickImg_noWait_withBool(monster_img.collect, 1, 1) == False and maxTryTimes > 0:
  1349. maxTryTimes -= 1
  1350. myTimeSleep_big()
  1351. mid_enemy_pos = get_yys_random_point(special_activity_img.mid_enemy_region)
  1352. pcacc_mouse.click(mid_enemy_pos[0], mid_enemy_pos[1]-40)
  1353. myTimeSleep_big()
  1354. if waitClickImg_noWait_withBool(special_activity_img.big_collect, 2, 1) == False:
  1355. return False
  1356. if waitClickImg_noWait_withBool(monster_img.line7, 2, 1) == False:
  1357. return False
  1358. maxTryTimes = 3
  1359. while maxTryTimes > 0:
  1360. maxTryTimes -= 1
  1361. waitClickImg_withBool([monster_img.fight, monster_img.fight2], 1, 1)
  1362. waitClickImg_noWait_withBool(monster_img.all_select, 1, 1)
  1363. if waitFindImg_withBool(monster_img.all_select, 1, 1) == False:
  1364. break
  1365. return True
  1366. class task_duanwu(dongri_task):
  1367. def __init__(self):
  1368. super().__init__(f"端午")
  1369. def run(self):
  1370. count = 0
  1371. while True:
  1372. if count > 15000:
  1373. waitClickImg_noWait_withBool(special_activity_img.duanwu_auto_attack, 2, 1)
  1374. waitClickImg_noWait_withBool(special_activity_img.duanwu_auto_use, 2, 1)
  1375. else:
  1376. waitClickImg_noWait_withBool(special_activity_img.duanwu_end, 2, 1)
  1377. countStr = yys_ocrAuto(special_activity_img.orc_count)
  1378. print(countStr)
  1379. if len(countStr) == 0:
  1380. count = 0
  1381. continue
  1382. cleaned_text = countStr[0].replace('.', '')
  1383. cleaned_text = cleaned_text.replace(',', '')
  1384. try:
  1385. count = int(cleaned_text)
  1386. except:
  1387. continue
  1388. print("current count:", count)
  1389. return True
  1390. class task_checkPower(dongri_task):
  1391. def __init__(self):
  1392. super().__init__(f"检查实力")
  1393. def run(self):
  1394. countStr = yys_ocrAuto(special_activity_img.orc_power2)
  1395. if len(countStr) == 0:
  1396. count = 0
  1397. return 0
  1398. cleaned_text = countStr[0].replace('.', '')
  1399. cleaned_text = cleaned_text.replace(',', '')
  1400. try:
  1401. count = int(cleaned_text)
  1402. except:
  1403. return False
  1404. print("current count:", count)
  1405. return count
  1406. class task_get_fire_crystal(dongri_task):
  1407. def __init__(self):
  1408. super().__init__(f"获取火晶")
  1409. def run(self):
  1410. basic_operate.go_town()
  1411. if waitClickImg_noWait_withBool(train_img.quick_panel, 2, 1) == False:
  1412. return False
  1413. myTimeSleep_big()
  1414. if waitClickImg_noWait_withBool(special_activity_img.spear, 2, 1) == False:
  1415. return False
  1416. if waitClickImg_noWait_withBool(special_activity_img.build_fire_crystal, 2, 1) == False:
  1417. return False
  1418. while waitClickImg_noWait_withBool(special_activity_img.fire_crystal_get, 2, 1, True) == True:
  1419. continue
  1420. return True
  1421. class task_zhuguang(dongri_task):
  1422. def __init__(self):
  1423. super().__init__(f"检查逐光")
  1424. def run(self):
  1425. basic_operate.go_town()
  1426. if waitClickImg_noWait_withBool(check_img.worthy_activity, 2, 1) == False:
  1427. return False
  1428. myTimeSleep_big()
  1429. yys_dragAuto(change_direction(special_activity_img.move_right_little))
  1430. myTimeSleep_big()
  1431. yys_dragAuto(change_direction(special_activity_img.move_right_little))
  1432. myTimeSleep_big()
  1433. yys_dragAuto(change_direction(special_activity_img.move_right_little))
  1434. waitClickImg_noWait_withBool([special_activity_img.zhuguang_not_select, special_activity_img.zhuguang_select], 2, 1)
  1435. waitClickImg_noWait_withBool([special_activity_img.zhuguang_send, special_activity_img.zhuguang_receive], 2, 1)
  1436. waitClickImg_noWait_withBool([special_activity_img.zhuguang_send, special_activity_img.zhuguang_receive], 2, 1)
  1437. return True
  1438. class task_testFun(dongri_task):
  1439. def __init__(self):
  1440. super().__init__(f"测试功能")
  1441. def run(self):
  1442. #task_checkDiamond().run()
  1443. task_paticipateInTeam2().run()
  1444. return True
  1445. if __name__ == '__main__':
  1446. myTimeSleep_big()
  1447. print(basic_operate.get_line_num_mix())
  1448. task_invite_hero().run()
  1449. #task_get_fire_crystal().run()
  1450. #task_checkPower().run()
  1451. #task_testFun().run()
  1452. #task_checkActivities().run()
  1453. #print(get_todo_time("巨熊行动"))
  1454. #task_check_Research().run()
  1455. #save_game_screen()
  1456. #task_cure(True, 85).run()
  1457. #task_fight_enemy().run()
  1458. #task_fight_ranshuang().run()
  1459. #task_gotoTree().run()
  1460. #task_fight_jina_only().run()
  1461. #task_checkConfilits().run()
  1462. #task_getStrength().run()
  1463. #task_checkActivities().run()
  1464. #task_checkMaster().run()
  1465. #yys_ocrAuto(check_img.line_orc)
  1466. #basic_operate.go_town()
  1467. #basic_operate.add_strength()
  1468. #task_fightMonster(False, True,False).run()
  1469. #task_checkHelp().run()
  1470. #task_checkStoreRoom().run()
  1471. #task_start_game(1)
  1472. #check_safe_collect().run()
  1473. #task_fight_campion().run()
  1474. #task_activity_lianmeng().run()
  1475. #task_fight_yongbing(True).run()
  1476. #task_collect([4,3,2,1]).run()
  1477. #task_train("upgrade").run()
  1478. #task_information(True).run()
  1479. #check_buildOrResearch().run()
  1480. #task_checkDonata().run()
  1481. #task_checkUnionTreasure().run()
  1482. #task_checkAdventure2().run()
  1483. #task_collect(1).run()
  1484. #task_collect(2).run()
  1485. #task_collect(3).run()
  1486. #task_collect(4).run()
  1487. #task_returnAllLine().run()
  1488. #task_paticipateInTeam().run()
  1489. #task_fight_jina(True).run()
  1490. #task_get_redPackage().run()
  1491. #task_read_mails().run()
  1492. #task_checkBenifitStatus().run()
  1493. #task_checkDiamond().run()
  1494. #task_zhuguang().run()