Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › Other Semi-Popular First Person Shooter Hacks › Alliance of Valiant Arms (AVA) Hacks & Cheats › Alliance of Valiant Arms (AVA) Coding / Source Code › A quick scope + switch macro

A quick scope + switch macro

Posts 1–3 of 3 · Page 1 of 1
asqapro
asqapro
A quick scope + switch macro
I had this idea earlier today, and tried making it, but ran into difficulties with the quickscoping part. The macro would wait until you left click, stop the left click, then right click. It would wait a period of time for the scope to zoom in (I found a table of zooming times on the AVA forums), then left click, and quickswitch (using any method, like q-q, or 1-2, 1-3, etc).

I got the quickswitch code down ez, but the quickscope is difficult, because by the time the program registers the left click, so has the game, and it already shoots.

Here's what I made so far:

Code:
#define WINVER 0x0500
#include <iostream>
#include <windows.h>
#include <winable.h>

using namespace std;

void quick_switch(){
    INPUT input;

    input.type = INPUT_KEYBOARD;
    input.ki.wScan = 0;
    input.ki.time = 0;
    input.ki.dwExtraInfo = 0;
    input.ki.wVk = 0x51; //Virtual keycode for Q, I'm too lazy to add other methods of quickswitching right now
    SendInput(1, &input, sizeof(INPUT));

    Sleep(10);

    input.ki.dwFlags = KEYEVENTF_KEYUP;
    SendInput(1, &input, sizeof(INPUT));
}

void unclick(bool left_or_right){
    INPUT input = {0};
    //input.mi.dwExtraInfo = 0x200;
    input.type = INPUT_MOUSE;
    if(left_or_right){ //if true, it's a left click
        input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
        SendInput(1, &input, sizeof(INPUT));
    }
    else if(!left_or_right){ //false, right click
        input.mi.dwFlags = MOUSEEVENTF_RIGHTUP;
        SendInput(1, &input, sizeof(INPUT));
    }
}

void click(bool left_or_right){
    INPUT input = {0};
    input.mi.dwExtraInfo = 0x200;
    input.type = INPUT_MOUSE;
    if(left_or_right){
        input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
        SendInput(1, &input, sizeof(INPUT));
    }
    else if(!left_or_right){
        input.mi.dwFlags = MOUSEEVENTF_RIGHTDOWN;
        SendInput(1, &input, sizeof(INPUT));
    }
}

int scope_speed_milliseconds;

LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam) { //hook for mouse wheel
    PKBDLLHOOKSTRUCT k = (PKBDLLHOOKSTRUCT)(lParam);


    if(wParam == WM_LBUTTONDOWN){
        unclick(true); //un_click left
        click(false); //click right
        unclick(false); //un_click right
        Sleep(scope_speed_milliseconds - 20); //wait for the scope to zoom
        click(true); //click left
        unclick(true); //un_click left
        quick_switch(); //quick switch using Q
        Sleep(15);
        quick_switch(); //switch back to main weapon
    }
    return CallNextHookEx(0, nCode, wParam, lParam);
}

MSG msg;

int main(){
    bool active = true;
    float scope_speed_seconds;
    //int scope_speed_milliseconds; //commented out to make global for mouse hook
    cout << "Scope speeds:" << endl;
    cout << "0.12s: Mosin Nagant Basic Scope, AWM Precision Scope" << endl;
    cout << "0.14s: FR-F2 Sharpshooter Scope, ASW.338 Quick Scope II, AWM Basic Scope, DSR-1 Quick Scope 2, Blaser R93 Sharpshooter Scope" << endl;
    cout << "0.16s: ASW.338 Sharpshooter Scope II" << endl;
    cout << "0.18s: ASW.338 Basic Scope" << endl;
    cout << "0.20s: M24 Basic Scope, SV98 Precision Scope, FR-F2 Basic Scope, DSR-1 Basic Scope, PGM.338 Precision Scope, Blaser R93 Precison Scope" << endl;
    cout << "0.21s: SV98 Basic Scope" << endl;
    cout << "0.22s: Blaser R93 Basic Scope, FR-F2 Quick Scope, DSR-1 High Powered Scope 2" << endl;
    cout << "0.30s: TPG1 High Powered Scope, PGM.338 High Powered Scope" << endl;
    cout << "0.34s: TPG1 Basic Scope, PGM.338 Basic Scope" << endl << endl;

    cout << "Enter your scope speed in seconds: ";
    cin >> scope_speed_seconds;

    scope_speed_milliseconds = scope_speed_seconds * 1000; //Sleep() takes milliseconds

    //HHOOK mousehook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc, NULL, 0);
    //SetTimer(NULL, 1, 5, (TIMERPROC) &MouseHookProc); //commented out while not in use

    while(true){
        while(active){
            if((GetKeyState(VK_LBUTTON) & 0x80) != 0){ //if the left mouse button is pressed
                unclick(true); //un_click left
                click(false); //click right
                unclick(false); //un_click right
                Sleep(scope_speed_milliseconds - 20); //wait for the scope to zoom
                click(true); //click left
                unclick(true); //un_click left
                quick_switch(); //quick switch using Q
                Sleep(15);
                quick_switch(); //switch back to main weapon

            }
        }
        //if(GetMessage(&msg, NULL, 0, 0)){
        //    TranslateMessage(&msg);
        //    DispatchMessage(&msg);
        //}
    }
    return 0;
}
Simple stuff, catching clicks and sending them. I was trying to make a mouse hook, but it did worse than just using GetKeyState(). I don't do injection hacks, but if someone could inject code into the game to allow this program to grab the left click before the game registers it, this could work. Quickscoping like this may not be very effective, but it's worth a shot.
#1 · 12y ago
WG
wGRWGHWGRERGrgergergrg
Dude thanks you gave me an awesome idea to fix a bug in my quickswitch

and now i'm gonna help you let the user of this macro use mousewheelbutton to shoot so if they klick the left mousebutton your programm klicks the right button go sleep and press the middlemouse button to shoot i may will give you credits for the quickscope idea if i add it to my macro :P
#2 · edited 12y ago · 12y ago
asqapro
asqapro
Oh man, I don't know how I didn't think of that XD Thank you so much, I'm gonna finish this quick
#3 · 12y ago
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

  • QUick scope tutorialBy ***crossfire*** in Combat Arms Discussions
    7Last post 16y ago
  • Call of duty quick scopeBy ***crossfire*** in Call of Duty 4 - Modern Warfare (MW) Hacks
    4Last post 16y ago
  • crossfire quick scope!!!!!!By ***crossfire*** in CrossFire Hacks & Cheats
    15Last post 16y ago
  • Quick Scope Hack/Cheating Tool ~ for SNIPERSBy cruel12 in Call of Duty Modern Warfare 2 Help
    2Last post 16y ago
  • {REQUEST} Auto Quick ScopeBy maspareven in Combat Arms Mod Discussion
    6Last post 16y ago

Tags for this Thread

None