Browse Source

!2 add fight enemy

pcacc 4 months ago
parent
commit
939f7c48c2

+ 1 - 1
daily.json

@@ -1,6 +1,6 @@
 {
     "daily": {
-        "2025-04-05": {
+        "2025-04-09": {
             "login_task": true,
             "fight_bigMonster_times": 0
         }

BIN
dongri_img/monster/attack2.png


BIN
dongri_img/special_activity/collection.png


BIN
dongri_img/special_activity/enemy.png


+ 8 - 0
dongri_pic.py

@@ -42,6 +42,7 @@ class monster_img:
     line5 = R'dongri_img\monster\line5.png'
     all_select = R'dongri_img\monster\all_select.png'
     attack = R'dongri_img\monster\attack.png'
+    attack2 = R'dongri_img\monster\attack2.png'
     enough_strengh = R'dongri_img\monster\enough_strengh.png'
     returnLine = R'dongri_img\monster\returnLine.png'
     enter = R'dongri_img\monster\enter.png'
@@ -193,6 +194,13 @@ class special_activity_img:
     doing_task = R'dongri_img\special_activity\doing_task.png'
     task_done = R'dongri_img\special_activity\task_done.png'
 
+    ## 王城
+    collection = R'dongri_img\special_activity\collection.png'
+    enemy = R'dongri_img\special_activity\enemy.png'
+    mid_enemy_region = (289,416,311,433)
+    first_enemy_region = (182,206,261,229)
+
+
 
 
 _imported = False

+ 37 - 2
dongri_task.py

@@ -1048,7 +1048,7 @@ class task_fight_ranshuang(dongri_task):
     def run(self):
         basic_operate.backToGame()
         maxTime = 4
-        while waitClickImg_noWait_withBool((monster_img.ranshuang_attack, monster_img.ranshuang_search), 1, 1) and maxTime > 0:
+        while waitClickImg_noWait_withBool([monster_img.ranshuang_attack, monster_img.ranshuang_search], 1, 1) and maxTime > 0:
             maxTime -= 1
             continue
 
@@ -1056,6 +1056,40 @@ class task_fight_ranshuang(dongri_task):
         if waitClickImg_noWait_withBool([monster_img.fight, monster_img.fight2], 1, 1) == False:
             return False
         return True
+    
+
+class task_fight_enemy(dongri_task):
+    def __init__(self):
+        super().__init__(f"打敌人or王城")
+    def run(self):
+        basic_operate.go_town()
+        basic_operate.go_outside()
+        if waitClickImg_noWait_withBool(special_activity_img.collection, 2, 1) == False:
+            return False
+        if waitClickImg_noWait_withBool(special_activity_img.enemy, 2, 1) == False:
+            return False
+        
+        myTimeSleep_big()
+        firstPos = get_yys_random_point(special_activity_img.first_enemy_region)
+        pcacc_mouse.click(firstPos[0], firstPos[1])
+        myTimeSleep_big()
+        mid_enemy_pos = get_yys_random_point(special_activity_img.mid_enemy_region)
+        pcacc_mouse.click(mid_enemy_pos[0], mid_enemy_pos[1])
+        myTimeSleep_big()
+
+        if waitClickImg_noWait_withBool([monster_img.attack, monster_img.attack2, monster_img.ranshuang_attack], 2, 1) == False:
+            return False
+        if waitClickImg_noWait_withBool(monster_img.line1, 2, 1) == False:
+            return False
+        if waitFindImg_withBool(monster_img.no_hero, 2, 1) == True:
+            return False
+
+        if waitClickImg_noWait_withBool([monster_img.fight, monster_img.fight2], 2, 1) == False:
+            return False
+        return True
+
+
+
         
 
 
@@ -1064,7 +1098,8 @@ class task_fight_ranshuang(dongri_task):
 
 
 if __name__ == '__main__':
-    task_fight_ranshuang().run()
+    task_fight_enemy().run()
+    #task_fight_ranshuang().run()
     #task_gotoTree().run()
     #task_fight_jina_only().run()
     #task_checkConfilits().run()

+ 6 - 0
templates/index_dongri.html

@@ -95,6 +95,7 @@
         </div>
         <div class="operate-container">
             <button class="custom-button" id="atuoRanshuang_btn" onclick="begin_ranshuang()">自动燃霜</button>
+            <button class="custom-button" id="autoPalace_btn" onclick="auto_palace()">自动王城</button>
             <button class="custom-button" id="atuo_btn" onclick="begin_paticipate()">自动打熊</button>
             <button class="custom-button" id="resetScript_btn" onclick="reset_script()">重置脚本</button>
             <button class="custom-button" id="closegame_btn" onclick="close_game()">关闭游戏</button>
@@ -244,6 +245,11 @@
         function begin_ranshuang(){
             socket.emit('begin_auto_ranshuang')
         }
+
+        function auto_palace()
+        {
+            socket.emit('auto_place')
+        }
         
         function restart_game()
         {