Code: Select all
#Persistent
#KeyHistory, 0
#NoEnv
#HotKeyInterval 1
#MaxHotkeysPerInterval 127
#InstallKeybdHook
#UseHook
#SingleInstance, Force
SetKeyDelay,-0 8
SetControlDelay, -1
SetMouseDelay, -1
SetWinDelay,-1
SendMode, InputThenPlay
SetBatchLines,-1
ListLines, Off
CoordMode, Pixel, Screen, RGB
CoordMode, Mouse, Screen
PID := DllCall("GetCurrentProcessId")
Process, Priority, %PID%, Normal
ColVn := 0
ZeroX := 960
ZeroY := 540
CFovX := 155 ; square research in width
CFovY := 155 ;square research in height
ScanL := ZeroX - CFovX
ScanT := ZeroY - CFovY
ScanR := ZeroX + CFovX
ScanB := ZeroY + CFovY
;Counter-Terrorists
F4::
Loop {
GetKeyState, Mouse2, LButton, P
PixelSearch, AimPixelX, AimPixelY, ScanL, ScanT, ScanR, ScanB, 0x5B563B, ColVn, Fast RGB ; searching color of ennemy
if errorlevel = 0
{
GoSub GetAimOffset
GoSub GetAimMoves
GoSub MouseMoves
GoSub AntiShake
}
}
GetAimMoves:
RootX := Floor(( AimPixelX - A_ScreenWidth/2 + 95)* 0.015) ; 95 editable = aim lock speed / 0.015 = offset where the mouse will be lock left right
x := RootX * DirX
Return
GetAimOffset:
AimX := AimPixelX - ZeroX
If ( AimX > 0 ) {
DirX := 1
}
If ( AimX < 0 ) {
DirX := -1
}
If ( AimY > 0 ) {
DirY := 0
}
If ( AimY < 0 ) {
DirY := 0
}
AimOffsetX := AimX * DirX
Return
AntiShake:
Abs(AimPixelX - A_ScreenWidth/2 + 11)> 60 ; abcisse on research point with offset
MouseMoves:
If ( Mouse2 == "D" ) {
DllCall("mouse_event", "UInt", 0x01, "Int", x, "Int", 0)
}
return
INS:: Reload