import mss
import numpy as np
import cv2
import keyboard
import win32gui
import win32api
import win32con
import time
import random
def get_valorant_hwnd():
return win32gui.FindWindow(None, "VALORANT ")
# Virtual Code for the H Key (0x48)
H_KEY = 0x48
def god_click(hwnd):
#
win32api.PostMessage(hwnd, win32con.WM_KEYDOWN, H_KEY, 0)
time.sleep(random.uniform(0.01, 0.02))
win32api.PostMessage(hwnd, win32con.WM_KEYUP, H_KEY, 0)
# Settings
lower_yellow = np.array([28, 175, 175])
upper_yellow = np.array([32, 255, 255])
monitor = {"top": 506, "left": 634, "width": 12, "height": 12}
hwnd = get_valorant_hwnd()
print("===AKTIF===")
print("Win32 API PostMessage | Tus: H")
with mss.mss() as sct:
while True:
if keyboard.is_pressed('alt'):
# FORCE
if not hwnd: hwnd = get_valorant_hwnd()
img = np.array(sct.grab(monitor))
hsv = cv2.cvtColor(img[:,:,:3], cv2.COLOR_BGR2HSV)
mask = cv2.inRange(hsv, lower_yellow, upper_yellow)
if np.sum(mask > 0) >= 2:
god_click(hwnd)
# Firing rate
time.sleep(random.uniform(0.05, 0.1))
time.sleep(0.0001)