aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bot.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/bot.py b/bot.py
index 5effc4b..e8f7a3c 100644
--- a/bot.py
+++ b/bot.py
@@ -1,33 +1,32 @@
1# from pyautogui import * 1import pyautogui as pg
2import pyautogui
3from time import sleep 2from time import sleep
4 3
5 4
6def move(_pos, _now): 5def move(_pos, _now):
7 if _pos == 'left' and _now == 'left': 6 if _pos == 'left' and _now == 'left':
8 pyautogui.typewrite(['left']) 7 pg.typewrite(['left'])
9 pyautogui.typewrite(['left']) 8 pg.typewrite(['left'])
10 elif _pos == 'left' and _now == 'right': 9 elif _pos == 'left' and _now == 'right':
11 pyautogui.typewrite(['right']) 10 pg.typewrite(['right'])
12 pyautogui.typewrite(['right']) 11 pg.typewrite(['right'])
13 elif _pos == 'right' and _now == 'right': 12 elif _pos == 'right' and _now == 'right':
14 pyautogui.typewrite(['right']) 13 pg.typewrite(['right'])
15 pyautogui.typewrite(['right']) 14 pg.typewrite(['right'])
16 elif _pos == 'right' and _now == 'left': 15 elif _pos == 'right' and _now == 'left':
17 pyautogui.typewrite(['left']) 16 pg.typewrite(['left'])
18 pyautogui.typewrite(['left']) 17 pg.typewrite(['left'])
19 18
20width, height = pyautogui.size() 19width, height = pg.size()
21width *= 0.5 20width *= 0.5
22pyautogui.moveTo(333, 600) 21pg.moveTo(333, 600)
23pyautogui.click() 22pg.click()
24 23
25posY = [360, 260, 160] 24posY = [360, 260, 160]
26posX = [276, 398] 25posX = [276, 398]
27 26
28q = ['left', 'left', 'left'] 27q = ['left', 'left', 'left']
29 28
30im = pyautogui.screenshot(region=(0, 0, width, height)) 29im = pg.screenshot(region=(0, 0, width, height))
31l0 = im.getpixel((posX[0], posY[0])) 30l0 = im.getpixel((posX[0], posY[0]))
32l1 = im.getpixel((posX[0], posY[1])) 31l1 = im.getpixel((posX[0], posY[1]))
33l2 = im.getpixel((posX[0], posY[2])) 32l2 = im.getpixel((posX[0], posY[2]))
@@ -58,7 +57,7 @@ while True:
58 move(pos, now) 57 move(pos, now)
59 qlen = 0 58 qlen = 0
60 elif qlen == 0: 59 elif qlen == 0:
61 im = pyautogui.screenshot(region=(0, 0, width, height)) 60 im = pg.screenshot(region=(0, 0, width, height))
62 l0 = im.getpixel((posX[0], posY[0])) 61 l0 = im.getpixel((posX[0], posY[0]))
63 l1 = im.getpixel((posX[0], posY[1])) 62 l1 = im.getpixel((posX[0], posY[1]))
64 l2 = im.getpixel((posX[0], posY[2])) 63 l2 = im.getpixel((posX[0], posY[2]))
Powered by cgit v1.2.3 (git 2.41.0)