|
@@ -141,6 +141,21 @@ class basic_operate:
|
|
|
if waitClickImg_noWait_withBool(information_img.add_strength, 2, 1) == False:
|
|
|
return False
|
|
|
return True
|
|
|
+
|
|
|
+ @staticmethod
|
|
|
+ def get_line_num():
|
|
|
+ lineStr = yys_ocrAuto(check_img.line_orc)
|
|
|
+ if len(lineStr) == 0:
|
|
|
+ return 0
|
|
|
+ match = re.search(r'\d', lineStr[0]) # 查找第一个数字
|
|
|
+ if match:
|
|
|
+ first_digit = match.group()
|
|
|
+ print("第一个数字:", first_digit)
|
|
|
+ return int(first_digit)
|
|
|
+ else:
|
|
|
+ print("未找到数字")
|
|
|
+ return 0
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -361,8 +376,9 @@ class task_fightMonster(dongri_task):
|
|
|
|
|
|
|
|
|
class task_collect(dongri_task):
|
|
|
- def __init__(self, type = 0, isSimple = False):
|
|
|
+ def __init__(self, type = 0, isSimple = False, isAddStrenghth = False):
|
|
|
self.isSimple = isSimple
|
|
|
+ self.isAddStrenghth = isAddStrenghth
|
|
|
if isinstance(type, (list, tuple)):
|
|
|
typeArr = type
|
|
|
type = typeArr[random.randint(0, len(typeArr) - 1)]
|
|
@@ -399,6 +415,10 @@ class task_collect(dongri_task):
|
|
|
if False == basic_operate.click_outside_search():
|
|
|
return False
|
|
|
|
|
|
+ if self.isAddStrenghth and basic_operate.get_line_num() >= 5:
|
|
|
+ return False
|
|
|
+
|
|
|
+
|
|
|
if waitFindImg_withBool(monster_img.search, 2, 1):
|
|
|
myTimeSleep_big()
|
|
|
yys_dragAuto(monster_img.move_right)
|
|
@@ -753,12 +773,14 @@ class task_activity_lianmeng(dongri_task):
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
+ basic_operate.get_line_num()
|
|
|
+ #yys_ocrAuto(check_img.line_orc)
|
|
|
#basic_operate.go_town()
|
|
|
#basic_operate.add_strength()
|
|
|
#task_fightMonster(False, True).run()
|
|
|
#task_checkHelp().run()
|
|
|
#task_checkStoreRoom().run()
|
|
|
- task_activity_lianmeng().run()
|
|
|
+ #task_activity_lianmeng().run()
|
|
|
#task_fight_yongbing(True).run()
|
|
|
#task_collect([4,3,2,1]).run()
|
|
|
#task_train().run()
|