资源简介
study_auto_pic.rar
代码片段和文件信息
import os
import PIL.ImageGrab
import pyautogui
import win32api
import win32gui
#import win32ui
#from ctypes import windll
import win32con
import numpy
import time
import argparse
import cv2
import snapshot
import match
def error_exit(des):
print(des)
exit(-1)
def get_search_iamge(pos_list search_pic):
deal_left = pos_list[0]
deal_top = pos_list[1]
deal_right = pos_list[2]
deal_bottom = pos_list[3]
grab_image = snapshot.grab_screen(deal_leftdeal_topdeal_rightdeal_bottom)
grab_image.save(search_pic)
def find_question():
search_pic = r‘.\tmp_output\search_question.png‘
get_search_iamge(question_pos_list search_pic)
#find question pos
#template_pic = r‘.\template\right_wrong_temp.png‘
template_pic = r‘.\template\right_wrong4_temp.png‘
threshold = 0.50
find_flag left top w h = match.get_match_image_pos(threshold template_pic search_pic)
find_question_flag = find_flag
if find_question_flag:
print(‘==========find find_question_flag ‘)
else:
print(‘==========warning not find_question_flag ‘)
if find_question_flag:
mouse_focus_x = question_pos_list[0] + left + 22
mouse_focus_y = question_pos_list[1] + top + 12
abs_x = deal_left + mouse_focus_x
abs_y = deal_top + mouse_focus_y
pyautogui.moveTo(abs_xabs_y)
pyautogui.click()
#snapshot.move_mouse(abs_x abs_y)
return find_question_flag
def find_question_globa():
grab_image = snapshot.grab_screen(0 0 screen_width screen_height)
search_pic = r‘.\template\src_screen.bmp‘
#find question pos
#template_pic = r‘.\template\right_wrong_temp.png‘
template_pic = r‘.\template\right_wrong4_temp.png‘
threshold = 0.60
find_flag left top w h = match.get_match_image_pos(threshold template_pic search_pic)
find_question_flag = find_flag
if find_question_flag:
print(‘==========find find_question_flag in global‘)
else:
print(‘==========warning find_question_flag in global ‘)
if find_question_flag:
mouse_focus_x = left + 22
mouse_focus_y = top + 12
abs_x = deal_left + mouse_focus_x
abs_y = deal_top + mouse_focus_y
pyautogui.moveTo(abs_xabs_y)
pyautogui.click()
#snapshot.move_mouse(abs_x abs_y)
question_pos_list[0] = left - 100
question_pos_list[1] = top - 100
question_pos_list[2] = left + 700
question_pos_list[3] = top + 700
return find_question_flag
def find_daan():
search_pic = r‘.\tmp_output\search_question.png‘
get_search_iamge(question_pos_list search_pic)
#find question pos
template_pic = r‘.\template\dijiaondaan_temp.png‘
threshold = 0.60
find_flag left top w h = match.get_match_image_pos(threshold template_pic search_pic)
if find_flag:
print(‘==========find find_daan ‘)
else:
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 9579 2018-08-20 17:00 study_auto\main.py
文件 4390 2018-08-18 18:40 study_auto\match.py
文件 4794 2018-08-18 19:05 study_auto\snapshot.py
文件 2188 2018-08-16 14:35 study_auto\template\chongbo_temp.png
文件 1734 2018-08-16 15:28 study_auto\template\dijiaondaan_temp.png
文件 1848 2018-08-16 13:26 study_auto\template\kejianhua_tem_no_voice.png
文件 1966 2018-08-16 13:29 study_auto\template\kejianhua_tem_voice.png
文件 462 2018-08-16 18:35 study_auto\template\kejian_tem.png
文件 707 2018-08-16 16:23 study_auto\template\queding_temp.png
文件 1657 2018-08-16 12:11 study_auto\template\right_wrong_temp.png
文件 1028 2018-08-16 11:08 study_auto\template\weikaishi_temp.png
文件 1019 2018-08-16 11:08 study_auto\template\xuexizhong_temp.png
目录 0 2018-08-20 16:53 study_auto\template
目录 0 2018-08-20 17:01 study_auto\tmp_output
目录 0 2018-08-20 16:52 study_auto
----------- --------- ---------- ----- ----
31372 15
相关资源
- 带非期望产出的SBM模型.rar
- 透视自瞄源码.7z
- 推荐的ros学习方法和较好教程书籍.
- 日期算法.exe
- 第九章报告-校园十大优秀青年评比
- CiscoSecureACSforWindowsSeverV4.2.txt
- news2.zip
- premiere cs4绿化插件
- 黑雨.rar
-
downloadli
nk.txt - 科讯精准扶贫系统.pdf
- tosuba_5509031.zip
- SuperResourceExtract.zip
- OpenGLSETest.zip
- 资源合集_集成clover最新版.txt
- tlwg888_3695499.zip
- unity4.x-2017.2.0f03全版本破解windows版本
- tianyanshi9337_10249724.zip
- 125482超级爆破字典.rar
- C程序设计教程第二版答案钱能.zip
- genPwd.bat
- 打包解包整理vs2013.zip
- was打包器.exe
- VJ1604E-蒙泰新曲线.rar
- lic_standalone.rar
- sh-demand-forecast-alg.zip
- vmware_keygen_20180725.zip
- 中国省份和城市对照表及城市分级.
- cudnn8.0.txt
- IWO.rar.zip
评论
共有 条评论