https://www.youtube.com/watch?v=rjzzi0dpphe&list=plcmyfezp-r3hu3udpf__dzfvpkbxlaery&index=3 – So we have tried everything but can’t get this to work correctly. We want my Lbutton to be held down quickly so it clicks once we have tried putting it to Sleep, but it won’t work.

Code: Select all – Expand View – Download – Toggle Line numbers

New trigger bot we have made using pixel detection to click when a pixel changes in the middle of the crosshair.

1) View the youtube video on how to use this script.

2) Save the code in an AHK file

3) Run CSGO in windowed mode with -no border in autoexec or console

4) Open script with AHK

5) Watch the youtube video for more info.

6) Video link inside code |

Threshold = 20

;https://www.youtube.com/watch?v=rjzzi0dpphe&list=plcmyfezp-r3hu3udpf__dzfvpkbxlaery&index=3

*~$Xbutton1::

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(“Xbutton1”, “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::

Exit app

Return

May we point out that your Sleep is one millisecond? If you want one second of Sleep, try Sleep, 1000

Code: Select all – Expand View – Download – Toggle Line numbers

Threshold = 20

;https://www.youtube.com/watch?v=rjzzi0dpphe&list=plcmyfezp-r3hu3udpf__dzfvpkbxlaery&index=3

*~$Xbutton1::

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(“Xbutton1”, “P”))

{

BlockInput, MouseMove

sleep 1 ; <—————————————————————————————— try 1000 instead?

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::

Exit app

Return

Could you also try this and tell us if that’s what you want?

Code: Select all – Expand View – Download – Toggle Line numbers

; Auto-Execute

#SingleInstance, Force

Count = 0

thershold=1250

~$LButton::

if!(LButtonPressed=1)

{

LButtonPressed=1

Count = 0

SetTimer, CountTime, 1

}

Return

~$LButton Up::

LButtonPressed=0

SetTimer, CountTime, Off

Return

CountTime:

Count+=100

if (Count>=thershold)

{

;send {LButton}

tooltip, I clicked! 🙂

SetTimer, CountTime, Off

}

else

tooltip %Count%

Return

It needs a toggle instead of holding a t. Additionally, could you code this for 1920×1080, 1680×1050, and 1366×768, among other resolutions?

1) We are not sure why this script needs a toggle. Can you please deliver more information?

2) This writing SHOULD work for all resolutions. We are unsure why we added that bit about the 1280 X 720p. However, it goes by the pixels concerning the mouse, so as long as you have -no border, it should work for all purposes.

3) It is the final script for now (<– we know that doesn’t make much sense), so you might add it to your compilation as long as you credit us and our YouTube video.

We think there is a variable typo:

Code: Select all – Download – Toggle Line numbers

Color1R = 0x%Color7z%%Colorz8%

Should be:

Code: Select all – Download – Toggle Line numbers

Color1R = 0x%Colorz7%%Colorz8%

Same for the lower Color2R line.

Well, we are not sure about that one. We made this script almost a year ago and have been using it since, so we can’t remember exactly how we made the variables (we know, we have a terrible memory). We will fix the typo and use it in my games to see if it works any improved, but for now, the code will stay as it is on these forums.

EDIT: We have had a better look at the code, and We are pretty sure this was NOT a typo, and we originally made it like this on purpose.

Unless you intended that variable to be blank forever, it would be a typo.

Msgbox shows empty var every time.

Code: Select all – Download – Toggle Line numbers

MsgBox % Color7z

EDIT: years have passed, and we keep receiving private messages for this post. Please keep in mind we don’t own the game. We just built this trigger bot for a friend and shared it here, so we can’t test it for troubleshooting. Also, why PM me instead of posting your queries here in public? Please post them here so more people can potentially help us.

Here’s our version of a generic trigger bot optimized for speed. It doesn’t wait for a color to develop red or some specific color; instead, it remains for the monitored color to change entirely. Also, it doesn’t watch the pixel located at the exact center of the screen; in its place, it’s slightly more down&right (to make it compatible with a wider variety of crosshair settings like those with a small dot in the middle).

Works in Counter-Strike: Global Aggressive.

Instructions  –

hold C = play script

Ins = toggle script ON/OFF

use a sniper rifle, possibly, we guess

You may need to adjust the script accordingly to be flexible on your crosshair, game, and window size. This specific code test on CS: GO|1920×1080|Fullscreen Windowed|Classic crosshair. Finally, save a screenshot and open it with Paint to find your correct coordinates.

Disabling “desktop composition” (which will turn V-Sync OFF) improves the script’s function. However, it is known to cause issues with PixelSearch and PixelGetColor. Windows 7 and older versions might disable it quickly 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 – Expand View – Download – Toggle Line numbers

#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, colors,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  –

It is how you can manually adapt this script for games other than CS: GO. Not guaranteed to work generally since it all depends on how the game purposes:

  1. Run the game in “Windowed” or “Borderless Fullscreen” mode—Disable desktop composition.
  2. Change the organizes (962 and 542). Help yourself with Paint (it tells you the directs when you move the mouse around): take a screenshot while in-game with the weapon you want, and decide which pixel you want the bot to monitor (we picked a pixel somewhat outside of the crosshair for CS: GO because the central one was “busy”)
  3. You may want to adjust the color compassion so that the bot doesn’t fire at any slight change of pixel color change. That’s done by increasing the number (2) before “Fast.”