LightUmbreon (04-05-2013)
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.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; }
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)
Last edited by Ecoste; 03-15-2013 at 08:24 AM.
LightUmbreon (04-05-2013)
What's the point of trigger bots? Our hands are not perfectly still so might accidentally move, or for whatever reason will likely make an unintended shot?
未来が見えなくて怖いから
未来が見えてしまって悲しいから
目を閉じて優しい思い出に浸ってしまう
Well, I find it not hard to have my mouse still... And second of all, if you're looking at a wall or a door, they're usually the same color. So if you move your mouse, it won't register on some walls sometimes. But it's seriously not hard to not move your mouse while holding h.
Nice one ! I may suggest though: make all models red/blue , and shoot if center pixel is (more or less) red/blue. Will work the same, but wont be triggered by accidental mouse move or any grenade exploding.
What's the point of this?
It doesn't matter if it is useful or not. It is good for him to practice on things like these. This is how you get farther in programming, you have a problem and you think of how you can solve it to make life easier. Exactly what he did here. Good job, I would just suggest that you indent your code more neatly so that you can easily update and understand your code if you decide to come back to it later on. Also, the java Robot class has a really good method to get pixel colors. It is a lot more efficient than the notorious GetPixel() function you are using, it's horribly slow. Anyways though, good job.
Nice!
More useful to some people then to other.
But thanks for contributing to this SIte
Nice idea! I might make my own version of it and port it later on this thread.