Script not working.

Ask gaming related questions (AHK v1.1 and older)
axo
Posts: 32
Joined: 10 May 2022, 10:50

Script not working.

Post by axo » 07 Jul 2022, 08:41

I have this aimbot scipt for csgo. On my pc it works perfectly but when i sent it to my friend its not working. Why ?


Code: Select all

gui,add,text, c0583FD x25 y1, Select CS:GO recolution Width:
Gui, Add, DropDownList,x25 y15 w150 vVar1 , 1920||1440|1280|1080|1152|1024|800
gui,add,text, c0583FD x25 y50, Select CS:GO recolution Height:
Gui, Add, DropDownList,x25 y65 w150 vVar2 , 1080||1024|960|864|768|600
gui,add,text, c0583FD x25 y100, Select hotkey for AimBot:
Gui, Add, dropdownlist,x25 y115 w150 h1000 vSelectedKeyAM, CapsLock|Tab|LAlt|MButton|XButton1|XButton2|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|r|s|t|u|v|w|x|y|z
gui,add,text, c0583FD x25 y140, Select CS:GO sens:
Gui, add, Slider, y155 x1			w200	vSlider	gSlide 	Range1-100 tickinterval1-100 AltSubmit
gui,add,text, c0583FD x25 y210, Select AimBot fov (1-4):
Gui, add, Slider, y225 x1			w200	vfov	 	Range1-4 tickinterval1-4 AltSubmit
Gui, add, Edit, c0583FD	x25 y185		w70		vValue							, 0.1
gui,add,button, x25 y260 gselect, select
gui,color,1B1B1B
gui, show, 
return



Slide:
	Gui,Submit,NoHide
       ; here's the magic
	int := slider/10
	fra := Mod(int, 10)
	fra := SubStr(fra, InStr(fra,".")+1, 1 )
	val :=  Floor(int) "." fra
	
	GuiControl,, Edit1, %val%
return



select:
Gui, Submit 
{

#NoEnv
#SingleInstance, Force
#InstallKeybdHook
#UseHook
#KeyHistory, 0
#HotKeyInterval 1
#MaxHotkeysPerInterval 127
SetKeyDelay,-1, -1
SetControlDelay, -1
SetMouseDelay, -1
SetWinDelay,-1
SendMode, InputThenPlay
SetBatchLines,-1
ListLines, Off
CoordMode, Pixel, screen
 
 
DllCall("QueryPerformanceFrequency", "Int64*", freq)
FlickBefore := 0
 
 

 

game_fov  := 68 ;Game fov
game_fps  := 240 ;Display refresh rate
 
 
;use this tool and set sensitivity and dpi to 1, then copy In/360 value https://gamingsmart.com/mouse-sensitivity-converter
;Apex Legends: 16363.64
;CSGO: 16363.64
;Halo Infinite: 17454.6
full360 := 16363.64/val ;Modify it to the value of the corresponding game
 
EMCol := 0x ;Enemy color
ColVn := 10 ;Variation
OffsetX := 0
OffsetY := 1
ZeroX := Floor(Var1  // 2) - OffsetX
ZeroY := Floor(Var2 // 2) - OffsetY
CFovX := deg2coord(fov, game_fov, Var1, Var2) ;aimbot fov x. range: 0 ~ game_fov/2
CFovY := deg2coord(fov, game_fov, Var1, Var2) ;aimbot fov y. range: 0 ~ game_fov/2
SpeedX := 0.13 ;aimbot speed. range: 0 ~ 1
SpeedY := 0.13 ;aimbot speed. range: 0 ~ 1
ScanL := ZeroX - CFovX
ScanT := ZeroY - CFovY
ScanR := ZeroX + CFovX
ScanB := ZeroY + CFovY
 
 
Loop {
    KeyWait, %SelectedKeyAM%, D
    AimPixel := _PixelSearch(ScanL, ScanT, ScanR, ScanB, EMCol, ColVn)
    if (!ErrorLevel) {
        AimX := AimPixel[1] - ZeroX
        ,AimY := AimPixel[2] - ZeroY
        ,MoveX := Floor(coord2deg(AimX, game_fov, Var1, Var2) * (full360/360) * SpeedX)
        ,MoveY := Floor(coord2deg(AimY, game_fov, Var1, Var2) * (full360/360) * SpeedY)
        DllCall("QueryPerformanceCounter", "Int64*", FlickAfter)
        if ((FlickAfter-FlickBefore)/freq*1000 >= 1000/game_fps) {
            DllCall("QueryPerformanceCounter", "Int64*", FlickBefore)
            DllCall("mouse_event", "uint", 0x0001, "uint", MoveX, "uint", MoveY, "uint", 0, "int", 0)
        }
    }
}
 
;full360 test
/*
F::
DllCall("mouse_event", "uint", 0x0001, "uint", 6666, "uint", 0, "uint", 0, "int", 0)
return
*/
 
_PixelSearch(X1, Y1, X2, Y2, ColorID, Variation:=0) {
    PixelSearch, OutputVarX, OutputVarY, X1, Y1, X2, Y2, ColorID, Variation, Fast RGB
    Return [OutputVarX, OutputVarY]
}
 
deg2rad(degrees) {
    return degrees * ((4*ATan(1)) / 180)
}
 
rad2deg(radians) {
    return radians * (180 / (4*ATan(1)))
}
 
coord2deg(delta, fov, winwidth, winheight) {
    ;lookAt := delta * 2 / winwidth
    ;return rad2deg(atan(lookAt*tan(deg2rad(fov*0.5)))) ;degrees
    return rad2deg(atan(((delta<<1)/winwidth)*tan(deg2rad(fov*0.5))))
}
 
deg2coord(delta, fov, winwidth, winheight) {
    return winwidth*0.5/tan(deg2rad(fov*0.5))*tan(deg2rad(delta))
}
}


guiclose:
Exitapp
return

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: Script not working.

Post by mikeyww » 09 Jul 2022, 05:50

Hello,

A problem statement of "not working" is a non-statement about anything in particular. I suppose that your issue could relate to differences in displays. It sounds like you want to debug your script by finding out what is happening at each step. Some approaches include ListLines and MsgBox. I usually use MsgBox just because it is fast and easy, and I can then also see the values of any variables, conditional statements, & functions that I mention in the MsgBox.

Post Reply

Return to “Gaming Help (v1)”