예제 #1
0
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")
예제 #2
0
def is_at_has_enemy_window():
    return gc.has_pic("enemy")
예제 #3
0
def is_left_0_break_count():
    if bc.has_pic("num0") == 0:
        return 1
    else:
        return 0
예제 #4
0
def click_2_union():
    return bc.click_pic_plus("unionmode", -200, 250)
예제 #5
0
def is_at_breaked_window():
    return bc.has_pic("breakwin")
예제 #6
0
def is_at_1_union_window():
    return bc.has_pic("union1")
예제 #7
0
def click_enemy():
    return gc.click_pic("enemy")
예제 #8
0
def click_boss():
    return gc.click_pic("boss")
예제 #9
0
def is_at_union_break_door_window():
    return gc.has_pic("unionmode")
예제 #10
0
def is_at_self_break_door_window():
    return gc.has_pic("selfmode")
예제 #11
0
def is_at_enchantment_break_door_window():
    return gc.has_pic("enchantmentbreakdoor")
예제 #12
0
def is_at_open_box_window():
    return gc.has_pic("openbox")
예제 #13
0
def is_at_end_fight_window():
    return gc.has_pic("endfight")
예제 #14
0
def is_at_has_box_window():
    return gc.has_pic("box")
예제 #15
0
def is_at_has_boss_window():
    return gc.has_pic("boss")
예제 #16
0
def has_section(section_num):
    return gc.has_pic("section%s" % section_num)
예제 #17
0
def click_box():
    return gc.click_pic("box")
예제 #18
0
def is_at_attack_break_window():
    res = gc.has_pic("attackbreak")
    return res
예제 #19
0
def is_at_section_door():
    return gc.has_pic("exploreratdoor")
예제 #20
0
def is_at_explorer_window():
    return gc.has_pic("enchantmentbreak")
예제 #21
0
def click_pve_cost():
    return gc.click_pic("pvecost")
예제 #22
0
def is_at_readyforfight_window():
    return gc.has_pic("readyforfight")
예제 #23
0
def is_at_3_union_window():
    return bc.has_pic("union3")
예제 #24
0
def is_at_lose_window():
    return gc.has_pic("losewindow")
예제 #25
0
def click_1_union():
    return bc.click_pic_plus("unionmode", -200, 100)
예제 #26
0
def click_section17():
    return gc.click_pic("section17")
예제 #27
0
def click_3_union():
    return bc.click_pic_plus("unionmode", -200, 420)
예제 #28
0
def click_section(section_num):
    return gc.click_pic("section%s" % section_num)
예제 #29
0
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:
예제 #30
0
def click_win_window():
    return gc.db_click_pic("winwindow")