Browse Source

first iteration of the bot

master
Pixdigit 5 years ago
commit
4de1ac5c16
  1. 31
      main.py

31
main.py

@ -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…
Cancel
Save