好的,所以我有这个脚本,它只点击具有某种灰色阴影的像素,除了一件事之外,它在大多数情况下都可以正常工作,它循环太长,每次我应该如何更改大约需要一秒钟在我找到一个有效像素后,我的休息会更好地工作并阻止它四处循环?
xx = 0
while xx <= 600:
with mss.mss() as sct:
region = {'top': 0, 'left': 0, 'width': 1920, 'height': 1080}
imgg = sct.grab(region)
pxls = imgg.pixels
for row, pxl in enumerate(pxls):
for col, pxll in enumerate(pxl):
if pxll == (102, 102, 102):
if col>=71 and col<=328 and row<=530 and row>=378:
foundpxl = pxll
print(str(col) +" , "+ str(row))
pyautogui.click(col,row)
break
xx = xx + 1
time.sleep(.05)
沧海一幻觉
BIG阳
相关分类