Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Valorant
You last visited: Today at 23:43

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Mouse Movement Blocking

Discussion on Mouse Movement Blocking within the Valorant forum part of the Popular Games category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2022
Posts: 1
Received Thanks: 0
Mouse Movement Blocking

INTERCEPTION Aimbit Not Working

Code:
#pragma once

#include "pch.h"
#include "interception.h"
#include <stdio.h>
#include <iostream>
#include <thread>
#include <chrono>

using namespace std;

int get_screen_width(void) {
    return GetSystemMetrics(SM_CXSCREEN);
}

int get_screen_height(void) {
    return GetSystemMetrics(SM_CYSCREEN);
}

struct point {
    double x;
    double y;
    point(double x, double y) : x(x), y(y) {}
};

inline bool is_color(int red, int green, int blue) {
        if (green >= 190) {
            return false;
        }

        if (green >= 140) {
            return abs(red - blue) <= 8 &&
                red - green >= 50 &&
                blue - green >= 50 &&
                red >= 105 &&
                blue >= 105;
        }

        return abs(red - blue) <= 13 &&
            red - green >= 60 &&
            blue - green >= 60 &&
            red >= 110 &&
            blue >= 100;
}

InterceptionContext context;
InterceptionDevice device;
InterceptionStroke stroke;
BYTE* screenData = 0;
bool run_threads = true;
const int screen_width = get_screen_width(), screen_height = get_screen_height();

int aim_x = 0;
int aim_y = 0;

void bot() {
    int w = 100, h = 100;
    auto t_start = std::chrono::high_resolution_clock::now();
    auto t_end = std::chrono::high_resolution_clock::now();

    HDC hScreen = GetDC(NULL);
    HBITMAP hBitmap = CreateCompatibleBitmap(hScreen, w, h);
    screenData = (BYTE*)malloc(5 * screen_width * screen_height);
    HDC hDC = CreateCompatibleDC(hScreen);
    point middle_screen(screen_width / 2, screen_height / 2);

    BITMAPINFOHEADER bmi = { 0 };
    bmi.biSize = sizeof(BITMAPINFOHEADER);
    bmi.biPlanes = 1;
    bmi.biBitCount = 32;
    bmi.biWidth = w;
    bmi.biHeight = -h;
    bmi.biCompression = BI_RGB;
    bmi.biSizeImage = 0;

    while (run_threads) {
        Sleep(6);
        HGDIOBJ old_obj = SelectObject(hDC, hBitmap);
        BOOL bRet = BitBlt(hDC, 0, 0, w, h, hScreen, middle_screen.x - (w/2), middle_screen.y - (h/2), SRCCOPY);
        SelectObject(hDC, old_obj);
        GetDIBits(hDC, hBitmap, 0, h, screenData, (BITMAPINFO*)&bmi, DIB_RGB_COLORS);
        bool stop_loop = false;
        for (int j = 0; j < h; ++j) {
            for (int i = 0; i < w * 4; i += 4) {
                #define red screenData[i + (j*w*4) + 2]
                #define green screenData[i + (j*w*4) + 1]
                #define blue screenData[i + (j*w*4) + 0]

                if (is_color(red, green, blue)) {
                    aim_x = (i / 4) - (w/2);
                    aim_y = j - (h/2) + 3;
                    stop_loop = true;
                    break;
                }
            }
            if (stop_loop) {
                break;
            }
        }
        if (!stop_loop) {
            aim_x = 0;
            aim_y = 0;
        }
    }
}

int main(void) {
    double sensitivity = 0.52;
    double smoothing = 0.5;
    AllocConsole();
    AttachConsole(GetCurrentProcessId());
    auto w_f = freopen("CON", "w", stdout);
    auto r_f = freopen("CON", "r", stdin);
    cout << "YES" << endl;
    int mode = 0;
    cin >> sensitivity;
    cin >> smoothing;
    cin >> mode;
    fclose(w_f);
    fclose(r_f);
    FreeConsole();
    thread(bot).detach();
    auto t_start = std::chrono::high_resolution_clock::now();
    auto t_end = std::chrono::high_resolution_clock::now();
    auto left_start = std::chrono::high_resolution_clock::now();
    auto left_end = std::chrono::high_resolution_clock::now();
    double sensitivity_x = 1.0 / sensitivity / (screen_width / 1920.0) * 1.08;
    double sensitivity_y = 1.0 / sensitivity / (screen_height / 1080.0) * 1.08;
    bool left_down = false;
    
    context = interception_create_context();
    interception_set_filter(context, interception_is_mouse, INTERCEPTION_FILTER_MOUSE_ALL);

    while (interception_receive(context, device = interception_wait(context), &stroke, 1) > 0) {
        InterceptionMouseStroke& mstroke = *(InterceptionMouseStroke*)&stroke;
        t_end = std::chrono::high_resolution_clock::now();
        double elapsed_time_ms = std::chrono::duration<double, std::milli>(t_end - t_start).count();

        if (mstroke.state & INTERCEPTION_MOUSE_LEFT_BUTTON_UP) {
            left_down = false;
        }

        CURSORINFO cursorInfo = { 0 };
        cursorInfo.cbSize = sizeof(cursorInfo);
        GetCursorInfo(&cursorInfo);
        if (cursorInfo.flags != 1) {
            if (((mode & 1) > 0) && (mstroke.state & INTERCEPTION_MOUSE_LEFT_BUTTON_DOWN)) {
                left_down = true;
                if (elapsed_time_ms > 7) {
                    t_start = std::chrono::high_resolution_clock::now();
                    left_start = std::chrono::high_resolution_clock::now();
                    if (aim_x != 0 || aim_y != 0) {
                        mstroke.x += double(aim_x) * sensitivity_x;
                        mstroke.y += double(aim_y) * sensitivity_y;
                    }
                }
            }
            else if (((mode & 2) > 0) && (mstroke.flags == 0)) {
                if (elapsed_time_ms > 7) {
                    t_start = std::chrono::high_resolution_clock::now();
                    if (aim_x != 0 || aim_y != 0) {
                        left_end = std::chrono::high_resolution_clock::now();
                        double recoil_ms = std::chrono::duration<double, std::milli>(left_end - left_start).count();
                        double extra = 38.0 * (screen_height / 1080.0) * (recoil_ms / 1000.0);
                        if (!left_down) {
                            extra = 0;
                        }
                        else if (extra > 38.0) {
                            extra = 38.0;
                        }
                        double v_x = double(aim_x) * sensitivity_x * smoothing;
                        double v_y = double(aim_y + extra) * sensitivity_y * smoothing;
                        if (fabs(v_x) < 1.0) {
                            v_x = v_x > 0 ? 1.05 : -1.05;
                        }
                        if (fabs(v_y) < 1.0) {
                            v_y = v_y > 0 ? 1.05 : -1.05;
                        }
                        mstroke.x += v_x;
                        mstroke.y += v_y;
                    }
                }
            }
        }

        interception_send(context, device, &stroke, 1);
    }

    return 0;
}

BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
    switch (ul_reason_for_call) {
        case DLL_PROCESS_ATTACH:
            DisableThreadLibraryCalls(hModule);
            CreateThread(0, 0, (LPTHREAD_START_ROUTINE)main, 0, 0, 0);
        case DLL_THREAD_ATTACH:
        case DLL_THREAD_DETACH:
        case DLL_PROCESS_DETACH:
            interception_destroy_context(context);
            if (screenData) {
                free(screenData);
            }
            break;
    }

    return TRUE;
}
nopadok337 is offline  
Old 08/26/2022, 09:56   #2


 
LukeManolia's Avatar
 
elite*gold: 69
Join Date: Mar 2021
Posts: 1,112
Received Thanks: 265
this was never UD anyway
LukeManolia is offline  
Thanks
1 User
Old 08/30/2022, 05:05   #3
 
elite*gold: 0
Join Date: Jul 2022
Posts: 4
Received Thanks: 1
interception.h is patched
deeplo is offline  
Reply


Similar Threads Similar Threads
WASD Movement + 3rd Person Camera + Camera Follow Mouse / World Of Warcraft Style
10/18/2013 - League of Legends - 5 Replies
Imagine how FRICKEN LEGIT SWEET SICK that would be if the Camera was behind you, not overhead, you could move around using WASD and then remap all Spells to the Number Keys and also remap the Items to other keyboard keys or just the top number line, THEN LASTLY ON TOP OF ALL OF THAT, the Camera follows your mouse like a first person shooter, OR you left click and hold to adjust the mouse. For skills that are directional, I don't think there is a way normally to just show where that spell is...
Massive fps drop due to mouse movement
08/29/2010 - Silkroad Online - 1 Replies
Hi, I'm going away for 5 days so as a last hope I decided to post this here. Recently I've been having fps drop on silkroad, and basically every game I run in D3D. I don't know much about computers nor do I know what D3D really is but, I tried to run counter strike in D3D (normally it's opengl and runs fine) and it gave me the same problem. Now if I just use the keyboard, the fps lock. Even if I turn the camera around and stuff. But if I move my mouse a bit, even when standing still, it goes...
blocking-not blocking ?
02/22/2010 - Kal Online - 1 Replies
hey all , i just wanted to ask you, if gms can get you, if you use storms with cooldowns ? i mean.... is it the same like all other skills , or you can get auto blocked or sth ?i am talking for int server :p plz answer
[AutoIt] Bezier Mouse Movement
08/14/2009 - General Gaming Discussion - 0 Replies
It was originally written for GuildWars in mind, and their anti-macro detection. Dim $PtX Dim $PtY Dim $MaxPt = 3 Func Factorial($n) $value = 1 For $i = 2 To $n $value = $value * $i
Wallhack movement bugs out when moving with mouse?
09/23/2008 - Dekaron Private Server - 8 Replies
i made a wallhakc that workd, but when i try to move via the mouse, my char starts moving really fast across the map in different directions, anyone know what i did wrong?



All times are GMT +1. The time now is 23:43.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.