def click_goto_fb(team_mode): if team_mode == 1: print("click zudui") return gc.click_pic("teamatdoor") else: print("click tansuo") return gc.click_pic("exploreratdoor")
def is_at_has_enemy_window(): return gc.has_pic("enemy")
def is_left_0_break_count(): if bc.has_pic("num0") == 0: return 1 else: return 0
def click_2_union(): return bc.click_pic_plus("unionmode", -200, 250)
def is_at_breaked_window(): return bc.has_pic("breakwin")
def is_at_1_union_window(): return bc.has_pic("union1")
def click_enemy(): return gc.click_pic("enemy")
def click_boss(): return gc.click_pic("boss")
def is_at_union_break_door_window(): return gc.has_pic("unionmode")
def is_at_self_break_door_window(): return gc.has_pic("selfmode")
def is_at_enchantment_break_door_window(): return gc.has_pic("enchantmentbreakdoor")
def is_at_open_box_window(): return gc.has_pic("openbox")
def is_at_end_fight_window(): return gc.has_pic("endfight")
def is_at_has_box_window(): return gc.has_pic("box")
def is_at_has_boss_window(): return gc.has_pic("boss")
def has_section(section_num): return gc.has_pic("section%s" % section_num)
def click_box(): return gc.click_pic("box")
def is_at_attack_break_window(): res = gc.has_pic("attackbreak") return res
def is_at_section_door(): return gc.has_pic("exploreratdoor")
def is_at_explorer_window(): return gc.has_pic("enchantmentbreak")
def click_pve_cost(): return gc.click_pic("pvecost")
def is_at_readyforfight_window(): return gc.has_pic("readyforfight")
def is_at_3_union_window(): return bc.has_pic("union3")
def is_at_lose_window(): return gc.has_pic("losewindow")
def click_1_union(): return bc.click_pic_plus("unionmode", -200, 100)
def click_section17(): return gc.click_pic("section17")
def click_3_union(): return bc.click_pic_plus("unionmode", -200, 420)
def click_section(section_num): return gc.click_pic("section%s" % section_num)
import os import cv2 from matplotlib import pyplot as plt from Biz import BaseControl BaseControl.save_screentshot() project_dir = os.path.dirname(os.getcwd()) + "\\Resource" img = cv2.imread(project_dir + "\\1.png", 0) img2 = img.copy() template = cv2.imread(project_dir + "\\attackbreak.png", 0) w, h = template.shape[::-1] # 6 中匹配效果对比算法 methods = ['cv2.TM_CCOEFF_NORMED'] #methods = [ 'cv2.TM_CCOEFF_NORMED', 'cv2.TM_CCORR_NORMED', 'cv2.TM_SQDIFF_NORMED'] # methods = ['cv2.TM_CCOEFF', 'cv2.TM_CCOEFF_NORMED', 'cv2.TM_CCORR', 'cv2.TM_CCORR_NORMED', 'cv2.TM_SQDIFF', 'cv2.TM_SQDIFF_NORMED'] for meth in methods: img = img2.copy() method = eval(meth) res = cv2.matchTemplate(img, template, method) min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res) if method in [cv2.TM_SQDIFF, cv2.TM_SQDIFF_NORMED]: top_left = min_loc print(1 - min_val) else:
def click_win_window(): return gc.db_click_pic("winwindow")