commit
4de1ac5c16
1 changed files with 31 additions and 0 deletions
@ -0,0 +1,31 @@ |
|||
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, 97 + 51 + i * 100)) for i in range(5)] |
|||
#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 |
Loading…
Reference in new issue