Code:
#include "stdafx.h"
#include "windows.h"
#include <iostream>
#include <stdio.h>
using namespace std;
HDC hdcScreen;
COLORREF startPixel;
COLORREF nowPixel;
void shoot(){
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Sleep(50);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
int _tmain(int argc, _TCHAR* argv[])
{
bool started = false;
hdcScreen = GetDC(0);
while(true){
Sleep(10);
if(GetAsyncKeyState(VkKeyScan('h'))){
if(started != false){
started = true;
startPixel = GetPixel(hdcScreen, 802, 452); //Change to middle pixel of your screen if resolution is different.
}
nowPixel = GetPixel(hdcScreen, 802, 452); //Change to middle pixel of your screen if resolution is different.
if((int)GetRValue(startPixel) - (int)GetRValue(nowPixel) > 5 || (int)GetRValue(startPixel) - (int)GetRValue(nowPixel) < -5){
shoot();
started = true;
}
}
}
ReleaseDC(0, hdcScreen);
return 0;
}
You get your AWP, you zoom in, you hold H and don't move your mouse. If the pixel in the middle changes, then it will fire.(You can't move your mouse.) You might need to change the pixel co-ordinate if your resolution is different. Pretty simple and good for sniping double doors on de_dust2 in any of the counter-strikes. Or camping any corners for that matter.
Basic explanation on works:
0.Set your CS:GO to fullscreen windowed mode.
1.Gets pixel in middle of screen when you hold H.
2.If that pixel changes it fires.
(I could implement so that it finds the middle itself, but everyone has a different crosshair)