Skip to content

Commit 5558c34

Browse files
committed
Update index.py
1 parent c56b156 commit 5558c34

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

index.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@ def clickBtn(img,name=None, timeout=3, threshold = ct['default']):
116116
x,y,w,h = matches[0]
117117
pos_click_x = x+w/2
118118
pos_click_y = y+h/2
119-
120-
moveToWithRandomness(pos_click_x,pos_click_y,ct['mouse_speed'])
121-
pyautogui.click()
119+
120+
if (restrictArea(x=pos_click_x,y=pos_click_y) == False):
121+
moveToWithRandomness(pos_click_x,pos_click_y,ct['mouse_speed'])
122+
pyautogui.click()
122123

123124
return True
124125

0 commit comments

Comments
 (0)