Sfoglia il codice sorgente

!2 fix random region bug

pcacc 4 mesi fa
parent
commit
9122ab068f
3 ha cambiato i file con 10 aggiunte e 5 eliminazioni
  1. 1 1
      dongri_pic.py
  2. 7 3
      dongri_task.py
  3. 2 1
      scriptBase/comon.py

+ 1 - 1
dongri_pic.py

@@ -119,7 +119,7 @@ class check_img:
     line_orc = (193,159,250,180)
     pet_findtreature = R'dongri_img\check\pet_findtreasure.png'
     pet_success = R'dongri_img\check\pet_success.png'
-    pet_getRegion = (252, 485, 340, 537)
+    pet_getRegion = (238, 485, 340, 537)
     pet_advance = R'dongri_img\check\pet_advance.png'
     pet_junior = R'dongri_img\check\pet_junior.png'
     pet_senior = R'dongri_img\check\pet_senior.png'

+ 7 - 3
dongri_task.py

@@ -533,6 +533,8 @@ class task_checkStoreRoom(dongri_task):
         myTimeSleep_big()
         if waitFindImg_withBool(check_img.pet_findtreature, 2, 1) == False:
             pcacc_mouse.quickclick_current()
+            waitClickImg_noWait_withBool((check_img.detail,check_img.detail2), 2, 1)
+            basic_operate.go_town()
             if waitClickImg_noWait_withBool((check_img.storeroom, check_img.storeroom2, check_img.invite_free), 2, 1) == False:
                 return False
             myTimeSleep_big()
@@ -542,8 +544,10 @@ class task_checkStoreRoom(dongri_task):
             waitClickImg_noWait_withBool((check_img.get,check_img.bigGet), 2, 1)
         else:
             if waitClickImg_noWait_withBool(check_img.pet_success, 2, 1):
+                myTimeSleep_big()
                 dstPos = get_yys_random_point(check_img.pet_getRegion)
                 pcacc_mouse.click(dstPos[0], dstPos[1])
+                myTimeSleep_big()
             elif waitClickImg_noWait_withBool((check_img.pet_advance, check_img.pet_senior, check_img.pet_junior), 2, 1):
                 waitClickImg_noWait_withBool(check_img.pet_gotreature, 2, 1)
                 waitClickImg_noWait_withBool(check_img.pet_begintreature, 2, 1)
@@ -672,7 +676,7 @@ class task_information(dongri_task):
         basic_operate.go_outside()
 
         if False == waitFindImg_withBool(monster_img.enough_strengh, 2, 1):
-            if self.add_strengh:
+            if self.isAddStrengh:
                 basic_operate.add_strength()
                 basic_operate.go_outside()
             else:
@@ -911,11 +915,11 @@ if __name__ == '__main__':
     #basic_operate.add_strength()
     #task_fightMonster(False, False,False).run()
     #task_checkHelp().run()
-    #task_checkStoreRoom().run()
+    task_checkStoreRoom().run()
     #task_activity_lianmeng().run()
     #task_fight_yongbing(True).run()
     #task_collect([4,3,2,1]).run()
-    task_train("lv9").run()
+    #task_train("lv9").run()
     #task_information().run()
     #check_buildOrResearch().run()
     #task_checkDonata().run()

+ 2 - 1
scriptBase/comon.py

@@ -200,6 +200,7 @@ def get_random_point(region):
 
 def get_yys_random_point(region):
     dstRegion = yys_getRegion(region, True)
+    print(dstRegion)
     return get_random_point(dstRegion)
 
 
@@ -296,7 +297,7 @@ def getRegion(gamestr, region, isWidth):
     if tmpRet == False:
         return False
     if isWidth:
-        return (region[0] + tmpPos[0], region[1] + tmpPos[1], region[2], region[3])
+        return (region[0] + tmpPos[0], region[1] + tmpPos[1], region[2] - region[0], region[3] - region[1])
     else:
         return (region[0] + tmpPos[0], region[1] + tmpPos[1], region[2] + tmpPos[0], region[3] + tmpPos[1])
 def game_region():