-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathNumberMemory.py
43 lines (37 loc) · 1.45 KB
/
NumberMemory.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
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pyautogui
import time
import webbrowser
webbrowser.open('https://www.humanbenchmark.com/tests/number-memory',
new=2)
time.sleep(3) # time it takes for webbrowser to open, change this to match your pc
delay = 1 # change this for delay in seconds between each round
lvls = 100 # change this to match how many lvls you want the bot to do
(width, height) = pyautogui.size()
print (width, height)
width = int(width / 2)
height = int(height / 3)
color = pyautogui.pixel(width, height)
hexColor = '%02x%02x%02x' % color
print hexColor
if hexColor == '0089ce':
(x, y) = pyautogui.locateCenterOnScreen('startnum.png')
pyautogui.click(width, height + 100)
for w in range(lvls):
# very simple just copies and pastes the number to the next page
pyautogui.click(x=width, y=height, clicks=3, interval=.25)
pyautogui.hotkey('ctrl', 'c')
hexColor = ''
while hexColor != '006ea5':
color = pyautogui.pixel(width, height)
hexColor = '%02x%02x%02x' % color
hexColor = ''
pyautogui.hotkey('ctrl', 'v')
pyautogui.press('enter')
time.sleep(delay)
if w != lvls - 1:
pyautogui.click(x, y)
else:
pyautogui.alert(text='Please have the tab fullscreened on your primary monitor, values may not work for resolutions other than 1920 by 1080'
, title='Game not detected!', button='Ok')