Пример #1
0
    def is_reward_open(self,image1):
        rate1 = classfiy_histogram_with_split(image1, self.state_reward_open1)
        rate2 = classfiy_histogram_with_split(image1, self.state_reward_open2)
        rate3 = classfiy_histogram_with_split(image1, self.state_reward_open3)

        if rate1 >= 70 or rate2 >= 70 or rate3 >= 70:
            print('打开奖品界面')
            return True
        else:
            return False
Пример #2
0
 def is_failed_over(self,image1):
     rate = classfiy_histogram_with_split(image1, self.state_failed_over)
     if rate >= 80:
         print('失败结束界面')
         return True
     else:
         return False
Пример #3
0
 def is_success(self,image1):
     rate = classfiy_histogram_with_split(image1, self.state_success)
     if rate >= 80:
         print('胜利界面')
         return True
     else:
         return False
Пример #4
0
 def is_select(self,image1):
     rate = classfiy_histogram_with_split(image1, self.state_select)
     if rate >= 80:
         print('选择界面')
         return True
     else:
         return False
Пример #5
0
 def is_powerless(self,image1):
     rate = classfiy_histogram_with_split(image1, self.state_powerless)
     if rate >= 80:
         print('能量耗尽')
         return True
     else:
         return False
Пример #6
0
 def is_victory(self,image1):
     rate = classfiy_histogram_with_split(image1, self.state_victory)
     if rate >= 80:
         print('胜利完成界面')
         return True
     else:
         return False
Пример #7
0
 def is_reward(self,image1):
     rate = classfiy_histogram_with_split(image1, self.state_reward)
     if rate >= 73:
         print('宝箱界面')
         return True
     else:
         return False
Пример #8
0
    def is_failed(self, image1):
        image_re = image1.crop(self.resurrection_box)
        if self.is_debug:
            image_re.save("resurrection.png")
        rate = classfiy_histogram_with_split(image_re, self.state_resurrection)
        self.logging.debug("{} rate is {}".format("resurrection", rate))
        if rate >= 80:
            return True

        image = image1.crop(self.failed_box)
        if self.is_debug:
            image.save("failed.png")
        rate = classfiy_histogram_with_split(image, self.state_failed)
        self.logging.debug("{} rate is {}".format("fail", rate))
        if rate >= 85:
            return True
        else:
            return False
Пример #9
0
 def is_powerless(self, image1):
     image = image1.crop(self.powerless_box)
     if self.is_debug:
         image.save("powerless.png")
     rate = classfiy_histogram_with_split(image, self.state_powerless)
     self.logging.debug("{} rate is {}".format("no power", rate))
     if rate >= 80:
         return True
     else:
         return False
Пример #10
0
 def is_end(self, image1):
     image = image1.crop(self.end_box)
     if self.is_debug:
         image.save("end.png")
     rate = classfiy_histogram_with_split(image, self.state_end)
     self.logging.debug("{} rate is {}".format("end", rate))
     if rate >= 60:
         return True
     else:
         return False
Пример #11
0
 def is_no_water(self, image1):
     image = image1.crop(self.no_redwater_box)
     if self.is_debug:
         image.save("no_redwater.png")
     rate = classfiy_histogram_with_split(image, self.state_no_redwater)
     self.logging.debug("{} rate is {}".format("no_redwater", rate))
     if rate >= 90:
         return True
     else:
         return False
Пример #12
0
 def is_select(self, image1):
     image = image1.crop(self.select_box)
     if self.is_debug:
         image.save("select.png")
     rate = classfiy_histogram_with_split(image, self.state_select)
     self.logging.debug("{} rate is {}".format("select", rate))
     if rate >= 90:
         return True
     else:
         return False
Пример #13
0
 def sold_five_star_rune(self, image1):
     image = image1.crop(self.five_start_sold_box)
     if self.is_debug:
         image.save("sold_five_star_rune.png")
     rate = classfiy_histogram_with_split(
         image, self.state_sold_five_star_rune_image)
     self.logging.debug("{} rate is {}".format("sold_five_star_rune", rate))
     if rate >= 90:
         return True
     else:
         return False