颜色Aimbot不锁定

2024-03-29 07:47:42 发布

您现在位置:Python中文网/ 问答频道 /正文

最近我开始学习编程,并开始学习Python。 我想为我最喜欢的游戏写一个作弊。 我试着写一个基于截取的彩色aimbot。 但当我激活它时,它不会锁定紫色的敌人。它什么也不做

这是我的密码:

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()

Tags: andofthetrueimgsizereturnstroke