Working triggerbot for CS:GO

Post gaming related scripts
PointBlankStudios
Posts: 11
Joined: 19 Dec 2015, 18:20

Working triggerbot for CS:GO

19 Dec 2015, 18:45

New triggerbot i have made, using pixel detection to click when pixel changes in middle of crosshair

1) View my youtube video on how to use this script.
2) Save code in an AHK file
3) Run CSGO in windowed mode with -noborder in autoexec or console
4) Open script with AHK
5) Watch youtube video for more info.
6) Video link inside code |

Code: Select all

Threshold = 20
;https://www.youtube.com/watch?v=rJZZi0dPphE&list=PLcmyfEZP-r3hU3UDPf__DZFvPkbxlAerY&index=3
*~$t::
MouseGetPos, MouseX, MouseY
PixelGetColor, Color1, (MouseX+2), (MouseY+2)
StringSplit, Colorz, Color1
Color1B = 0x%Colorz3%%Colorz4%
Color1G = 0x%Colorz5%%Colorz6%
Color1R = 0x%Colorz7%%Colorz8%
Color1B += 0
Color1G += 0
Color1R += 0

while (GetKeyState("t", "P"))
    {
        BlockInput, MouseMove
        sleep 1
        MouseGetPos, MouseX, MouseY
        PixelGetColor, Color2, (MouseX+2), (MouseY+2)
        StringSplit, Colorz, Color2
        Color2B = 0x%Colorz3%%Colorz4%
        Color2G = 0x%Colorz5%%Colorz6%
        Color2R = 0x%Colorz7%%Colorz8%
        Color2B += 0
        Color2G += 0
        Color2R += 0
        if (Color1R > (Color2R + Threshold)) or (Color1R < (Color2R - Threshold)) or (Color1G > (Color2G + Threshold)) or (Color1G < (Color2G - Threshold)) or (Color1B > (Color2B + Threshold)) or (Color1B < (Color2B - Threshold))
            {
                send {LButton}
            }
    }
BlockInput, MouseMoveOff
Return

End::
exitapp
return
Last edited by PointBlankStudios on 03 May 2016, 01:44, edited 2 times in total.
negusp

Re: Working triggerbot for CS:GO

25 Dec 2015, 12:02

Needs a toggle instead of holding t. Additionally, could you code this for 1920x1080, 1680x1050, and 1366x768, among other resolutions?
negusp

Re: Working triggerbot for CS:GO

25 Dec 2015, 12:03

Oh, BTW, if you get a final script completed could I post it on my compilation post here: https://autohotkey.com/boards/viewtopic ... 19&t=12247 ?
That would be great.
PointBlankStudios
Posts: 11
Joined: 19 Dec 2015, 18:20

Re: Working triggerbot for CS:GO

11 Apr 2016, 19:01

1) I am not sure why this script needs a toggle, can you please provide more information?
2) This script SHOULD work for all resolutions, i'm not sure why i added that bit about the 1280 X 720p. It goes by the pixels in relation to the mouse, so as long as you have -noborder on, it should work with all resolutions.
3) This is the final script for now (<-- i know that doesn't make much sense), so you can add it to your compilation as long as you credit me and my YouTube video.
Ruevil2
Posts: 173
Joined: 14 Jul 2014, 10:39

Re: Working triggerbot for CS:GO

12 Apr 2016, 15:36

I think there is a variable typo:

Code: Select all

Color1R = 0x%Color7z%%Colorz8%
Should be:

Code: Select all

Color1R = 0x%Colorz7%%Colorz8%

Same for the lower Color2R line.
PointBlankStudios
Posts: 11
Joined: 19 Dec 2015, 18:20

Re: Working triggerbot for CS:GO

12 Apr 2016, 18:23

Well, I am actually not sure about that one... I made this script almost a year ago and have been using it since, so I can't remember exactly how I made the variables (I know, I have a terrible memory). I will have a go at fixing the typo and using it in my own games, just to see if it works any better, but for now the code will stay as it is on these forums.

EDIT: I have had a better look at the code, and I'm pretty sure that this was NOT a typo, and I originally made it like this on purpose.
Ruevil2
Posts: 173
Joined: 14 Jul 2014, 10:39

Re: Working triggerbot for CS:GO

12 Apr 2016, 19:32

Well unless you intended that variable to be blank forever, then it is definitely a typo.

Msgbox shows empty var every time.

Code: Select all

MsgBox % Color7z
PointBlankStudios
Posts: 11
Joined: 19 Dec 2015, 18:20

Re: Working triggerbot for CS:GO

18 Apr 2016, 02:36

Yeah, OK, I will fix this typo.

I DID make this code a long time ago and I have a terrible memory so you're probably right. Also, thanks for helping :)
User avatar
SnowFlake
Posts: 368
Joined: 28 Apr 2015, 05:41
Contact:

Re: Working triggerbot for CS:GO

19 Apr 2016, 05:55

" I will fix this typo."

have you fixed the problems yet?
:yawn:
PointBlankStudios
Posts: 11
Joined: 19 Dec 2015, 18:20

Re: Working triggerbot for CS:GO

21 Apr 2016, 03:23

Yep, All fixed. :)
User avatar
WAZAAAAA
Posts: 88
Joined: 13 Jan 2015, 19:48

Re: Working triggerbot for CS:GO

06 May 2016, 12:38

EDIT: years have passed and I keep receiving private messages for this post. Please keep in mind I don't actually own the game, I just built this triggerbot for a friend and shared it here, so I can't really test it for troubleshooting. Also, why PM me instead of posting your queries here in public? Post them here so more people can potentially help you.



Here's my own version of a generic triggerbot optimized for speed. It doesn't wait for a color to become red or some specific color; instead it waits for the monitored color to change entirely. It doesn't monitor the pixel located at the exact center of the screen; instead it's slightly more down&right (to make it compatible with a wider variety of crosshair settings like the ones that have a small dot in the middle).
Works in Counter-Strike: Global Offensive.

Instructions:
hold C = play script
Ins = toggle script ON/OFF
use a sniper rifle possibly I guess
Depending on your crosshair, game and window size, you may need to modify the script accordingly. This specific code was tested working on CS:GO|1920x1080|Fullscreen Windowed|Classic crosshair. You can save a screenshot and open it with Paint to find the correct coordinates for yourself.
Disabling "desktop composition" (which will turn V-Sync OFF) makes the script function better. It is known to cause issues to PixelSearch and PixelGetColor. Windows 7 and older versions can disable it easily by using a classic/basic theme (right click your Desktop > Personalize), but I'm afraid Windows 8 and 10 users can't.

Script:

Code: Select all

#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
ListLines Off
Process,Priority,,A
SetBatchLines,-1
SetKeyDelay,-1,-1
SetMouseDelay,-1
SetDefaultMouseSpeed,0
SetWinDelay,-1
SetControlDelay,-1
SendMode Input

*~$c::
while,GetKeyState("c","p")
{
	DllCall("Sleep",UInt,1) ;if the script uses too much CPU increase the Sleep time here
	PixelGetColor,colorz,962,542,Slow ;fix coordinates if needed
	PixelSearch,,,962,542,962,542,%colorz%,2,Fast ;same coordinates as above
	if ErrorLevel = 1
	{
		Click Left Down
		DllCall("Sleep",UInt,20)
		Click Left Up
		DllCall("Sleep",UInt,20)
	}
}
return

$*ins::
Suspend
Pause,,1
return
Additional info:
This is pretty much how you can manually adapt this script for other games other than CS:GO. Not guaranteed to work universally since it all depends on how the game functions:
1. run the game in either "Windowed" or "Borderless Fullscreen" mode. Disable desktop composition.
2. change the coordinates (962 and 542). Help yourself with Paint (it tells you the coordinates when you move the mouse around): take a screenshot while ingame with the weapon you want, decide which pixel you want the bot to monitor (I picked a pixel slightly outside of the crosshair for CS:GO because the central one was "busy")
3. You may need to adjust the color lenience, so that the bot doesn't fire at any slight change of pixel color change. That's done by increasing the the number (2) before "Fast".
Last edited by WAZAAAAA on 09 Oct 2017, 06:16, edited 7 times in total.
YOU'RE NOT ALEXANDER
PointBlankStudios
Posts: 11
Joined: 19 Dec 2015, 18:20

Re: Working triggerbot for CS:GO

16 May 2016, 19:45

WAZAAAAA wrote:Here's my own version of a generic triggerbot optimized for speed. It doesn't wait for a color to become red or some specific color; instead it waits for the monitored color to change entirely. It doesn't monitor the pixel located at the exact center of the screen; instead it's slightly more down&right (to make it compatible with a wider variety of crosshair settings like the ones that have a small dot in the middle).
Works in Counter-Strike: Global Offensive.

Instructions:
hold C = play script
Ins = toggle script ON/OFF
Depending on your crosshair, game and window size, you may need to modify the script accordingly. This specific code was tested working on CS:GO|1920x1080|Fullscreen Windowed|Classic crosshair. You can save a screenshot and open it with Paint to find the correct coordinates for yourself.
Disabling Windows Aero makes the script function better. Aero is known to cause issues to PixelSearch and PixelGetColor.

Script:

Code: Select all

#NoEnv
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
ListLines Off
Process,Priority,,H
SetBatchLines,-1
SetKeyDelay,-1,-1
SetMouseDelay,-1
SetDefaultMouseSpeed,0
SetWinDelay,-1
SetControlDelay,-1
SendMode Input

*~$c::
while,GetKeyState("c","p")
{
	DllCall("kernel32.dll\Sleep",UInt,1) ;if the script uses too much CPU increase the Sleep time here
	PixelGetColor,colorz,962,542,Slow ;fix coordinates if needed
	PixelSearch,,,962,542,962,542,%colorz%,2,Fast ;same coordinates as above
	if ErrorLevel = 1
	{
		Click Left Down
		DllCall("Sleep",UInt,20)
		Click Left Up
		DllCall("Sleep",UInt,20)
	}
}
return

$*ins::
Suspend
Pause,,1
return
Ok... First off, I don't particularly like you coming on my topic and posting your own script, if you want to show off your script, please just start your own topic.
Secondly, My script already does EVERYTHING that you advertised in your script. It Is optimised to shoot when the selected pixel CHANGES, not becomes a specific colour. It targets a pixel roughly four pixels above, and to the right, of the mouse's current position ( the middle of the screen in CS:GO ) So it doesn't interfere with and crosshairs, unless you have a REALLY thick crosshair.
So, just to cap off, what you did was sort of a dick move, and my script already did the same things that your script does. :evil:
User avatar
WAZAAAAA
Posts: 88
Joined: 13 Jan 2015, 19:48

Re: Working triggerbot for CS:GO

19 May 2016, 04:41

EDIT: I was too kind and reasonable when I first posted this reply, correcting the mistake:

Ligma balls.
Last edited by WAZAAAAA on 29 May 2023, 11:51, edited 1 time in total.
YOU'RE NOT ALEXANDER
PointBlankStudios
Posts: 11
Joined: 19 Dec 2015, 18:20

Re: Working triggerbot for CS:GO

19 May 2016, 19:33

WAZAAAAA wrote:I posted it here because the two scripts do pretty much the same thing, and having an alternative is always good right?

When I said optimized I meant that my script can check a pixel like 200 times per second (with line 18 removed it becomes 25000 times) compared to yours that reaches 60, which may negatively affect a game.
I benchmarked them.

...a dick move? This is a fucking forum about AutoHotkey, only code, learning and contributions matter. I have no idea how on earth did that offend you, get some testicular fortitude.
Ok, sorry dude, I take back what I said, I just raged a bit because the way you worded your post sort of sounded like you were saying that my script sucked and yours was better, but now I get what you were trying to do, so I'm sorry 'bout what I said.
PointBlankStudios
Posts: 11
Joined: 19 Dec 2015, 18:20

Re: Working triggerbot for CS:GO

31 Jul 2016, 23:23

Just a little update guys, i think there may be some problems with the script that have proven a bit too troublesome to fix, so for now if you just use WAZAAAAA's script instead of mine it should work fine for you.
jezshaa

Re: Working triggerbot for CS:GO

01 Aug 2016, 17:13

can anyone send me a sick ahk script with norecoil and triggerbot? i can pay add me on steam if u wanna talk http://steamcommunity.com/id/kiNgz14/
Daksh133

Re: Working triggerbot for CS:GO

10 Aug 2016, 02:54

jezshaa wrote:can anyone send me a sick ahk script with norecoil and triggerbot? i can pay add me on steam if u wanna talk http://steamcommunity.com/id/kiNgz14/
I sent you a friend request, accept.
Guest

Re: Working triggerbot for CS:GO

12 Aug 2016, 12:20

This worked when I first used it, but has since stopped. Since then, I have only changed to 1024X768 with black bars. I was never in windowed mode, and it worked fine before. I have aero disabled, and always have. What variables do I need to change to get this working again at this resolution? Also, since it worked fine with AWP, I'm guessing that it's not the center pixel that's used, but one near it?
jezsha
Posts: 2
Joined: 31 Jul 2016, 16:09

Re: Working triggerbot for CS:GO

25 Aug 2016, 21:23

can anyone send me a sick ahk script with norecoil and triggerbot? i can pay add me on steam if u wanna talk http://steamcommunity.com/id/kiNgz14/
nistancg
Posts: 2
Joined: 29 Dec 2016, 08:13

Re: Working triggerbot for CS:GO

29 Dec 2016, 08:36

Hello,
I'm pretty new,
But I thought to my self that I wanna challenge my self and make my own version of triggerbot, but I need your help, and please do not copy my idea :terms: :beer:
I wanna make a script that will look for any change in the pixels and will then track it and will move the mouse to the top pixel of it and shot until it disappears, pretty much an aimbot/triggerbot/trackerbot.
But I need to know how to code that, so I want anybody, that knows how to code to explain to me how to make it move to the pixel and to explain how does the pixel tracker thing

OR - make your own and send it to me and explain in the code comments+ Put your credit comment above the code :D , Please don't forget to send it to me.

+ I will share it and you'll get all of the credits! :bravo:
Thank you very much, Nitsan

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 35 guests