파이썬(python)
[파이썬/python] 간단한 메크로 구현 with pyautogui
개발자 고포고
2022. 9. 13. 20:07
반응형
[파이썬/python] 간단한 메크로 구현 with pyautogui
#pyautogui.locateOnScreen - 해당 이미지 좌표 가져오기
#pyautogui.center - 해당 이미지의 중앙 좌표 가져오기
#pyautogui.press - 특정 버튼을 누른다
#pyautogui.moveTo - 특정 좌표로 이동한다
#pyautogui.scroll - 해당 좌표만큼 스크롤링 한다
#pyautogui.click - 마우스 클릭한다
#pyautogui.mouseUp - 마우스 up
#pyautogui.mouseDown - 마우스 down
import pyautogui as pag
from datetime import datetime
# 특정 시간에 진입
while True:
now = datetime.now().time()
if now.hour == 10 and now.minute == 0:
print('10시가 되어 진입')
while True:
sizeIcon = pag.locateOnScreen('sizeButton.PNG') # 특정 이미지 좌표 가져오기
if sizeIcon != None:
# 진행
print('진행')
# 특정 이미지 좌표의 중앙 값 가져오기
point = pag.center(sizeIcon)
print(point)
break
else:
# 리프레쉬
print('1초 후 리프레쉬')
pag.press('f5')
time.sleep(1)
break
else:
print(now)
#mecro #매크로 #파이썬 #python #pyautogui
반응형