import mss
import numpy as np
import time
import random
import interception
# ========== ИНИЦИАЛИЗАЦИЯ ДРАЙВЕРА ==========
interception.auto_capture_devices()
mouse = None
for device in interception.devices:
if interception.is_mouse(device):
mouse = device
break
if mouse is None:
print("[ОШИБКА] Мышь не найдена. Проверь установку драйвера Interception.")
exit()
print(f"[OK] Драйвер готов. Мышь найдена.")
# ========== ФУНКЦИЯ КЛИКА ЧЕРЕЗ ДРАЙВЕР ==========
def hardware_click():
stroke_down = interception.MouseStroke()
stroke_down.flags = interception.MouseFlag.LEFT_BUTTON_DOWN
stroke_down.rolling = 0
stroke_down.information = 0
stroke_up = interception.MouseStroke()
stroke_up.flags = interception.MouseFlag.LEFT_BUTTON_UP
stroke_up.rolling = 0
stroke_up.information = 0
interception.send(mouse, stroke_down)
time.sleep(random.uniform(0.005, 0.015))
interception.send(mouse, stroke_up)
def micro_move():
stroke = interception.MouseStroke()
stroke.flags = interception.MouseFlag.MOVE
stroke.x = random.randint(-2, 2)
stroke.y = random.randint(-2, 2)
stroke.rolling = 0
stroke.information = 0
interception.send(mouse, stroke)
# ========== НАСТРОЙКИ ==========
# Зона захвата (центр экрана, под прицелом)
TRIGGER_ZONE = {
"left": 955,
"top": 535,
"width": 10,
"height": 10
}
# ФИОЛЕТОВАЯ ОБВОДКА: R=255, G=159, B=255
R_MIN = 200
G_MAX = 100
B_MIN = 200
# Анти-робот
MIN_DELAY = 0.010
MAX_DELAY = 0.035
CHANCE = 0.87
# Анти-AFK
AFK_TIME = 55
# ========== ГЛАВНЫЙ ЦИКЛ ==========
last_move = time.time()
print("[ПОИСК] Ожидаю врага с фиолетовой обводкой...")
with mss.mss() as sct:
while True:
img = np.array(sct.grab(TRIGGER_ZONE))
r = img[:, :, 2].mean()
g = img[:, :, 1].mean()
b = img[:, :, 0].mean()
# Фиолет: высокий красный, низкий зелёный, высокий синий
if r > R_MIN and g < G_MAX and b > B_MIN:
if random.random() < CHANCE:
time.sleep(random.uniform(MIN_DELAY, MAX_DELAY))
hardware_click()
time.sleep(0.07)
# Анти-AFK
if time.time() - last_move > AFK_TIME:
micro_move()
last_move = time.time()
time.sleep(0.001)