AI-Aimbot icon indicating copy to clipboard operation
AI-Aimbot copied to clipboard

redo of aimbot activation logic

Open kotae4 opened this issue 2 years ago • 1 comments

  • now allows for toggle or hold type logic
  • configurable via two new settings

NOTE: I did not test the actual aimbot because I have an AMD gpu and don't want to bother using pytorch cpu, but I tested the logic I added and it works as expected on my cheap $20 keyboard (I'm honestly surprised hardware toggle keys don't mess it up, might be worth testing on other keyboards before merge)

kotae4 avatar Jun 28 '22 03:06 kotae4

Quick little script for testing:

# Remember: pip install pywin32
import win32api

def main():
    # What key to press to quit and shutdown the autoaim
    aaQuitKey = "Q";

    # What key to activate the aimbot functionality
    # Refer to: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
    aaActivateKey = 0x2;

    # Whether the `aaActivateKey` should be a toggle or not
    # If this value is `False` then you'll need to hold the key down
    aaShouldToggle = False;

    # State variables for whether the aimbot should be active
    aimbotActive = False;
    isActivateKeyDown = False;
    wasActivateKeyDown = False;
    while win32api.GetAsyncKeyState(ord(aaQuitKey)) == 0:
        # This checks if the key is currently held down
        isActivateKeyDown = (win32api.GetAsyncKeyState(aaActivateKey) & 0x8000) == 0x8000;
        # If we're in toggle mode and the key was *just* pressed this frame then we toggle the aimbot
        if ((aaShouldToggle == True) and (isActivateKeyDown == True) and (wasActivateKeyDown == False)):
            aimbotActive = not aimbotActive;
        # If we're not in toggle mode then we want the aimbot the be active only if the activate key is currently held down
        elif (aaShouldToggle == False):
            aimbotActive = isActivateKeyDown;
        # Now that we're done using 'isActivateKeyDown', we save its state so we can check it next frame
        wasActivateKeyDown = isActivateKeyDown;
        print("Active: {}".format(aimbotActive));


if __name__ == "__main__":
    main();

kotae4 avatar Jun 28 '22 03:06 kotae4