dongri_task.py 64 KB

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