Results 1 to 8 of 8
  1. #1
    Ecoste's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    1

    Sniper's TriggetBot (C++)

    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)
    Last edited by Ecoste; 03-15-2013 at 08:24 AM.

  2. The Following User Says Thank You to Ecoste For This Useful Post:

    LightUmbreon (04-05-2013)

  3. #2
    Kallisti's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    深い碧の果てに
    Posts
    4,019
    Reputation
    52
    Thanks
    376
    My Mood
    In Love
    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?

    未来が見えなくて怖いから
    未来が見えてしまって悲しいから
    目を閉じて優しい思い出に浸ってしまう




  4. #3
    Ecoste's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by Altarium View Post
    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.

  5. #4
    rocketpropelled's Avatar
    Join Date
    Mar 2013
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    0
    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.

  6. #5
    Xiolest's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Location
    Searching...
    Posts
    4,125
    Reputation
    330
    Thanks
    652
    My Mood
    Twisted
    What's the point of this?

  7. #6
    258456's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    ghjghj
    Posts
    1,222
    Reputation
    18
    Thanks
    300
    My Mood
    Relaxed
    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.

  8. #7
    grannycrazy's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    Beetlejuice
    Posts
    286
    Reputation
    10
    Thanks
    55
    My Mood
    Angelic
    Nice!
    More useful to some people then to other.
    But thanks for contributing to this SIte



  9. #8
    LightUmbreon's Avatar
    Join Date
    Mar 2013
    Gender
    male
    Location
    sudo
    Posts
    36
    Reputation
    10
    Thanks
    10
    My Mood
    Busy
    Nice idea! I might make my own version of it and port it later on this thread.

Similar Threads

  1. Jack's Anti-Sniper Kit v.3.1415926
    By Jackal in forum WarRock - International Hacks
    Replies: 26
    Last Post: 07-16-2007, 04:09 AM
  2. [RELEASE] Xauen Sniper Spawn
    By retrac in forum WarRock - International Hacks
    Replies: 4
    Last Post: 02-19-2007, 04:05 PM
  3. Anti-Sniper Kit v1.0 [Release]
    By Kyojiro in forum WarRock - International Hacks
    Replies: 8
    Last Post: 04-29-2006, 08:33 PM
  4. AUG switch for sniper
    By AdamWest in forum WarRock - International Hacks
    Replies: 9
    Last Post: 02-10-2006, 05:43 AM
  5. GFX Sniper
    By Chronologix in forum Art & Graphic Design
    Replies: 6
    Last Post: 01-24-2006, 05:59 PM