Skip to content

Instantly share code, notes, and snippets.

@jsrimr
Created February 23, 2022 12:14
Show Gist options
  • Save jsrimr/f4b426c30448e2ee7cd94683c97ab5da to your computer and use it in GitHub Desktop.
Save jsrimr/f4b426c30448e2ee7cd94683c97ab5da to your computer and use it in GitHub Desktop.
autoclick
"""
ref : https://ccurity.tistory.com/231
"""
import datetime
import time
import pyautogui as m
import schedule
import argparse
# 1140, 451 을 누르자
def custom_click(**kwargs):
# m.click(748, 466, clicks=3)
# m.click(1125, 451, clicks=3)
m.click(kwargs['x'], kwargs['y'], clicks=3)
print(f'{datetime.datetime.now().strftime("%H:%M:%S")}에 {kwargs["x"]},{kwargs["y"]}를 클릭하였습니다.')
def main():
x = 741
y = 359
m.moveTo(x, y)
for _ in range(6):
m.click()
print(f'{datetime.datetime.now().strftime("%H:%M:%S")}에 {x},{y}를 클릭하였습니다.')
if __name__ == "__main__":
# custom_click()
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('--x', type=int, default=1140)
parser.add_argument('--y', type=int, default=451)
args = parser.parse_args()
schedule.every().minute.at(":00").do(custom_click, x=args.x, y=args.y)
# schedule.every().minute.at(":00").do(custom_click)
while True:
schedule.run_pending()
time.sleep(0.3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment