SunOner / sunone_aimbot

Aim-bot based on AI for all FPS games
https://discord.gg/sunone
MIT License
351 stars 100 forks source link

My mouse will keep moving and won't be able to locate the character #30

Closed ColoGlaze closed 10 months ago

ColoGlaze commented 10 months ago

My Python is version 3.9, and I have changed the "match cls" in the frame. py file to "if cls==0". Is this related? My mouse will keep moving in one direction while holding down the right mouse button after starting "main. py", but it cannot accurately move to the character. How can I solve this problem

ColoGlaze commented 10 months ago

In the window, characters can be recognized normally, but when the mouse is pressed, it will continue to move in one direction

ColoGlaze commented 10 months ago

Here is the code I modified in Python version 3.9, the framework. py file

def draw_helpers(annotated_frame, boxes): for item in boxes: if item is not None: for xyxy in item.xyxy: if show_boxes: annotated_frame = cv2.rectangle(annotated_frame, (int(xyxy[0].item()), int(xyxy[1].item())), (int(xyxy[2].item()), int(xyxy[3].item())), (0, 200, 0), 0) if show_labels: str_cls = '' for cls in item.cls: if cls == 0: str_cls = 'player' elif cls == 1: str_cls = 'bot' elif cls == 2: str_cls = 'weapon' elif cls == 3: str_cls = 'teammate_nickname' elif cls == 4: str_cls = 'dead_body' elif cls == 5: str_cls = 'hideout_target_human' elif cls == 6: str_cls = 'hideout_target_balls' elif cls == 7: str_cls = 'head' elif cls == 8: str_cls = 'smoke' elif cls == 9: str_cls = 'fire'

match cls:

                        #     case 0:
                        #         str_cls = 'player'
                        #     case 1:
                        #         str_cls = 'bot'
                        #     case 2:
                        #         str_cls = 'weapon'
                        #     case 3:
                        #         str_cls = 'teammate_nickname'
                        #     case 4:
                        #         str_cls = 'dead_body'
                        #     case 5:
                        #         str_cls = 'hideout_target_human'
                        #     case 6:
                        #         str_cls = 'hideout_target_balls'
                        #     case 7:
                        #         str_cls = 'head'
                        #     case 8:
                        #         str_cls = 'smoke'
                        #     case 9:
                        #         str_cls = 'fire'
                        if show_conf == False:
                            annotated_frame = cv2.putText(annotated_frame, str_cls, (int(xyxy[0].item()), int(xyxy[1].item() - 5)), cv2.FONT_HERSHEY_SIMPLEX , 1, (0, 200, 0), 1, cv2.LINE_AA)
                if show_conf:
                    for conf in item.conf:
                        annotated_frame = cv2.putText(annotated_frame, str('{} {:.2f}'.format(str_cls,conf.item())), (int(xyxy[0].item()), int(xyxy[1].item() - 5)), cv2.FONT_HERSHEY_SIMPLEX , 1, (0, 200, 0), 1, cv2.LINE_AA)
return annotated_frame
ColoGlaze commented 10 months ago

close the issue hes dead

Do you have any real-time chat social apps, such as Telegram or Discord? I think real-time chat can better handle some problems. I have compiled some improvement plans for these source codes

ColoGlaze commented 10 months ago

just post here im not gonna waste my time like i did on another person bro instant regret

close the issue hes dead

Do you have any real-time chat social apps, such as Telegram or Discord? I think real-time chat can better handle some problems. I have compiled some improvement plans for these source codes

As you can see in the video, when I start the project, regardless of which of the three weight files I use, the PT file, ONNX file, or engine file, they can correctly recognize the target. However, when I press the right mouse button, my mouse will continue to move in one direction instead of accurately hovering over a character that needs to be targeted. I think this may be a code logic error, But I didn't make any changes to the code, instead I ran it directly using the code on GitHub. I would be honored if the video could be helpful Uploading 8b2d669d845bad9d2809f03e3856b561.mp4…

ColoGlaze commented 10 months ago

https://github.com/SunOner/yolov8_aimbot/assets/125593179/e90b1791-de83-4908-8487-d55873339bed

SunOner commented 10 months ago

Read what absolute and relative coordinates are, it won't work on the desktop, and it won't hover over the picture. And due to the fact that he does not have a goal priority logic, it is there, the problem with choosing a goal is in object recognition. For example, there are 2 targets in one frame and he chooses a target, for example, on the right and starts moving towards it, in the next frame he does not recognize the target on the right and starts moving in the other direction. I think you've understood the logic.

SunOner commented 10 months ago

If you want the aimbot to hover over images in the browser, do the following: 1) Change the object search area to options.py detection_window_width = your horizontal screen resolution detection_window_height = your vertical screen resolution 2) Change the logic of providing coordinates in targets.py

    def __init__(self, x, y, w, h, cls):
        self.mouse_x = x
        self.mouse_y = y
        self.distance = math.sqrt((x - screen_x_center)**2 + (y - screen_y_center)**2)
        self.x = x
        self.y = y
        self.w = w
        self.h = h
        self.cls = cls

3) Change the way the mouse moves in mouse.py

 if mouse_native == False and x is not None and y is not None:
        win32api.SetCursorPos((int(x), int(y)))

Done.