def confirm(screenshot, adb: auto_adb): pos, val = template_matching(screenshot, image_reader('确定橙')) if val < 0.05: adb.tap_scale(pos) pos, val = template_matching(screenshot, image_reader('确定蓝')) if val < 0.05: adb.tap_scale(pos)
def test_getarea(self): shot = cv2.imdecode( numpy.fromfile('resource/image/mid-way-2.jpg', numpy.uint8), cv2.IMREAD_COLOR) template = cv2.imdecode( numpy.fromfile('resource/image/迎击.jpg', numpy.uint8), cv2.IMREAD_COLOR) template_matching(shot, template)
def escape(screenshot, adb: auto_adb): pos, val = template_matching(screenshot, image_reader('规避')) if val < 0.05: adb.tap_scale(pos)
def start_mission(screenshot, adb: auto_adb): pos, val = template_matching(screenshot, image_reader('立即前往')) if val < 0.05: adb.tap_scale(pos)
def sortout(screenshot, adb: auto_adb): pos, val = template_matching(screenshot, '整理.jpg') if val < 0.05: adb.tap_scale(pos)
def attack_confirm(screenshot, adb: auto_adb): pos, val = template_matching(screenshot, image_reader('出击')) if val < 0.05: adb.tap_scale(pos)
def cancel(screenshot, adb: auto_adb): pos, val = template_matching(screenshot, '取消.jpg') if val < 0.05: adb.tap_scale(pos)
def onekey_retire(screenshot, adb: auto_adb): pos, val = template_matching(screenshot, '一键退役.jpg') if val < 0.05: adb.tap_scale(pos)