-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI Automation.py
55 lines (45 loc) · 1.82 KB
/
GUI Automation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import pyautogui
import time
def automate_click(x, y, clicks=1, interval=0.5):
pyautogui.moveTo(x, y, duration=0.5)
for _ in range(clicks):
pyautogui.click()
time.sleep(interval)
#minimize the ide
automate_click(260, 740, clicks=1, interval=1)
# Define the automate_click function for clicking
def automate_click_click(x, y, clicks=1, interval=0.5):
pyautogui.moveTo(x, y, duration=0.5)
for _ in range(clicks):
pyautogui.click()
time.sleep(interval)
# Define the automate_click function for right-clicking
def automate_click_right(x, y, clicks=1, interval=0.5):
pyautogui.moveTo(x, y, duration=0.5)
for _ in range(clicks):
pyautogui.click(button='right')
time.sleep(interval)
# Define the automate_click function for clicking without specifying the button
def automate_click_no_button(x, y, clicks=1, interval=0.5):
pyautogui.moveTo(x, y, duration=0.5)
for _ in range(clicks):
pyautogui.click()
time.sleep(interval)
pyautogui.write(str(i+1), interval=0.25)
def automate_click_no_button2(x, y, clicks=1, interval=0.5):
pyautogui.moveTo(x, y, duration=0.5)
for _ in range(clicks):
pyautogui.click()
time.sleep(interval)
# Define the coordinates and intervals
coordinates = [
(480, 350), # Click the next page
(1000, 400), # Right-click
(1020, 410), # Right-click menu click
(480, 480) # Save the photo
]
intervals = [1, 1, 1.5, 1] # Assuming interval 1 for all actions
# Loop through the actions
for i in range(60):
for coord, interval, click_function in zip(coordinates, intervals, [automate_click_click, automate_click_right, automate_click_no_button, automate_click_no_button2]):
click_function(*coord, clicks=1, interval=interval)