-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVerbalMemory.py
More file actions
33 lines (28 loc) · 868 Bytes
/
VerbalMemory.py
File metadata and controls
33 lines (28 loc) · 868 Bytes
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
import pyautogui
import time
WHITE = (255, 255, 255)
def verbalMemory():
allWords = []
cntr = 0
time.sleep(3)
pyautogui.click(960, 740)
while True:
screenshot = pyautogui.screenshot(region=(770, 500, 355, 60))
word = [[0] * screenshot.width] * screenshot.height
for y in range(screenshot.height):
for x in range(screenshot.width):
pixel_color = screenshot.getpixel((x, y))
if pixel_color == WHITE:
word[y][x] = 1
if word in allWords:
pyautogui.click(870, 635)
else:
allWords.append(word)
pyautogui.click(1050, 635)
cntr += 1
if cntr > 500:
for i in range(10):
pyautogui.click(1050, 635)
break
time.sleep(0.1)
pyautogui.click(865, 740)