aboutsummaryrefslogtreecommitdiff
path: root/bot.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot.py')
-rw-r--r--bot.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/bot.py b/bot.py
index 0716450..c419bbc 100644
--- a/bot.py
+++ b/bot.py
@@ -2,9 +2,12 @@ import time
2 2
3import mss 3import mss
4import pyautogui as pg 4import pyautogui as pg
5from keyboard import send
6from numpy import array, uint8 5from numpy import array, uint8
7 6
7#from keyboard import send
8
9from pynput.keyboard import Key, Controller
10keyboard = Controller()
8 11
9def begin(): 12def begin():
10 pg.click(440, 900, 2) 13 pg.click(440, 900, 2)
@@ -36,7 +39,16 @@ with mss.mss() as sct:
36 left = [img[x, posY[0]] for x in posX] 39 left = [img[x, posY[0]] for x in posX]
37 for i in range(6): 40 for i in range(6):
38 if is_tree(left[i]): 41 if is_tree(left[i]):
39 send("right, right", True, True) 42 keyboard.press(Key.right)
43 keyboard.release(Key.right)
44 time.sleep(0.014)
45 keyboard.press(Key.right)
46 keyboard.release(Key.right)
40 else: 47 else:
41 send("left, left", True, True) 48 keyboard.press(Key.left)
42 time.sleep(0.145) 49 keyboard.release(Key.left)
50 time.sleep(0.014)
51 keyboard.press(Key.left)
52 keyboard.release(Key.left)
53 time.sleep(0.17)
54
Powered by cgit v1.2.3 (git 2.41.0)