dongri_task.py 64 KB

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