Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
108 views
in Technique[技术] by (71.8m points)

python - Color Aimbot does not lock

Recently I started learning programming and started with Python. And I wanted to write a cheat for my favorite game. I tried to write a color aimbot based on interception. But when I activate it, it does not lock on purple enemies. It does nothing

Here's my code:

S_HEIGHT, S_WIDTH = (PIL.ImageGrab.grab().size)# takes screenshot of the screen and return the size of the screenshot

def approx(r, g ,b): #Purple
    return 250 - 60 < r < 250 + 60 and 100 - 60 < g < 100 + 60 and 250 - 60 < b < 250 + 60

def aimassist():
    global bAimLock
    c = interception()
    c.set_filter(interception.is_mouse,interception_mouse_state.INTERCEPTION_MOUSE_LEFT_BUTTON_DOWN.value)#I changed _DOWN to _UP, still doesnt locks
    while True:
        hWnd = win32gui.FindWindow(None,"VALORANT  ")
        if(hWnd == win32gui.GetForegroundWindow()):
            device = c.wait()
            stroke = c.receive(device)
            img = aimlock_grab()
            try:
                for x in range(0,40):
                    for y in range(0,40):
                        r,g,b = img.getpixel((x,y))
                        if approx(r,g,b):
                            raise Found
            except Found:
                if type(stroke) is mouse_stroke:
                    if(bAimLock == True):
                        stroke.y = y
            c.send(device,stroke)
        else:
            device = c.wait()
            stroke = c.receive(device)
            c.send(device,stroke)
        #c._destroy_context()

### AIMASSIST CALISMIYOR

def aimlock_grab():
    with mss.mss() as sct:
        box = (950, 530, 990, 570) # box of 20x20 pixel around the crosshair
        img = sct.grab(box)
        return PIL.Image.frombytes('RGB',img.size,img.bgra,'raw','BGRX')
    ### AIMASSIST CALISMIYOR

if(bAimLock == True):#Calling aimbot
            if(bRunning == False):
                bRunning = True
                tAimLock = threading.Thread(target=aimassist)
                tAimLock.start()

    if(keyboard.is_pressed("ctrl + 4")):
        bAimLock = not bAimLock
        if(bAimLock == True):
            winsound.Beep(440, 75)
            winsound.Beep(700, 100)
        else:
            winsound.Beep(440, 75)
            winsound.Beep(200, 100)
        printgui()
question from:https://stackoverflow.com/questions/65909316/color-aimbot-does-not-lock

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...