示例#1
0
 def test_get_matches(self):
     location = os.path.join(base, "ok_box.png")
     base_location = os.path.join(base, "nox", "vagabond.png")
     black_screen = os.path.join(base, "nox", "black_screen.png")
     assert os.path.exists(location)
     assert os.path.exists(base_location)
     assert os.path.exists(black_screen)
     base_img = cv2.imread(base_location)
     trainer = tm.Trainer(base_img, 480, 50)
     self.assertTrue(trainer.get_matches(location, LOW_CORR) is False)
     base_img = cv2.imread(black_screen)
     trainer = tm.Trainer(base_img, 480, 50)
     self.assertTrue(trainer.get_matches(location, LOW_CORR) is False)
示例#2
0
 def compare_with_cancel_button(self, corr=HIGH_CORR, info=None, img=None):
     corrword = 'HIGH' if corr == HIGH_CORR else 'LOW'
     self.root.debug("LOOKING FOR CANCEL BUTTON, {} CORRERLATION".format(corrword))
     img = self.get_img_from_screen_shot()
     t = tm.Trainer(img, 240, 0)
     location = os.path.join(self.assets, "cancel_button.png")
     return self.__wrapper_kmeans_result__(t, location, corr, info)
示例#3
0
 def scan_for_download(self, corr=HIGH_CORR, info=None):
     corrword = 'HIGH' if corr == HIGH_CORR else 'LOW'
     self.root.debug("Looking for Download Button, {} CORRERLATION".format(corrword))
     img = self.get_img_from_screen_shot()
     t = tm.Trainer(img, 480, 0)
     location = os.path.join(self.assets, "download_button.png")
     return self.__wrapper_kmeans_result__(t, location, corr, info)
示例#4
0
 def scan_for_retry(self, corr=HIGH_CORR, info=None, img=None):
     corrword = 'HIGH' if corr == HIGH_CORR else 'LOW'
     self.root.debug("LOOKING FOR RETRY BUTTON, {} CORRERLATION".format(corrword))
     if img is None:
         img = self.get_img_from_screen_shot()
     t = tm.Trainer(img, 400, 500)
     location = os.path.join(self.assets, "retry.png")
     return self.__wrapper_kmeans_result__(t, location, corr, info)
示例#5
0
 def scan_for_ok(self, corr=HIGH_CORR, info=None, img=None):
     corrword = look_up_translation_correlation(corr)
     self.root.debug("LOOK FOR WORD '{}', {} CORRERLATION".format('OK', corrword))
     self.root.debug("scan_for_ok()")
     if img is None:
         img = self.get_img_from_screen_shot()
     t = tm.Trainer(img, 480, 50)
     location = os.path.join(self.assets, "ok_box.png")
     return self.__wrapper_kmeans_result__(t, location, corr, info)
示例#6
0
 def possible_battle_points(self):
     img = self.get_img_from_screen_shot()
     t = tm.Trainer(img)
     t.whiteCircles()
     current_page = self.get_current_page(img)
     logging.debug("Current-Page {}".format(current_page))
     for x, y in t.circlePoints:
         if not getattr(self.current_thread, "do_run", True):
             break
         yield x, y, current_page
示例#7
0
 def possible_battle_points(self):
     if self.run_time.stop:
         self.root.info("Received Stopping signal")
         return
     img = self.get_img_from_screen_shot()
     t = tm.Trainer(img)
     t.capture_white_circles()
     current_page = self.get_current_page(img)
     logging.debug("Current-Page {}".format(current_page))
     for x, y in t.circlePoints:
         if self.run_time.stop:
             self.root.info("Received Stopping signal")
             break
         yield x, y, current_page