Esempio n. 1
0
def aimassist():
    global bAimLock
    c = interception()
    c.set_filter(
        interception.is_mouse,
        interception_mouse_state.INTERCEPTION_MOUSE_LEFT_BUTTON_DOWN.value)
    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)
def main():

    mouse = 0
    position = point(screen_width // 2, screen_height // 2)
    context = interception()
    context.set_filter(interception.is_keyboard,
                       interception_filter_key_state.INTERCEPTION_FILTER_KEY_DOWN.value |
                       interception_filter_key_state.INTERCEPTION_FILTER_KEY_UP.value)
    context.set_filter(interception.is_mouse,
                       interception_filter_mouse_state.INTERCEPTION_FILTER_MOUSE_MOVE.value )

    print(notice)

    while True:

        device = context.wait()
        if interception.is_mouse(device):
            if mouse == 0:
                mouse = device
                print( steps % (device - 10))

            mstroke = context.receive(device)

            position.x += mstroke.x
            position.y += mstroke.y
            
            if position.x < 0:
                position.x = 0
            if position.x > screen_width - 1:
                position.x = screen_width -1
            
            if position.y <0 :
                position.y = 0
            if position.y > screen_height - 1:
                position.y = screen_height -1
            
            mstroke.flags = interception_mouse_flag.INTERCEPTION_MOUSE_MOVE_ABSOLUTE.value
            mstroke.x = int((0xFFFF * position.x) / screen_width)
            mstroke.y = int((0xFFFF * position.y) / screen_height)
            
            context.send(device,mstroke)
        
        if mouse and interception.is_keyboard(device):
            kstroke = context.receive(device)

            if kstroke.code == esc:
                return

            if kstroke.state == interception_key_state.INTERCEPTION_KEY_DOWN.value:     
                if kstroke.code in curves:
                    math_track(context,mouse,position,*curves[kstroke.code])
                else:
                    context.send(device,kstroke)

            elif kstroke.state == interception_key_state.INTERCEPTION_KEY_UP.value:
                if not kstroke.code in curves:
                    context.send(device,kstroke)
            else:
                context.send(device,kstroke)
Esempio n. 3
0
def aimassist():
    c = interception()
    c.set_filter(
        interception.is_mouse,
        interception_mouse_state.INTERCEPTION_MOUSE_LEFT_BUTTON_DOWN.value
        | interception_mouse_state.INTERCEPTION_MOUSE_LEFT_BUTTON_UP.value)
    while True:
        device = c.wait()
        stroke = c.receive(device)
        if (stroke.state == interception_mouse_state.
                INTERCEPTION_MOUSE_LEFT_BUTTON_DOWN.value):
            bLeftButton = True
        while (bLeftButton):
            img = grab(886, 474, 1031, 608)
            try:
                for x in range(0, (1031 - 886)):
                    for y in range(0, (608 - 474)):
                        r, g, b = img.getpixel((x, y))
                        if approx(r, g, b) and x != 0 and y != 0:
                            newX = (
                                886 + x
                            ) - CENTER_X  # distance between crosshair and ennemy
                            raise Found
            except Found:
                if type(stroke) is mouse_stroke:
                    if (newX >= 50):
                        stroke.x = abs(
                            int(((newX - 5) / sensitivity) * offset_X))
                    elif (newX <= 49):
                        stroke.x = int(((newX + 5) / sensitivity) * offset_X)
                    c.send(device, stroke)
            device2 = c.wait2(0)
            if device2 != 0 and interception.is_mouse(device2):
                stroke2 = c.receive(device2)
                if (stroke2.state == 2):
                    stroke.state = interception_mouse_state.INTERCEPTION_MOUSE_LEFT_BUTTON_UP.value
                    c.send(device, stroke)
                    c.send(device2, stroke2)
                    break
            c.send(device, stroke)
Esempio n. 4
0
from interception import *
from win32api import GetSystemMetrics

# get screen size
screen_width = GetSystemMetrics(0)
screen_height = GetSystemMetrics(1)

# create a context for interception to use to send strokes, in this case
# we won't use filters, we will manually search for the first found mouse
context = interception()

# loop through all devices and check if they correspond to a mouse
mouse = 0
for i in range(MAX_DEVICES):
    if interception.is_mouse(i):
        mouse = i
        break

# no mouse we quit
if (mouse == 0):
    print("No mouse found")
    exit(0)


# we create a new mouse stroke, initially we use set right button down, we also use absolute move,
# and for the coordinate (x and y) we use center screen
mstroke = mouse_stroke(interception_mouse_state.INTERCEPTION_MOUSE_RIGHT_BUTTON_DOWN.value,
                           interception_mouse_flag.INTERCEPTION_MOUSE_MOVE_ABSOLUTE.value,
                           0,
                           int((0xFFFF * screen_width/2) / screen_width),
                           int((0xFFFF * screen_height/2) / screen_height),
Esempio n. 5
0
def setup_interception():
    global INTERCEPTION
    INTERCEPTION = interception()
    INTERCEPTION.set_filter(
        interception.is_keyboard,
        interception_filter_key_state.INTERCEPTION_FILTER_KEY_ALL.value)
Esempio n. 6
0
from interception import *
from consts import *

if __name__ == "__main__":
    c = interception()
    c.set_filter(
        interception.is_keyboard,
        interception_filter_key_state.INTERCEPTION_FILTER_KEY_UP.value)
    while True:
        device = c.wait()
        stroke = c.receive(device)
        if type(stroke) is key_stroke:
            print(stroke.code)
        c.send(device, stroke)
        # hwid = c.get_HWID(device)
        # print(u"%s" % hwid)