-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot_functions.py
60 lines (40 loc) · 1.31 KB
/
bot_functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"""
Handles sending input to the game, coords contain a cartesian ordered pair (x, y)
"""
import random
import pydirectinput
from screen_coords import *
def left_click(coords: tuple) -> None:
offset: int = random.randint(-3, 3)
pydirectinput.moveTo(coords[0] - offset, coords[1] - offset)
pydirectinput.mouseDown()
pydirectinput.mouseUp()
def right_click(coords: tuple) -> None:
offset: int = random.randint(-3, 3)
pydirectinput.moveTo(coords[0] - offset, coords[1] - offset)
pydirectinput.mouseDown(button="right")
pydirectinput.mouseUp(button="right")
def press_e(coords: tuple) -> None:
offset: int = random.randint(-3, 3)
pydirectinput.moveTo(coords[0] - offset, coords[1] - offset)
pydirectinput.press("e")
def move_mouse(coords: tuple) -> None:
pydirectinput.moveTo(coords[0], coords[1])
def buy_xp() -> None:
pydirectinput.press("f")
def toggle_shop():
pydirectinput.press("space")
def toggle_items():
pydirectinput.press("v")
def toggle_lineup():
pydirectinput.press("tab")
def distribute_items():
pydirectinput.press("c")
def distribute_pieces():
pydirectinput.press("q")
def reroll() -> None:
pydirectinput.press("d")
def press_esc() -> None:
pydirectinput.press("esc")
def choose_item():
left_click(ITEMS_POS[1].get_coords())