dongri_task.py 64 KB

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