dongri_task.py 65 KB

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