CSGO-Aimbot
This is my attempt of making a CSGO Aim assist tool using Python, OpenCV and Haar Cascade Classifiers. This aimbot only works well against Counter Terrorists (as their color contrasts better against backgrounds than Terrorists).
You play normally as you would in CS:GO, but when you want to snap to a player, click the key that you set in the AIMBOT_CHARACTER
constant (default is l
).
To quit the aimbot, press the QUIT_KEY key (default is k
).
How it works
A Haar Cascade Classifier is an object detection method that trains on «positive» and «negative» images and creates a model that takes an image and outputs an array of rectangles which represents where it thinks a certain type of object exists (which is defined by what you choose to the desired object in the positive images).
In trainingdatageneration.py
, it takes screenshots of a certain part of your screen, converts them to grayscale and outputs them into either a positive or negative folder, depending on the button pressed (which can be done while playing CSGO normally, no need to tab out).
After getting screenshots and trying for a 2:1 ratio of positive to negative images, which I found to be the optimal choice online, you need to annotate the positive files. This is easily done using opencv’s cmd line tool opencv_annotation
. More info can be found here: https://docs.opencv.org/master/dc/d88/tutorial_traincascade.html
Create empty positives.txt
and negatives.txt
files
After installing, run opencv_annotation --annotations=positives.txt --images=positive/
and follow instructions given.
Then, use negfilegeneration.py
which will fill up your negatives.txt file with a list of all negative pictures.
Note: You will need to replace all the backslashes with forward slashes in your positive and negative folders.
Run opencv_createsamples -info positives.txt -w 24 -h 24 -num {NUMBER HIGHER THAN # objects in postiives) -vec positives.vec
The -w and -h are the mininum length of an object. See http://manpages.ubuntu.com/manpages/bionic/man1/opencv_createsamples.1.html for more info.
Run opencv_traincascade -data cascade/ -v positives.vec -bg neg.txt -w <same as above> -h <same as above> -numPos <number below # objects> -numNeg <number of negatives, aiming for 2:1 ratio) -numStages <play around with this>
Filtering
To attempt to filter away incorrectly identified objects from the model (as shown below):
- Only consider objects within a certain region in the screen (the sky, ground, gun often gets incorrectly chosen)
- Check if the middle of the object is a counter terrorist color by calculating its hsp value (which is a measure of brightness) and checking for other patterns I found through testing the pixel colors of CTs
After Filtering, the model boxes look like this:
Choosing Enemy to snap to
- The closest rectangle to the crosshair is what I decided to snap to. That’s due to the fact if a player has good crosshair placement such that the crosshair is near possible CT’s, it is more probable that it will snap to a CT and not a false positive.
With only selecting the closest rectangle, the below is what’s considered:
CSGO Settings
I have my sensitivity set to 2.5. If you want a different sensitivity, you might need to fiddle with the mouse move multiplier on x and y.
Make sure Raw Input
and Mouse acceleration
is set to off.
Its a good idea to bind decal clearing to movement so the aimbot doesn’t get confused by blood splatter.
To get better results, change your gun position to be lower and more to the right so it doens’t take up as much of the screen.
The Most Advanced Data Science Roadmaps You’ve Ever Seen!
Comes with Thousands of Free Learning Resources and ChatGPT Integration!
https://aigents.co/learn/roadmaps/intro
Welcome to my last YOLOv4 custom object detection tutorial from the whole series. After giving you a lot of explanations about YOLO, I decided to create something fun and exciting, which would be a Counter-Strike Global Offensive game aimbot. What is aimbot? The idea is to create an enemy detector, aim at that enemy and shoot it. The same concept we could use in real life for some security system, for example, detect and recognize people around our private house and if it’s an unknown person aim lights at that person or turn-on some alarm. Also, I thought it would be fun to create a water gun robot that could aim at approaching people and shoot the water. Why water? To avoid violence, of course.
But I am not talking about what we could do. Let’s talk about what I did. So, first, I took my YOLOv4 GitHub code, on which I was working for half a year, to make it easily understandable and reusable. I created a lot of tutorials to explain every part of it.
Then I used the technique explained in my previous tutorial to generate training data for my model to detect enemies accurately.
First, I would like to discuss instructions, how you can run it by yourself, results, and lastly, I will talk about code, so there will be three parts.
How to run/test GitHub code:
My testing environment:
- i7–7700k CPU and Nvidia 1080TI GPU
- OS Ubuntu 18.04
- CUDA 10.1
- cuDNN v7.6.5
- TensorRT-6.0.1.5
- Tensorflow-GPU 2.3.1
- The code was tested on Ubuntu and Windows 10 (TensorRT not supported officially)
Why ubuntu? Because it’s much easier to run TensorRT on Ubuntu than Windows 10, you can try to run it on Windows 10 with the following repository.
First, you must install TensorFlow, Python 3, Cuda, Cudnn, etc., packages to prepare the TensorFlow environment. Second, if you are on windows, it’s pretty easy and obvious how to install Steam. But if you are on Linux, it’s a little more complicated. I used the flatpak to do that:
1. sudo swupd bundle-list | grep desktop
2. sudo swupd bundle-add desktop
3. flatpak install flathub com.valvesoftware.Steam
Then run Steam with the following command in the terminal:
4. flatpak run com.valvesoftware.Steam
There still may be errors while installing or running Steam, but you should solve them with google help :).
5. In steam download Counter-Strike Global Offensive
When you have Steam and CSGO downloaded, we can download my GitHub repository. You can clone it or download it as a zip file; it doesn’t matter. I already zipped my trained model, which I put into the checkpoints folder. If you are on Windows, unzip it using 7zip. If you are on Linux, there are two ways how to unzip:
1. Download P7ZIP with GUI and unzip everything.
2. Install required packages:
sudo apt-get install unzip unrar p7zip-full
,
python3 -m pip install patool
,
python3 -m pip install pyunpack
. Now open the checkpoints folder and run linux_unzip_files.py
script.
Now you need to install all requirements:
pip install -r ./requirements.txt
Now, everything is ready. My yolov3/configs.py
file is already configured for custom trained object detection with an input_size
of 416. We need to run it. You may change YOLO_INPUT_SIZE
if you need better accuracy, but you will lose in FPS. Now, when you have running the CSGO game in the background, run the YOLO_aimbot_main.py
script. When YOLO detects objects on the screen, it should start moving the mouse and shooting the enemies.
If the mouse is flying around in-game, open the game console and type m_rawinput 0
, this will disable raw game input. Also, you may need to change sensitivity or other minor settings.
Achieved results:
So here is a short GIF from my results. Check my YouTube tutorial for more.
First, I should tell you that I used only around 1500 images to train my aimbot model. Most of this training data I generated with the method I explained in my previous tutorial. To make it even more accurate, it’s recommended to use more than 10 thousand images in different maps, and so on, then we would be sure that our model won’t detect enemies wrong. Best to understand my results would be to watch my YouTube video. Anyway, I ran three different test instances:
So, what do these Frames Per Second results tell us? At first, I used standard YOLO TensorFlow detection without TensorRT optimization. This is what you can get on Windows 10 with 1080TI GPU, but if you have a newer GPU, you can get better results.
Then I converted my TensorFlow model to the TensorRT INT8 model with an input size of 416. As you can see, FPS increased more than double. That’s what I was talking about. Mostly I would use this model for small maps, where our enemies come closer to us because it’s not that accurate with small objects.
And the last one is the TensorRT INT8 model with an input size of 608. As you can see, FPS is not that great, but I am sure that accuracy is very high. I would like to have NVIDIA 3080 or even 3090 to see what I could get with it. So, I am sure that the latest generation video card could reach much better results, so even if my current results are not so bad, can you imagine what you would get with these new cards?
A little about the code:
There is nothing to talk about about the code. If you have experience in Python, it will be pretty easy to understand the main script. For this tutorial, I wrote the YOLO_aimbot_main.py
script, which you can find on my GitHub repository.
def getwindowgeometry():
while True:
output = subprocess.getstatusoutput(f'xdotool search --name Counter-Strike getwindowgeometry')
if output[0] == 0:
t1 = time.time()
LIST = output[1].split("n")
Window = LIST[0][7:]
Position = LIST[1][12:-12]
x, y = Position.split(",")
x, y = int(x), int(y)
screen = LIST[1][-2]
Geometry = LIST[2][12:]
w, h = Geometry.split("x")
w, h = int(w), int(h)
outputFocus = subprocess.getstatusoutput(f'xdotool getwindowfocus')[1]
if outputFocus == Window:
return x, y, w, h
else:
print("Waiting for window")
time.sleep(5)
continue
If you would like to use this script on Windows 10, you need to modify it a little. Because I wrote a specific getwindowgeometry()
function that I use to get the geometry of my Counter-Strike window, I mean to get coordinates of the window. Also, if this function can’t find the Counter-Strike window, it keeps searching and doesn’t run the whole aimbot loop. Of course, you can implement the same stuff on windows, it’s even more straightforward, but I skipped this part because I don’t have windows 10. Or you can use X, Y, W, H coordinates instead, but check if they are correct at first.
And here is the main while loop:
while True:
t1 = time.time()
img = np.array(sct.grab({"top": y-30, "left": x, "width": w, "height": h, "mon": -1}))
img = cv2.cvtColor(img, cv2.COLOR_RGBA2RGB)
image, detection_list, bboxes = detect_enemy(yolo, np.copy(img), input_size=YOLO_INPUT_SIZE, CLASSES=TRAIN_CLASSES, rectangle_colors=(255,0,0))
cv2.circle(image,(int(w/2),int(h/2)), 3, (255,255,255), -1) # center of weapon sight
th_list, t_list = [], []
for detection in detection_list:
diff_x = (int(w/2) - int(detection[1]))*-1
diff_y = (int(h/2) - int(detection[2]))*-1
if detection[0] == "th":
th_list += [diff_x, diff_y]
elif detection[0] == "t":
t_list += [diff_x, diff_y]
if len(th_list)>0:
new = min(th_list[::2], key=abs)
index = th_list.index(new)
pyautogui.move(th_list[index], th_list[index+1])
if abs(th_list[index])<12:
pyautogui.click()
elif len(t_list)>0:
new = min(t_list[::2], key=abs)
index = t_list.index(new)
pyautogui.move(t_list[index], t_list[index+1])
if abs(t_list[index])<12:
pyautogui.click()
t2 = time.time()
times.append(t2-t1)
times = times[-50:]
ms = sum(times)/len(times)*1000
fps = 1000 / ms
print("FPS", fps)
image = cv2.putText(image, "Time: {:.1f}FPS".format(fps), (0, 30), cv2.FONT_HERSHEY_COMPLEX_SMALL, 1, (0, 0, 255), 2)
#cv2.imshow("OpenCV/Numpy normal", image)
#if cv2.waitKey(25) & 0xFF == ord("q"):
#cv2.destroyAllWindows()
#break
Everything is relatively easy. First, we grab a part of our game screen, and we use our YOLO detection to detect all objects on that image. As a return, we receive a picture with detected objects, detection_list (used to sort detections), and bboxes.
With cv2.circle
line: cv2.circle(image,(int(w/2),int(h/2)), 3, (255,255,255), -1)
we drew a white dot at the center of our weapon sight, and I used it to debug the targeting process.
With for detection in detection_list
for loop, I sort all the detections. My main goal is to find the th
-(terrorist head) and the t
-(terrorists) and put their center coordinates into two different lists. This is not a center coordinate, but distance-how far the enemy is from our weapon sight in pixels.
Next, my main goal is targeting the head because it’s much easier to shoot an enemy, although I am making an aimbot here. So, if our detected enemy is not further away than 12 pixels, it will fire at that enemy. Otherwise, I am trying to find the closest target to me and aim at it. And I am doing the same process all the time. It’s pretty simple.
Command cv2.putText(image, "Time: {:.1f}FPS".format(fps), (0, 30), cv2.FONT_HERSHEY_COMPLEX_SMALL, 1, (0, 0, 255), 2)
is used to put frames per second text on our detected image, but it doesn’t matter if you are not using the cv2.imshow
line.
Conclusion:
So it was a pretty lovely and exciting journey while creating this YOLO tutorial series for you, my friends. This tutorial is only one example of thousands where we can use object detection. If I had the latest generation, Nvidia card results would be even more impressive. This tutorial proves that by using machine learning and object detection, we can automate almost any game. We need to have resources, time, and knowledge for that.
You can download this project files and use them at your own risk. You can continue developing on it. You can even create a reinforcement learning agent (I would be impressed to see one).
I believe that with Nvidia 3090 GPU, with 10k training images, and if you know how to optimize my code, you could achieve outstanding results even more by improving grabbing screen, detection, and post-processing times. This could be some undetectable legit cheat, lol
Anyway, thank you all for reading. I hope this tutorial was helpful for you. Like this article, subscribe to my YouTube channel, and see you on the next tutorials!
|
Authenticator Code |
|
Thread Tools |
Make your own color aimbot with python and arduino |
|
#1 |
|||||||||||
grandmaster55 Member Join Date: May 2015
Reputation: 560 Points: 6,022, Level: 8 Level up: 57%, 478 Points needed Activity: 14.3% Last Achievements |
Hi everyone im going to show you the EASIEST way of coding coloraim on python First you need an Arduino Leonardo with a usb host shield and you need to solder it like this https://www.youtube.com/watch?v=nBttwvgNOr8 Then upload this code to your arduino thanks @gr3gthepilot for sharing this code. I just added some serial reading things in it. Code: #include <Mouse.h> #include <Wire.h> #include <SPI.h> #include <usbhub.h> USB Usb; USBHub Hub(&Usb); byte bf[2]; #include <hidboot.h> HIDBoot<USB_HID_PROTOCOL_MOUSE> HidMouse(&Usb); String myString; int j = 0; int c = 0; int e = 0; int lmb = 0; int rmb = 0; int mmb = 0; int dx; int dy; int arr[2]; int arrv[8]; class MouseRptParser : public MouseReportParser { protected: void OnMouseMove (MOUSEINFO *mi); void OnLeftButtonUp (MOUSEINFO *mi); void OnLeftButtonDown (MOUSEINFO *mi); void OnRightButtonUp (MOUSEINFO *mi); void OnRightButtonDown (MOUSEINFO *mi); void OnMiddleButtonUp (MOUSEINFO *mi); void OnMiddleButtonDown (MOUSEINFO *mi); }; void MouseRptParser::OnMouseMove(MOUSEINFO *mi) { dx = mi->dX; dy = mi->dY; }; void MouseRptParser::OnLeftButtonUp (MOUSEINFO *mi) { lmb = 0; }; void MouseRptParser::OnLeftButtonDown (MOUSEINFO *mi) { lmb = 1; }; void MouseRptParser::OnRightButtonUp (MOUSEINFO *mi) { rmb = 0; }; void MouseRptParser::OnRightButtonDown (MOUSEINFO *mi) { rmb = 1; }; void MouseRptParser::OnMiddleButtonUp (MOUSEINFO *mi) { mmb = 0; }; void MouseRptParser::OnMiddleButtonDown (MOUSEINFO *mi) { mmb = 1; }; MouseRptParser Prs; void setup() { delay(5000); Mouse.begin(); Serial.begin(115200); Serial.setTimeout(1); Usb.Init(); HidMouse.SetReportParser(0, &Prs); } void loop() { dx = 0; dy = 0; j = 0; c = 0; e = 0; Usb.Task(); //Clicking if (lmb == 0){ Mouse.release(MOUSE_LEFT); } else if (lmb == 1){ Mouse.press(MOUSE_LEFT); } if (rmb == 0){ Mouse.release(MOUSE_RIGHT); } else if (rmb == 1){ Mouse.press(MOUSE_RIGHT); } if (mmb == 0){ Mouse.release(MOUSE_MIDDLE); } else if (mmb == 1){ Mouse.press(MOUSE_MIDDLE); } if (Serial.available() > 0) { Serial.readBytes(bf, 2); Mouse.move(bf[0], bf[1], 0); } else { Mouse.move(dx, dy); } } let’s go to python part, include some libraries ! Code: import cv2 from mss import mss import numpy as np import win32con, win32api import serial Cv2 for image proccessing, mss for Screencapturing (its same as bitblt on c++) win32api for checking status of keys and buttons and serial for arduino mouse movements. start mss and set fov, you can take fov as a input like COM Code: fov = 75 sct = mss() com = input("com..: ") arduino = serial.Serial(com, 115200) boyutlar = sct.monitors[1] boyutlar['left'] = int((boyutlar['width'] / 2) - (fov / 2)) boyutlar['top'] = int((boyutlar['height'] / 2) - (fov / 2)) boyutlar['width'] = fov boyutlar['height'] = fov mid = fov/2 Now we need to find HSV colours of purple enemies. Code: lower = np.array([140,110,150]) upper = np.array([150,195,255]) Mouse move function ; (you must send as byte to values so for negative values you need to use this function i cant explain why just google it if you need to know) Code: def mouse_move(x, y): x = int(x) y = int(y) if x < 0: x = x+256 if y < 0: y = y+256 pax = [x,y] arduino.write(pax) Sens settings Code: xspd = float(input("x speed...default 0.1 :")) yspd = float(input("y speed...default 0.1 :")) And now main loop, This part is Aimkey, proccessing image, calculating center of the purple enemies Code: while True: if win32api.GetAsyncKeyState(0x01) < 0: #AIM KEY img = np.array(sct.grab(boyutlar)) 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) cX = int(M["m10"] / M["m00"]) cY = int(M["m01"] / M["m00"]) x = -(mid - cX) if cX < mid else cX - mid y = -(mid - cY) if cY < mid else cY - mid x2 = x *xspd y2 = y *yspd mouse_move(x2,y2) You can improve it. This is just a simple solution. Example fullcode Code: import cv2 from mss import mss import numpy as np import win32api import serial ortakare = int(input("fov...: ")) sct = mss() com = input("com..: ") arduino = serial.Serial(com, 115200) boyutlar = sct.monitors[1] boyutlar['left'] = int((boyutlar['width'] / 2) - (ortakare / 2)) boyutlar['top'] = int((boyutlar['height'] / 2) - (ortakare / 2)) boyutlar['width'] = ortakare boyutlar['height'] = ortakare mid = ortakare/2 # lower = np.array([140,110,150]) # upper = np.array([150,195,255]) lower = np.array([140,111,160]) upper = np.array([148,154,194]) xspd = float(input("x speed...default 0.1 :")) yspd = float(input("y speed...default 0.1 :")) print("Ready !") def mousemove(x,y): if x < 0: x = x+256 if y < 0: y = y+256 pax = [int(x),int(y)] arduino.write(pax) while True: if win32api.GetAsyncKeyState(0x01) < 0: img = np.array(sct.grab(boyutlar)) 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) cX = int(M["m10"] / M["m00"]) cY = int(M["m01"] / M["m00"]) x = -(mid - cX) if cX < mid else cX - mid y = -(mid - cY) if cY < mid else cY - mid x2 = x *xspd y2 = y *yspd mousemove(x2,y2) If you want to ask questions add me on discord Enter The Ninja#1088 I know it’s shit source please dont remind it to me or slap that on my face. You can improve it here is a proof ~removed~
|
|||||||||||
grandmaster55 is offline |
|
#2 |
|||||||||||
gr3gthepilot h4x0!2 Join Date: Jan 2021
Reputation: 4845 Points: 12,319, Level: 14 Level up: 2%, 1,281 Points needed Activity: 2.4% Last Achievements |
yeah, that’s one way of doing it… also video title art is misleading since you will not unlock the vision behind walls, it’s just a basic colorbot, maybe ill release mine someday it, has some extra features… Colorbots are the simplest in terms of making them and also sadly the devs making them obsolete because all it takes is for them to start adding the colours that we are detecting into maps, which will completely screw over any colorbot Also, there are NN cheats that are harder to fool but are harder to set up I made two and they are posted in the following forums: ^Also nice tutorial! __________________ Discord: GPlays#3275 | YOLOv5 Aim Augmentation v1.0 | YOLOv4 Aim Augmentation v2.0 | YOLOv4 Aim Augmentation v3.0 | Guide to AI aimbot | HID Descriptor reader beta |
|
|||||||||||
gr3gthepilot is offline |
|
#3 |
|||||||||||
jobjozy n00bie Join Date: Jul 2020
Reputation: 10 Points: 925, Level: 2 Level up: 5%, 475 Points needed Activity: 2.4% |
Will it works in laptop ? |
|||||||||||
jobjozy is offline |
|
#4 |
|||||||||||
grandmaster55 Member
Join Date: May 2015
Reputation: 560 Points: 6,022, Level: 8 Level up: 57%, 478 Points needed Activity: 14.3% Last Achievements |
Quote:
Originally Posted by gr3gthepilot yeah, that’s one way of doing it… also video title art is misleading since you will not unlock the vision behind walls, it’s just a basic colorbot, maybe ill release mine someday it, has some extra features… Colorbots are the simplest in terms of making them and also sadly the devs making them obsolete because all it takes is for them to start adding the colours that we are detecting into maps, which will completely screw over any colorbot Also, there are NN cheats that are harder to fool but are harder to set up I made two and they are posted in the following forums: ^Also nice tutorial! Thank you master ! Quote:
Originally Posted by jobjozy Will it works in laptop ? yes ! __________________ Enter The Ninja#1088 |
|||||||||||
grandmaster55 is offline |
|
#5 |
|||||||||||
remakers007 n00bie Join Date: Dec 2012
Reputation: 11 Points: 6,526, Level: 9 Level up: 3%, 1,074 Points needed Activity: 2.7% Last Achievements |
Please send video tutorial! |
|||||||||||
remakers007 is offline |
|
#6 |
|||||||||||
ogzroot n00bie Join Date: Feb 2016
Reputation: 71 Points: 5,201, Level: 7 Level up: 78%, 199 Points needed Activity: 3.7% Last Achievements |
C++ Arduino Mouse move code can you share the code |
|||||||||||
ogzroot is offline |
|
#7 |
|||||||||||
grandmaster55 Member
Join Date: May 2015
Reputation: 560 Points: 6,022, Level: 8 Level up: 57%, 478 Points needed Activity: 14.3% Last Achievements |
Quote:
Originally Posted by remakers007 Please send video tutorial! Uhmmm… Maybe but not now. __________________ Enter The Ninja#1088 |
|||||||||||
grandmaster55 is offline |
|
#8 |
|||||||||||
amokachi Posting Well Join Date: Oct 2021
Reputation: -5 Points: 635, Level: 1 Level up: 47%, 265 Points needed Activity: 5.6% |
Is there a way to make it head lock? I tried to edit but broke it completely |
|||||||||||
amokachi is offline |
|
#9 |
|||||||||||
grandmaster55 Member
Join Date: May 2015
Reputation: 560 Points: 6,022, Level: 8 Level up: 57%, 478 Points needed Activity: 14.3% Last Achievements |
Quote:
Originally Posted by amokachi Is there a way to make it head lock? I tried to edit but broke it completely Search for extreme points opencv __________________ Enter The Ninja#1088 |
|||||||||||
grandmaster55 is offline |
|
#10 |
|||||||||||
megamanaco n00bie Join Date: Aug 2021
Reputation: 10 Points: 337, Level: 1 Level up: 85%, 63 Points needed Activity: 0% |
scroll wheel not working? |
|||||||||||
megamanaco is offline |
|
#11 |
|||||||||||
devanch n00bie Join Date: Dec 2017
Reputation: 10 Points: 3,761, Level: 6 Level up: 18%, 739 Points needed Activity: 2.0% Last Achievements |
Mouse’ not found. Does your sketch include the line ‘#include <Mouse.h>’? |
|||||||||||
devanch is offline |
|
#12 |
|||||||||||
Baimot n00bie Join Date: Dec 2021
Reputation: 10 Points: 33, Level: 1 Level up: 9%, 367 Points needed Activity: 2.7% |
Mouse movement is not working when connected to the host shield. Can anybody help me, please? |
|||||||||||
Baimot is offline |
|
#13 |
|||||||||||
WhizgetsDev Posting Well Join Date: Mar 2021 Location: Germany
Reputation: -561 Points: 1,004, Level: 2 Level up: 21%, 396 Points needed Activity: 3.9% Last Achievements |
Quote:
Originally Posted by Baimot Mouse movement is not working when connected to the host shield. Can anybody help me, please? Your Mouse is Probably not supported for the Arduino Script |
|||||||||||
WhizgetsDev is offline |
|
#14 |
|||||||||||
Baimot n00bie Join Date: Dec 2021
Reputation: 10 Points: 33, Level: 1 Level up: 9%, 367 Points needed Activity: 2.7% |
Yeah, Logitech mice don’t work with host shield because of the byte code Quote:
Originally Posted by WhizgetsDev Your Mouse is Probably not supported for the Arduino Script |
|||||||||||
Baimot is offline |
|
#15 |
|||||||||||
WhizgetsDev Posting Well Join Date: Mar 2021 Location: Germany
Reputation: -561 Points: 1,004, Level: 2 Level up: 21%, 396 Points needed Activity: 3.9% Last Achievements |
Quote:
Originally Posted by Baimot Yeah, Logitech mice don’t work with host shield because of the byte code u will not find any answer or fix for this on any forum, sadly. Code: #include <avr/pgmspace.h> #include <Usb.h> #include <usbhub.h> #include <avr/pgmspace.h> #include <hidboot.h> #include <hiduniversal.h> #include <Keyboard.h> #include <Mouse.h> USB Usb; HIDUniversal HidMouse(&Usb); struct { uint8_t buttons; int8_t x; int8_t y; int8_t wheel; } mouseReport; const byte buffSize = 32; char inputSeveral[buffSize]; byte maxChars; int inputInt = 0; float inputFloat = 0.0; char inputCsvString[12]; int x; int y; int shoot; void MoveMouseToXY(long x, long y) { long max = max(abs(x), abs(y)); int count = (int) (max / 127); signed char stepX = x / (count + 1); signed char stepY = y / (count + 1); for (int i = 0; i < count; i++) { Mouse.begin(); Mouse.move(stepX, stepY); Mouse.end(); } signed char resX = x - (stepX * count); signed char resY = y - (stepY * count); if (resX != 0 || resY != 0) { Mouse.begin(); Mouse.move(resX, resY); Mouse.end(); } } class MouseRptParser : public MouseReportParser { protected: virtual void OnMouseMove (MOUSEINFO* mi); virtual void OnLeftButtonUp (MOUSEINFO* mi); virtual void OnLeftButtonDown (MOUSEINFO* mi); virtual void OnRightButtonUp (MOUSEINFO* mi); virtual void OnRightButtonDown (MOUSEINFO* mi); virtual void OnMiddleButtonUp (MOUSEINFO* mi); virtual void OnMiddleButtonDown (MOUSEINFO* mi); virtual void OnX1ButtonUp (MOUSEINFO *mi); virtual void OnX1ButtonDown (MOUSEINFO *mi); virtual void OnX2ButtonUp (MOUSEINFO *mi); virtual void OnX2ButtonDown (MOUSEINFO *mi); virtual void OnWheelMove (MOUSEINFO *mi); }; void MouseRptParser::OnMouseMove(MOUSEINFO* mi) { MoveMouseToXY(mi->dX, mi->dY); }; void MouseRptParser::OnLeftButtonUp(MOUSEINFO* mi) { Mouse.begin(); Mouse.release(MOUSE_LEFT); Mouse.end(); }; void MouseRptParser::OnLeftButtonDown(MOUSEINFO* mi) { Mouse.begin(); Mouse.press(MOUSE_LEFT); Mouse.end(); }; void MouseRptParser::OnRightButtonUp(MOUSEINFO* mi) { Mouse.begin(); Mouse.release(MOUSE_RIGHT); Mouse.end(); }; void MouseRptParser::OnRightButtonDown(MOUSEINFO* mi) { Mouse.begin(); Mouse.press(MOUSE_RIGHT); Mouse.end(); }; void MouseRptParser::OnMiddleButtonUp(MOUSEINFO* mi) { Mouse.begin(); Mouse.release(MOUSE_MIDDLE); Mouse.end(); }; void MouseRptParser::OnMiddleButtonDown(MOUSEINFO* mi) { Mouse.begin(); Mouse.press(MOUSE_MIDDLE); Mouse.end(); }; void MouseRptParser::OnX1ButtonUp(MOUSEINFO *mi) { Mouse.begin(); Mouse.release(MOUSE_BACK); Mouse.end(); }; void MouseRptParser::OnX1ButtonDown(MOUSEINFO *mi) { Mouse.begin(); Mouse.press(MOUSE_BACK); Mouse.end(); }; void MouseRptParser::OnX2ButtonUp(MOUSEINFO *mi) { Mouse.begin(); Mouse.release(MOUSE_FORWARD); Mouse.end(); }; void MouseRptParser::OnX2ButtonDown(MOUSEINFO *mi) { Mouse.begin(); Mouse.press(MOUSE_FORWARD); Mouse.end(); }; void MouseRptParser::OnWheelMove(MOUSEINFO *mi) { Mouse.begin(); Mouse.move(0, 0, mi->dZ); Mouse.end(); }; MouseRptParser Prs; void setup() { Serial.begin(115200); if (Usb.Init() == -1) Serial.println("Error."); HidMouse.SetReportParser(0,(HIDReportParser*)&Prs); } byte bf[3]; void loop() { Usb.Task(); if (Serial.available() > 0) { Serial.readBytes(bf, 3); Mouse.move(bf[0], bf[1], 0); Serial.read(); if(bf[2]==1){ Mouse.begin(); Mouse.press(MOUSE_LEFT); Mouse.release(MOUSE_LEFT); Mouse.end(); } } } |
|||||||||||
WhizgetsDev is offline |
|
#16 |
|||||||||||
Baimot n00bie Join Date: Dec 2021
Reputation: 10 Points: 33, Level: 1 Level up: 9%, 367 Points needed Activity: 2.7% |
Only moves up and down Yes, you are right, that the mouse movement works with Logitech now, but only up and down and not left and right. No matter where I move my mouse now, it only goes up or down. Is that fixable by maybe changing the axes? Quote:
Originally Posted by WhizgetsDev u will not find any answer or fix for this on any forum, sadly. Code: #include <avr/pgmspace.h> #include <Usb.h> #include <usbhub.h> #include <avr/pgmspace.h> #include <hidboot.h> #include <hiduniversal.h> #include <Keyboard.h> #include <Mouse.h> USB Usb; HIDUniversal HidMouse(&Usb); struct { uint8_t buttons; int8_t x; int8_t y; int8_t wheel; } mouseReport; const byte buffSize = 32; char inputSeveral[buffSize]; byte maxChars; int inputInt = 0; float inputFloat = 0.0; char inputCsvString[12]; int x; int y; int shoot; void MoveMouseToXY(long x, long y) { long max = max(abs(x), abs(y)); int count = (int) (max / 127); signed char stepX = x / (count + 1); signed char stepY = y / (count + 1); for (int i = 0; i < count; i++) { Mouse.begin(); Mouse.move(stepX, stepY); Mouse.end(); } signed char resX = x - (stepX * count); signed char resY = y - (stepY * count); if (resX != 0 || resY != 0) { Mouse.begin(); Mouse.move(resX, resY); Mouse.end(); } } class MouseRptParser : public MouseReportParser { protected: virtual void OnMouseMove (MOUSEINFO* mi); virtual void OnLeftButtonUp (MOUSEINFO* mi); virtual void OnLeftButtonDown (MOUSEINFO* mi); virtual void OnRightButtonUp (MOUSEINFO* mi); virtual void OnRightButtonDown (MOUSEINFO* mi); virtual void OnMiddleButtonUp (MOUSEINFO* mi); virtual void OnMiddleButtonDown (MOUSEINFO* mi); virtual void OnX1ButtonUp (MOUSEINFO *mi); virtual void OnX1ButtonDown (MOUSEINFO *mi); virtual void OnX2ButtonUp (MOUSEINFO *mi); virtual void OnX2ButtonDown (MOUSEINFO *mi); virtual void OnWheelMove (MOUSEINFO *mi); }; void MouseRptParser::OnMouseMove(MOUSEINFO* mi) { MoveMouseToXY(mi->dX, mi->dY); }; void MouseRptParser::OnLeftButtonUp(MOUSEINFO* mi) { Mouse.begin(); Mouse.release(MOUSE_LEFT); Mouse.end(); }; void MouseRptParser::OnLeftButtonDown(MOUSEINFO* mi) { Mouse.begin(); Mouse.press(MOUSE_LEFT); Mouse.end(); }; void MouseRptParser::OnRightButtonUp(MOUSEINFO* mi) { Mouse.begin(); Mouse.release(MOUSE_RIGHT); Mouse.end(); }; void MouseRptParser::OnRightButtonDown(MOUSEINFO* mi) { Mouse.begin(); Mouse.press(MOUSE_RIGHT); Mouse.end(); }; void MouseRptParser::OnMiddleButtonUp(MOUSEINFO* mi) { Mouse.begin(); Mouse.release(MOUSE_MIDDLE); Mouse.end(); }; void MouseRptParser::OnMiddleButtonDown(MOUSEINFO* mi) { Mouse.begin(); Mouse.press(MOUSE_MIDDLE); Mouse.end(); }; void MouseRptParser::OnX1ButtonUp(MOUSEINFO *mi) { Mouse.begin(); Mouse.release(MOUSE_BACK); Mouse.end(); }; void MouseRptParser::OnX1ButtonDown(MOUSEINFO *mi) { Mouse.begin(); Mouse.press(MOUSE_BACK); Mouse.end(); }; void MouseRptParser::OnX2ButtonUp(MOUSEINFO *mi) { Mouse.begin(); Mouse.release(MOUSE_FORWARD); Mouse.end(); }; void MouseRptParser::OnX2ButtonDown(MOUSEINFO *mi) { Mouse.begin(); Mouse.press(MOUSE_FORWARD); Mouse.end(); }; void MouseRptParser::OnWheelMove(MOUSEINFO *mi) { Mouse.begin(); Mouse.move(0, 0, mi->dZ); Mouse.end(); }; MouseRptParser Prs; void setup() { Serial.begin(115200); if (Usb.Init() == -1) Serial.println("Error."); HidMouse.SetReportParser(0,(HIDReportParser*)&Prs); } byte bf[3]; void loop() { Usb.Task(); if (Serial.available() > 0) { Serial.readBytes(bf, 3); Mouse.move(bf[0], bf[1], 0); Serial.read(); if(bf[2]==1){ Mouse.begin(); Mouse.press(MOUSE_LEFT); Mouse.release(MOUSE_LEFT); Mouse.end(); } } } |
|||||||||||
Baimot is offline |
|
#17 |
|||||||||||
0x33c Junior Member Join Date: Oct 2020
Reputation: 671 Points: 2,704, Level: 4 Level up: 87%, 96 Points needed Activity: 1.9% Last Achievements |
seems like valorant blocking the Quote: win32api.GetAsyncKeyState(0x01) < 0 if i am ingame near to enemy and press LMB => nothing happens i try to use an keyboard letter instead of the LMB but that doesnt work ingame aswell. rn i am to tired to try but i guess you can reverse trigger the python script with serial.write from the arduino when the LMB is pressed to the python script, the script just need to read serial and compare it like GetAsyncKeyState edit: nvm i was to tired, i need to run the script as admin then it works, thanks for the share
|
|||||||||||
0x33c is offline |
|
#18 |
|||||||||||
tomtht n00bie Join Date: Dec 2012
Reputation: 10 Points: 7,444, Level: 9 Level up: 86%, 156 Points needed Activity: 1.8% Last Achievements |
does this still work? |
|||||||||||
tomtht is offline |
|
#19 |
|||||||||||
FeSade n00bie Join Date: Apr 2019
Reputation: 10 Points: 2,104, Level: 4 Level up: 1%, 696 Points needed Activity: 0% Last Achievements |
Can someone help me? I think I did everything right, I solded the right jumpers, the arduino led are turning green when I plug it to the computer, the power cabe is also connected, but still my mouse don’t move when connected to the host shield, also my keyboard dont work |
|||||||||||
FeSade is offline |
|
#20 |
|||||||||||
icehawk11 Junior Member Join Date: Dec 2017
Reputation: 477 Points: 4,755, Level: 7 Level up: 29%, 645 Points needed Activity: 2.5% Last Achievements |
anyone know a link to buy the host shield wtf …. its close to impossible to get an arduino leonardo but its 100% impossible to get an host shield for it 99,9% of all host shields are for arduino uno |
|||||||||||
icehawk11 is offline |
|
Similar Threads |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Question] Arduino color aimbot | ZambuYT | Overwatch | 6 | 18th January 2019 11:21 PM |
Tags |
arduino, python, code, questions, add, discord, enter, ninja#1088, [tutorial], shit |
«
Previous Thread
|
Next Thread
»
Forum Jump |
All times are GMT. The time now is 02:49 AM.
Contact Us —
Toggle Dark Theme
Terms of Use Information Privacy Policy Information
Copyright ©2000-2023, Unknowncheats� UKCS #312436
no new posts
kir486680, updated
🕥
2020-10-25 08:15:09
Fastest CSGO Deep Learning Aim Assist! New Features!
- Extremely fast detection on GPU as well as good inference time on cpu
- Supports both YoloV3 Darknet(CPU) as well as YoloV5 Pytorch(GPU)(Still in devlopment not recommended to use)
- Currently supported maps: Dust(but you can also try other maps)
How to use
If you want to use a gpu, you should stick to the pytorch version(model is not accurate right now) and change «device» field in .ini file to gpu. If you want to use cpu, please compare which one is faster(darknet or pytorch) version on your own machine.
For Darknet Choose either detectionTkInterGui.py(still in beta) or detectionOpenCvGui.py(you will be able to see a screen with boxex around predicted models )
For better gpu inference you should use pytorch
Download yolov3-tiny.weights and yolov3-tiny.cfg(you can also use yolov3-tiny-prn_last.weights and yolov3-tiny-prn.cfg for greater speed but lower accuracy) or yolo5s-1.pt for pytorch detection from the following link
Edit friendlyTeam.txt file to add the classes that you want to detect (0 ,1 for Terrorist, Terrorist Head and 2,3 for Counter Terrorist and CT head)
Change capture params in .ini file according to your screen
Dont want to compile?
If you dont want to compile the file or you dont have python you can just go to the release page and run .exe file in the archive
Features Planned For Next Release
- Using a config file instead of txt(done)
- Add a yolov3-tiny-prn model(done)
- Use Multithreading to read the screen(In progress)
- Make a convinient recording utility to get more data(In progress)
Want To Help?
I would highly appreciate anybodys help with my project! If you are interested in working in a team you can contact me!([email protected])
Issues
mouse move
opened on 2022-01-31 08:49:11 by Aumopko
He has detected the target but the mouse will not move
Congrats and 1 bug detected
opened on 2020-10-26 20:53:33 by ofeksadlo
First of all well done!
I’ve made the same theme project and it’s nice to see something to compare to.
The first thing that I think you need to add is a requirement.txt.
But after installing all the required models by relaunching every time to see another model missing.
I tried to launch the detect.py in yolov5s-Pytorch and it gave me an error:
You did said it’s still in development so it’s ok if it’s not ready
The yolov3 version worked fine a bit slow on my laptop though.
I would consider to lower the input image for the model instead of 416×416 to something like 288×288 or even 160×160.
And instead of grabing the entire screen grab only the input image to accelerate detection time.
An FOV is important for an aimbot in order to focus on what you’re aiming on.
All in all great job!! waiting to see a decent implementation of yolov5.
how to make it use GPU instead of CPU on executable?
opened on 2020-10-09 02:22:44 by commonkitty
None
Questions
opened on 2020-09-24 07:54:56 by Catman155
Hi, I’ve got some questions regarding this project. I’m actually using yolov5 at work now and I maybe going to attempt a project like this myself.
Is yours functional yet?
I see you use MSS to record realtime. How many frames are you getting on which hardware?
Does it also work with the new skins introduced in csgo?
Would like to know.
name ‘net’ is not defined and no yolo has no attribute ‘net’
opened on 2020-08-14 00:28:46 by juanjoayala01
Hey, nice code, looks great, but could you help me with this? This happens when i try to run both of the files inside darknet folder.
net.setInput(blob)
NameError: name ‘net’ is not defined
self.net.setInput(blob)
AttributeError: ‘Yolo’ object has no attribute ‘net’
Releases
v0.2 Completely remastered 2020-06-30 15:12:24
- detectionGui.rar
- detectionNoGui.rar
This is the second alpha release for the Deep Learning aimbot. You have to simply download the archive and change value in friendlyTeam.txt file (#0 ,1 for Terrorist, Terrorist Head and 2,3 for Counter Terrorist and CT head). These values indicate your teammates that this hack wont react to. If you want to exit GUI version you can press Q to close the GUI and than close the console. For a non GUI version just hold Q and close the console.
First alpha version 2019-03-26 08:10:07
- CSGO_object_detection.rar
This is the first binary for my pre-release
-
#1
Ничего сверхъестественного, примитивный аим на Python.
Функции на скриншоте.
NoSpread — nop by SR_Team
ExtraWS — by FYP
download: https://github.com/ALF-ONE/PyAIM/releases
для обычных пользователей: .exe
для тех у кого есть Python: .pyw
Последнее редактирование: 28 Авг 2019
Удалённый пользователь 123482
Гость
-
#4
yes
upd:
там какая то лажа с exe, хз смогу ли исправить.
pyw отлично работает (зависимость — pip install pymem)
Последнее редактирование: 27 Авг 2019
-
#5
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
-
#6
дефолт.
если это дерьмо кому то будет нужно, то возможно я прикручу настройки и сделаю аим не по таргету
-
#7
и че за хуйня??
-
#8
это из за pyinstaller, там что то оно как то странно компилирует, я так и не разобрался.
но не смотря на эту ошибку всё работает если запущена игра и ты заспавнен(лично у меня работает).
ну, а если у тебя не работает, то могу предложить использовать .pyw версию или ждать фикса, если оно тебе надо
Последнее редактирование: 28 Авг 2019
-
#9
это из за pyinstaller, там что то оно как то странно компилирует, я так и не разобрался.
но не смотря на эту ошибку всё работает если запущена игры и ты заспавнен(лично у меня работает).ну, а если у тебя не работает, то могу предложить использовать .pyw версию или ждать фикса, если оно тебе надо
у меня есть phyton я юзал другой но запускаю и нихуя
-
#10
у меня есть phyton я юзал другой но запускаю и нихуя
если есть, то используй .pyw, зависимость — pip install pymem
я избавлюсь от этой зависимости, но позже
upd:
обновил, вроде как исправил эту ошибку
Последнее редактирование: 28 Авг 2019
-
#11
Что делать если наводит правее скина
-
#12
Что делать если наводит правее скина
с какого оружия?
-
#13
Что делать если наводит правее скина
Возможно проблема в Widescreen Fix? Если есть попробуй удалить временно
@ALF , кстати, совместим же с этим плагином?
-
#14
Дигл
Возможно проблема в Widescreen Fix? Если есть попробуй удалить временно
@ALF , кстати, совместим же с этим плагином?
у меня вайдскрина нету
-
#15
@ALF , кстати, совместим же с этим плагином?
не знаю
Автор оригинала: Huy Hoang.
По сути, я создал помощника aim для игры, используя машинное обучение, которое позже я назову Aimbot. Исключительно с помощью визуального ввода скриншота NAIMbot способен обнаружить врага на экране и рассчитать расстояние от центра экрана до врага и точно прицелиться в цель.
▬ ▬ ▬ ▬ Начало ▬ ▬ ▬ ▬ Моим первым препятствием было то, как перемещать игрока и мышь извне. После долгих исследований выяснилось, что приложения DirectX нуждаются в специальном вводе, и было важно правильно выполнить этот шаг, поскольку все построено на этом. Следующим шагом была попытка сделать вычисляемый ввод похожим на человеческий. Для этого мне нужно было создать функцию для восстановления парабол, чтобы начало движения мыши было медленнее, чем середина, так как человеку нужно ускорить физическую мышь.
После совершенствования этого я продолжил создавать компенсацию отдачи для каждого оружия, используя компьютерное зрение и GIF, содержащий все местоположения пуль. Это приводит к первой интересной части проекта.
▬ ▬ ▬ ▬ Компьютерное зрение ▬ ▬ ▬ ▬/| Чтобы распознать текущее оружие или ту сторону, на которой оно находится в данный момент, Наймботу нужно прочитать его где-то на экране, как это сделал бы человек. Я использовал cv2 для решения этой проблемы. cv2-это библиотека Python, ориентированная на компьютерное зрение. С его помощью я смог автоматизировать сбор и обработку данных.
▬ ▬ ▬ ▬ Сбор данных ▬ ▬ ▬ ▬//Хотя обычно данные должны быть помечены вручную, я нашел много способов автоматизировать сбор данных. Я, к сожалению, не могу раскрыть слишком много деталей, так как это мое конкурентное преимущество, но в случае этого проекта я использовал смесь внутриигровых данных и данных внешней памяти для сбора данных. Конечно, эти данные нуждались в обработке, которая была выполнена с использованием cv2 и знаний нейронных сетей.
▬ ▬ ▬ ▬ Машинное обучение ▬ ▬ ▬ ▬/| Часть машинного обучения сводится к части классификации и части локализации. Для локализации я использовал сверточную нейронную сеть региона. Поскольку я не был доволен точностью и скоростью, я переключился на обнаружение объектов Google, поскольку за ним стоят целые исследовательские группы. Скорость и точность были, наконец, разумными. Но чтобы улучшить его еще больше, я настроил гиперпараметры и изменил размер входного изображения. Трудной частью было сбалансировать скорость и точность, так как это очень зависит от используемого оборудования.
Есть еще несколько аспектов этого проекта, поскольку мой первоначальный план состоял в том, чтобы сделать NAIMbot коммерчески доступным, например, подключение базы данных к веб-сайту и запись на него при каждой покупке (чтобы избежать проблем с использованием лицензий на программное обеспечение) или создание графического пользовательского интерфейса. Эти вещи были более простыми, так что нет необходимости погружаться глубже, но если вы хотите узнать больше о чем-либо, не стесняйтесь спрашивать!
В заключение: Это означает, что я создал ненавязчивый помощник по прицеливанию, чего никогда раньше не было. Это открывает много дверей для конкурентной сцены, где помощь aim очень популярна. Вот почему я остановил проект. Я не хочу нести ответственность за то, что расстроил всю соревновательную сцену, которая мне нравится. Вместо этого я хотел бы использовать этот проект в качестве опыта. Тот факт, что я получил неизмеримое количество знаний от этого проекта, будет использован для того, чтобы помочь другим с их проблемами и идеями.