mirror of
https://github.com/RootKit-Org/AI-Aimbot.git
synced 2025-06-21 02:41:01 +08:00
masking update
This commit is contained in:
parent
8429fe0441
commit
a43e16432c
@ -3,11 +3,12 @@ screenShotHeight = 320
|
||||
screenShotWidth = 320
|
||||
|
||||
# For use in games that are 3rd person and character model interferes with the autoaim
|
||||
# EXAMPLE: Fortnite and New World
|
||||
aaRightShift = 0
|
||||
useMask = False
|
||||
maskWidth = 80
|
||||
maskHeight = 200
|
||||
|
||||
# Autoaim mouse movement amplifier
|
||||
aaMovementAmp = .4
|
||||
aaMovementAmp = .1
|
||||
|
||||
# Person Class Confidence
|
||||
confidence = 0.4
|
||||
|
@ -5,7 +5,7 @@ import bettercam
|
||||
# Could be do with
|
||||
# from config import *
|
||||
# But we are writing it out for clarity for new devs
|
||||
from config import aaRightShift, screenShotHeight, screenShotWidth
|
||||
from config import screenShotHeight, screenShotWidth
|
||||
|
||||
def gameSelection() -> (bettercam.BetterCam, int, int | None):
|
||||
# Selecting the correct game window
|
||||
@ -55,18 +55,8 @@ def gameSelection() -> (bettercam.BetterCam, int, int | None):
|
||||
return None
|
||||
print("Successfully activated the game window...")
|
||||
|
||||
# Setting up the screen shots
|
||||
sctArea: dict[str, int] = {"mon": 1, "top": videoGameWindow.top + (videoGameWindow.height - screenShotHeight) // 2,
|
||||
"left": aaRightShift + ((videoGameWindow.left + videoGameWindow.right) // 2) - (screenShotWidth // 2),
|
||||
"width": screenShotWidth,
|
||||
"height": screenShotHeight}
|
||||
|
||||
#! Uncomment if you want to view the entire screen
|
||||
# sctArea = {"mon": 1, "top": 0, "left": 0, "width": 1920, "height": 1080}
|
||||
|
||||
# Starting screenshoting engine
|
||||
left = aaRightShift + \
|
||||
((videoGameWindow.left + videoGameWindow.right) // 2) - (screenShotWidth // 2)
|
||||
left = ((videoGameWindow.left + videoGameWindow.right) // 2) - (screenShotWidth // 2)
|
||||
top = videoGameWindow.top + \
|
||||
(videoGameWindow.height - screenShotHeight) // 2
|
||||
right, bottom = left + screenShotWidth, top + screenShotHeight
|
||||
@ -74,8 +64,10 @@ def gameSelection() -> (bettercam.BetterCam, int, int | None):
|
||||
region: tuple = (left, top, right, bottom)
|
||||
|
||||
# Calculating the center Autoaim box
|
||||
cWidth: int = sctArea["width"] / 2
|
||||
cHeight: int = sctArea["height"] / 2
|
||||
cWidth: int = screenShotWidth // 2
|
||||
cHeight: int = screenShotHeight // 2
|
||||
|
||||
print(region)
|
||||
|
||||
camera = bettercam.create(region=region, output_color="BGRA", max_buffer_len=512)
|
||||
if camera is None:
|
||||
|
7
main.py
7
main.py
@ -11,7 +11,7 @@ from utils.general import (cv2, non_max_suppression, xyxy2xywh)
|
||||
# Could be do with
|
||||
# from config import *
|
||||
# But we are writing it out for clarity for new devs
|
||||
from config import aaMovementAmp, aaRightShift, aaQuitKey, screenShotHeight, confidence, headshot_mode, cpsDisplay, visuals, centerOfScreen
|
||||
from config import aaMovementAmp, useMask, maskWidth, maskHeight, aaQuitKey, screenShotHeight, confidence, headshot_mode, cpsDisplay, visuals, centerOfScreen
|
||||
import gameSelection
|
||||
|
||||
def main():
|
||||
@ -41,6 +41,9 @@ def main():
|
||||
# Getting Frame
|
||||
npImg = np.array(camera.get_latest_frame())
|
||||
|
||||
if useMask:
|
||||
npImg[-maskHeight:, :maskWidth, :] = 0
|
||||
|
||||
# Normalizing Data
|
||||
im = torch.from_numpy(npImg)
|
||||
if im.shape[2] == 4:
|
||||
@ -99,7 +102,7 @@ def main():
|
||||
targets.sort_values(by="dist", ascending=False)
|
||||
|
||||
# Take the first person that shows up in the dataframe (Recall that we sort based on Euclidean distance)
|
||||
xMid = targets.iloc[0].current_mid_x + aaRightShift
|
||||
xMid = targets.iloc[0].current_mid_x
|
||||
yMid = targets.iloc[0].current_mid_y
|
||||
|
||||
box_height = targets.iloc[0].height
|
||||
|
@ -13,7 +13,7 @@ import torch
|
||||
# Could be do with
|
||||
# from config import *
|
||||
# But we are writing it out for clarity for new devs
|
||||
from config import aaMovementAmp, aaRightShift, aaQuitKey, confidence, headshot_mode, cpsDisplay, visuals, onnxChoice, centerOfScreen
|
||||
from config import aaMovementAmp, useMask, maskHeight, maskWidth, aaQuitKey, confidence, headshot_mode, cpsDisplay, visuals, onnxChoice, centerOfScreen
|
||||
import gameSelection
|
||||
|
||||
def main():
|
||||
@ -49,6 +49,9 @@ def main():
|
||||
# Getting Frame
|
||||
npImg = np.array(camera.get_latest_frame())
|
||||
|
||||
if useMask:
|
||||
npImg[-maskHeight:, :maskWidth, :] = 0
|
||||
|
||||
# If Nvidia, do this
|
||||
if onnxChoice == 3:
|
||||
# Normalizing Data
|
||||
@ -122,7 +125,7 @@ def main():
|
||||
targets.sort_values(by="dist", ascending=False)
|
||||
|
||||
# Take the first person that shows up in the dataframe (Recall that we sort based on Euclidean distance)
|
||||
xMid = targets.iloc[0].current_mid_x + aaRightShift
|
||||
xMid = targets.iloc[0].current_mid_x
|
||||
yMid = targets.iloc[0].current_mid_y
|
||||
|
||||
box_height = targets.iloc[0].height
|
||||
|
@ -13,7 +13,7 @@ import cupy as cp
|
||||
# Could be do with
|
||||
# from config import *
|
||||
# But we are writing it out for clarity for new devs
|
||||
from config import aaMovementAmp, aaRightShift, aaQuitKey, confidence, headshot_mode, cpsDisplay, visuals, centerOfScreen
|
||||
from config import aaMovementAmp, useMask, maskHeight, maskWidth, aaQuitKey, confidence, headshot_mode, cpsDisplay, visuals, centerOfScreen
|
||||
import gameSelection
|
||||
|
||||
def main():
|
||||
@ -41,6 +41,10 @@ def main():
|
||||
if npImg.shape[3] == 4:
|
||||
# If the image has an alpha channel, remove it
|
||||
npImg = npImg[:, :, :, :3]
|
||||
|
||||
if useMask:
|
||||
npImg[:, -maskHeight:, :maskWidth, :] = 0
|
||||
|
||||
im = npImg / 255
|
||||
im = im.astype(cp.half)
|
||||
|
||||
@ -90,7 +94,7 @@ def main():
|
||||
targets.sort_values(by="dist", ascending=False)
|
||||
|
||||
# Take the first person that shows up in the dataframe (Recall that we sort based on Euclidean distance)
|
||||
xMid = targets.iloc[0].current_mid_x + aaRightShift
|
||||
xMid = targets.iloc[0].current_mid_x
|
||||
yMid = targets.iloc[0].current_mid_y
|
||||
|
||||
box_height = targets.iloc[0].height
|
||||
|
Loading…
x
Reference in New Issue
Block a user