forked from jfd02/TFT-OCR-BOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mk_functions.py
49 lines (34 loc) · 1.27 KB
/
mk_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
"""
Handles sending input to the game, coords contain a cartesian ordered pair (x, y)
"""
import random
import pydirectinput
def left_click(coords: tuple) -> None:
"""Left clicks at argument ones coordinates"""
offset: int = random.randint(-3, 3)
pydirectinput.moveTo(coords[0] - offset, coords[1] - offset)
pydirectinput.mouseDown()
pydirectinput.mouseUp()
def right_click(coords: tuple) -> None:
"""Right clicks at argument ones coordinates"""
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:
"""Presses e at argument ones coordinates"""
offset: int = random.randint(-3, 3)
pydirectinput.moveTo(coords[0] - offset, coords[1] - offset)
pydirectinput.press("e")
def move_mouse(coords: tuple) -> None:
"""Moves mouse to argument ones coordinates"""
pydirectinput.moveTo(coords[0], coords[1])
def buy_xp() -> None:
"""Presses hotkey to purchase XP"""
pydirectinput.press("f")
def reroll() -> None:
"""Presses hotkey to purchase reroll"""
pydirectinput.press("d")
def press_esc() -> None:
"""Presses escape key"""
pydirectinput.press("esc")