Ver código fonte

!2 update get red package

pcacc 1 mês atrás
pai
commit
e7dc2efeb2

BIN
dongri_img/check/talkin_union.png


BIN
dongri_img/special_activity/red_package.png


BIN
dongri_img/special_activity/red_package2.png


+ 1 - 0
dongri_pic.py

@@ -172,6 +172,7 @@ class check_img:
     talk_in2 = R'dongri_img\check\talk_in2.png'
     talk_in3 = R'dongri_img\check\talk_in3.png'
     talkin_person = R'dongri_img\check\talkin_person.png'
+    talkin_union = R'dongri_img\check\talkin_union.png'
     talkin_jina = R'dongri_img\check\talkin_jina.png'
     xiaohao_jina = R'dongri_img\check\xiaohao_jina.png'
     jina_pic = R'dongri_img\check\jina_pic.png'

+ 7 - 5
dongri_task.py

@@ -1181,7 +1181,7 @@ class task_activity_lianmeng(dongri_task):
                         return False
                     break
                 elif waitFindImg_withBool(special_activity_img.shili_2, 1, 0.5) == True:
-                    save_game_screen()
+                    save_game_screen("shili")
 
                 yys_dragAuto(special_activity_img.move_down)
         
@@ -1378,12 +1378,14 @@ class task_get_redPackage(dongri_task):
         basic_operate.go_outside()
         if waitClickImg_noWait_withBool((check_img.talk_in,check_img.talk_in2, check_img.talk_in3), 2, 1) == False:
             return False
-        waitClickImg_noWait_withBool(check_img.talkin_person, 2, 1)
+        waitClickImg_noWait_withBool(check_img.talkin_union, 2, 1)
         oldTime = time.time()
+        red_package_pics = [special_activity_img.red_package, special_activity_img.red_package2, special_activity_img.msg_new, special_activity_img.red_package_open]
         while True:
             if time.time() - oldTime > 150:
                 break
-            waitClickImg_noWait_withBool((special_activity_img.red_package, special_activity_img.red_package2, special_activity_img.msg_new, special_activity_img.red_package_open), 2, 0)
+            if True == waitClickImg_noWait_withBool(red_package_pics, 2, 0):
+                save_game_screen("redPackage")
 
         return True
     
@@ -1630,7 +1632,7 @@ if __name__ == '__main__':
     #yys_ocrAuto(check_img.line_orc)
     #basic_operate.go_town()
     #basic_operate.add_strength()
-    task_fightMonster(False, True,False).run()
+    #task_fightMonster(False, True,False).run()
     #task_checkHelp().run()
     #task_checkStoreRoom().run()
     #task_start_game(1)
@@ -1650,7 +1652,7 @@ if __name__ == '__main__':
     #task_returnAllLine().run()
     #task_paticipateInTeam().run()
     #task_fight_jina(True).run()
-    #task_get_redPackage().run()
+    task_get_redPackage().run()
     #task_read_mails().run()
     #task_checkBenifitStatus().run()
     #task_checkDiamond().run()

+ 2 - 2
scriptBase/comon.py

@@ -295,11 +295,11 @@ def game_region():
     tmpRet, tmpPos = find_window_pos('Mumu模拟器12',)
     return tmpRet, tmpPos
 
-def save_game_screen():
+def save_game_screen(fileHeader = ""):
     regionRet, regionPos = game_region()
     screenshot = pyautogui.screenshot(region=regionPos)
     curData = datetime.now().strftime("%Y_%m_%d_%H_%M_%S")
-    fileName = "temp_pictures/" + curData + ".png"
+    fileName = "temp_pictures/" + fileHeader + "_" + curData + ".png"
     screenshot.save(fileName)
     return True