【发布时间】:2021-09-06 00:27:14
【问题描述】:
这是我的代码:
while (1):
pic = pyautogui.screenshot(region=(200,150,1600,800))
width, height = pic.size
for x in range (0,width,1):
for y in range (0,height,1):
r,g,b = pic.getpixel((x,y))
if r == 71 and g == 38:
click(x+200, y+150)
time.sleep(0.5)
if pyautogui.locateOnScreen('kalk.png', grayscale=True,confidence=0.8) != None:
click(1111, 906)
time.sleep(0.5)
click(1155, 165)
time.sleep(0.5)
click(1342, 994)
pyautogui.press('a')
time.sleep(0.5)
pyautogui.press('a')
time.sleep(0.5)
pyautogui.press('a')
else:
pyautogui.press('ctrl')
continue
我想确保我的代码不能两次点击同一个地方,而是记住它点击过的地方,而不是第二次点击同一个地方。我该怎么做?
【问题讨论】:
标签: python click mouse pyautogui