You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
818 B
32 lines
818 B
from pykeyboard import PyKeyboard as keyboard
|
|
import pyscreenshot as screenshot
|
|
import time
|
|
|
|
time.sleep(2)
|
|
|
|
k = keyboard()
|
|
|
|
try:
|
|
while True:
|
|
pushes = []
|
|
time.sleep(0.14)
|
|
img = screenshot.grab((662, 121, 1260, 1080))
|
|
left_img_pxls = [img.getpixel((230, 48 + i * 100)) for i in range(6)]
|
|
#right_img_pxls = [img.getpixel(369, 97 + 51 + i * 100) for i in range(5)]
|
|
for pxl in left_img_pxls:
|
|
if pxl == (161, 116, 56):
|
|
pushes.append("Right")
|
|
else:
|
|
pushes.append("Left")
|
|
|
|
pushes.reverse()
|
|
#img.save(str(pushes) + ".bmp")
|
|
|
|
for push in pushes:
|
|
k.tap_key(push)
|
|
time.sleep(0.019)
|
|
k.tap_key(push)
|
|
time.sleep(0.019)
|
|
except KeyboardInterrupt:
|
|
pass
|