Статья Valorant Arduino Color Aimbot Помощь

Kernel.cpp

Исследователь
Сообщения
21
Реакции
2
Я адаптировал код аимбота arduino color для valorant, который нашел в интернете, но он выдает ошибку в какой-то части кода, как мне решить эту ошибку?

Кроме того, Arduino запускает отдельный файл Python или мне нужно что-то еще?

ошибка:
Python:
Traceback (most recent call last):
  File "C:\Users\*\source\repos\*\*\*.py", line 25, in <module>
    arduino = serial.Serial('COM6', 115200)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\*\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\serial\serialwin32.py", line 33, in __init__
    super(Serial, self).__init__(*args, **kwargs)
  File "C:\Users\*\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\serial\serialutil.py", line 244, in __init__
    self.open()
  File "C:\Users\*\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\serial\serialwin32.py", line 64, in open
    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'COM6': FileNotFoundError(2, 'Система не может найти указанный файл.', None, 2)
('COM6', 115200)

код:
Python:
import cv2
from mss import mss
import numpy as np
import win32api
import serial

# Aimbot
screenshot = None
center = None
speed = None

sct = mss()

def create_gui():
    global screenshot
    global center
    global speed

arduino = serial.Serial('COM6', 115200)

def update_fov(sender, data):
    fov = gui.get_value(sender)
    global screenshot
    global center
    screenshot = {
        'left': int((screenshot['width'] / 2) - (fov / 2)),
        'top': int((screenshot['height'] / 2) - (fov / 2)),
        'width': fov,
        'height': fov
    }
    center = fov / 2

# lower = np.array([140,110,150])
# upper = np.array([150,195,255])

xspd = 1
yspd = 1

lower = np.array([140,111,160])
upper = np.array([148,154,194])

def mousemove(x,y):
    if x < 0:
        x = x+256
    if y < 0:
        y = y+256

    pax = [int(x),int(y)]
    arduino.write(pax)


def Aimbot():
    while True:
        if win32api.GetAsyncKeyState(0x02) < 0:
      
            img = np.array(sct.grab(screenshot))
            hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
            mask = cv2.inRange(hsv, lower,upper)
            kernel = np.ones((3,3), np.uint8)
            dilated = cv2.dilate(mask,kernel,iterations= 5)
            thresh = cv2.threshold(dilated, 60, 255, cv2.THRESH_BINARY)[1]
            contours, hierarchy = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
            if len(contours) != 0:
                M = cv2.moments(thresh)
                point_to_aim = (int(M["m10"] / M["m00"]), int(M["m01"] / M["m00"]))
          
                closestX = point_to_aim[0] + 2
                closestY = point_to_aim[1] - 5
          
                diff_x = int(closestX - center)
                diff_y = int(closestY - center)
          
                target_x = diff_x * xspd
                target_y = diff_y * yspd
              
                mousemove(target_x, target_y)
 
Последнее редактирование:

sh1r0

Следопыт
Сообщения
74
Реакции
4
Python:
import cv2
from mss import mss
import numpy as np
import win32api
import serial

# Aimbot
screenshot = None
center = None
speed = None

sct = mss()

def create_gui():
    global screenshot
    global center
    global speed

def update_fov(sender, data):
    fov = gui.get_value(sender)
    global screenshot
    global center
    screenshot = {
        'left': int((screenshot['width'] / 2) - (fov / 2)),
        'top': int((screenshot['height'] / 2) - (fov / 2)),
        'width': fov,
        'height': fov
    }
    center = fov / 2

lower = np.array([140, 111, 160])
upper = np.array([148, 154, 194])

def mousemove(x, y):
    if x < 0:
        x = x + 256
    if y < 0:
        y = y + 256

    pax = [int(x), int(y)]
    arduino.write(pax)


def Aimbot():
    while True:
        if win32api.GetAsyncKeyState(0x02) < 0:
            img = np.array(sct.grab(screenshot))
            hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
            mask = cv2.inRange(hsv, lower, upper)
            kernel = np.ones((3, 3), np.uint8)
            dilated = cv2.dilate(mask, kernel, iterations=5)
            thresh = cv2.threshold(dilated, 60, 255, cv2.THRESH_BINARY)[1]
            contours, hierarchy = cv2.findContours(
                thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE
            )
            if len(contours) != 0:
                M = cv2.moments(thresh)
                point_to_aim = (
                    int(M["m10"] / M["m00"]),
                    int(M["m01"] / M["m00"]),
                )

                closestX = point_to_aim[0] + 2
                closestY = point_to_aim[1] - 5

                diff_x = int(closestX - center)
                diff_y = int(closestY - center)

                target_x = diff_x * xspd
                target_y = diff_y * yspd

                mousemove(target_x, target_y)


# Attempt to open the serial port
try:
    arduino = serial.Serial('COM6', 115200)
except serial.SerialException as e:
    print("Failed to open the serial port:", str(e))
    exit(1)  # Exit the program if the serial port cannot be opened

# Call the function to create the GUI (assuming it's implemented elsewhere)
create_gui()

# Start the aimbot
Aimbot()

# Close the serial port when finished
arduino.close()
 

Kernel.cpp

Исследователь
Сообщения
21
Реакции
2
Python:
import cv2
from mss import mss
import numpy as np
import win32api
import serial

# Aimbot
screenshot = None
center = None
speed = None

sct = mss()

def create_gui():
    global screenshot
    global center
    global speed

def update_fov(sender, data):
    fov = gui.get_value(sender)
    global screenshot
    global center
    screenshot = {
        'left': int((screenshot['width'] / 2) - (fov / 2)),
        'top': int((screenshot['height'] / 2) - (fov / 2)),
        'width': fov,
        'height': fov
    }
    center = fov / 2

lower = np.array([140, 111, 160])
upper = np.array([148, 154, 194])

def mousemove(x, y):
    if x < 0:
        x = x + 256
    if y < 0:
        y = y + 256

    pax = [int(x), int(y)]
    arduino.write(pax)


def Aimbot():
    while True:
        if win32api.GetAsyncKeyState(0x02) < 0:
            img = np.array(sct.grab(screenshot))
            hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
            mask = cv2.inRange(hsv, lower, upper)
            kernel = np.ones((3, 3), np.uint8)
            dilated = cv2.dilate(mask, kernel, iterations=5)
            thresh = cv2.threshold(dilated, 60, 255, cv2.THRESH_BINARY)[1]
            contours, hierarchy = cv2.findContours(
                thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE
            )
            if len(contours) != 0:
                M = cv2.moments(thresh)
                point_to_aim = (
                    int(M["m10"] / M["m00"]),
                    int(M["m01"] / M["m00"]),
                )

                closestX = point_to_aim[0] + 2
                closestY = point_to_aim[1] - 5

                diff_x = int(closestX - center)
                diff_y = int(closestY - center)

                target_x = diff_x * xspd
                target_y = diff_y * yspd

                mousemove(target_x, target_y)


# Attempt to open the serial port
try:
    arduino = serial.Serial('COM6', 115200)
except serial.SerialException as e:
    print("Failed to open the serial port:", str(e))
    exit(1)  # Exit the program if the serial port cannot be opened

# Call the function to create the GUI (assuming it's implemented elsewhere)
create_gui()

# Start the aimbot
Aimbot()

# Close the serial port when finished
arduino.close()
Я пытался подключить его к графическому интерфейсу, который я сделал с помощью python, могу ли я подключить его по этому поводу?
 

sh1r0

Следопыт
Сообщения
74
Реакции
4
Я пытался подключить его к графическому интерфейсу, который я сделал с помощью python, могу ли я подключить его по этому поводу?
Возможно, я просто посмотрел ошибку исправил вроде, но не проверял
 

Kernel.cpp

Исследователь
Сообщения
21
Реакции
2
Возможно, я просто посмотрел ошибку исправил вроде, но не проверял
Я сконвертировал в exe, мой друг выдает вот такую ошибку, когда открывает exe

 

sh1r0

Следопыт
Сообщения
74
Реакции
4
Код:
Traceback (most recent call last):
File "Poset_Guy.py", line 10, in <module>
ImportError: DLL load failed while importing win32api: The specified module could not be found.
[1504] Failed to execute script 'Poset_Guy' due to unhandled exception!
pip install pywin32
Там же в ошибке написано "DLL load failed while importing win32api"
 
Верх Низ