Bladeren bron

!2 add function check diamond

pcacc 4 maanden geleden
bovenliggende
commit
6d888f094c

+ 1 - 0
app_dongri.py

@@ -344,6 +344,7 @@ def add_auto_task(isMaxCollect, isJina, isSimple = False, isAddStrengh = False,
             task_queue.appendleft(task_read_mails())
             if auto_participate:
                 task_queue.appendleft(task_checkConfilits())
+            task_queue.appendleft(task_checkDiamond())
             task_queue.appendleft(task_checkBenifitStatus())
 
         

BIN
dongri_img/check/diamond_activity.png


BIN
dongri_img/check/diamond_save_btn.png


BIN
dongri_img/check/gain_diamond.png


BIN
dongri_img/check/worthy_activity.png


+ 12 - 1
dongri_pic.py

@@ -174,6 +174,13 @@ class check_img:
     benefit_use_region = (411, 469, 479, 493)
     benefit_buy = R'dongri_img\check\benefit_buy.png'
     buy_enter = R'dongri_img\check\buy_enter.png'
+    # diamond
+    worthy_activity = R'dongri_img\check\worthy_activity.png'
+    diamond_activity = R'dongri_img\check\diamond_activity.png'
+    gain_diamond = R'dongri_img\check\gain_diamond.png'
+    diamond_save = (161,560,220,584)
+    diamond_saveMax = (310,505,316,511)
+    diamond_save_btn = R'dongri_img\check\diamond_save_btn.png'
 
 
 
@@ -242,7 +249,11 @@ class special_activity_img:
     red_package_open = R'dongri_img\special_activity\red_package_open.png'
     msg_new = R'dongri_img\special_activity\msg_new.png'
     
-
+def change_direction(direction):
+    if len(direction) == 4:
+        return (direction[2], direction[3], direction[0], direction[1])
+    else:
+        return direction
 
 
 

+ 33 - 1
dongri_task.py

@@ -1217,6 +1217,37 @@ class task_checkBenifitStatus(dongri_task):
         waitClickImg_noWait_withBool(check_img.buy_enter, 2, 1)
         
         return True
+    
+class task_checkDiamond(dongri_task):
+    def __init__(self):
+        super().__init__(f"查看钻石活动")
+    def run(self):
+        basic_operate.go_town()
+        if waitClickImg_noWait_withBool(check_img.worthy_activity, 2, 1) == False:
+            return False
+        myTimeSleep_big()
+        yys_dragAuto(change_direction(special_activity_img.move_left))
+        myTimeSleep_big()
+        yys_dragAuto(change_direction(special_activity_img.move_left))
+
+        waitClickImg_noWait_withBool(check_img.diamond_activity, 2, 1)
+        
+        waitClickImg_noWait_withBool(check_img.gain_diamond, 2, 1)
+
+        dstPos = get_yys_random_point(check_img.diamond_save)
+        pcacc_mouse.click(dstPos[0], dstPos[1])
+        myTimeSleep_big()
+
+        dstPos = get_yys_random_point(check_img.diamond_saveMax)
+        pcacc_mouse.click(dstPos[0], dstPos[1])
+        myTimeSleep_big()
+
+        if waitClickImg_noWait_withBool(check_img.diamond_save_btn, 2, 1) == False:
+            return False
+
+        return True
+            
+            
 
 
 if __name__ == '__main__':
@@ -1251,4 +1282,5 @@ if __name__ == '__main__':
     #task_fight_jina(True).run()
     #task_get_redPackage().run()
     #task_read_mails().run()
-    task_checkBenifitStatus().run()
+    #task_checkBenifitStatus().run()
+    task_checkDiamond().run()