-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclick_inventory.py
43 lines (33 loc) · 953 Bytes
/
click_inventory.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
import keyboard
import os
import pyautogui
import time
from configuration import MouseConfiguration
cfg = {
"first_inventory": {"X": 0, "Y": 0},
"first_cell": {"X": 0, "Y": 0},
}
def click_inv(_event=None):
for i in range(6):
pyautogui.click(
cfg["first_inventory"]["X"] + (i * 42.25),
cfg["first_inventory"]["Y"],
button="left",
)
for j in range(8):
for k in range(8):
pyautogui.click(
cfg["first_cell"]["X"] + (j * 45),
cfg["first_cell"]["Y"] + (k * 45),
button="right",
)
def stop(_event=None):
os._exit(0)
pyautogui.PAUSE = 0.01
config = MouseConfiguration(cfg, "configs/click_inventory.json")
config.load_configuration()
cfg = config.configuration
keyboard.on_press_key("f12", stop)
keyboard.on_press_key("f9", click_inv, True)
while True:
time.sleep(1)