Im making an AHK script to run with a popular script used by CSGO players, the script is returning an error "This variable has not been assigned a value Specificaly: CheckVar (a global variable)" and points to line 77
Code: Select all
#Warn
;Qiwi's Mod for Peans AHK script
Func1()
;Key binds
key_AK:="F4"
key_M4A1:="F6"
key_M4A4:="F7"
key_Famas:="F8"
key_Galil:="F9"
key_UMP:="F12"
key_AUG:="Home"
key_SG:="End"
key_RCoff:="F11"
key_Terminate:="F10"
key_shoot:="LButtCheckVar"
key_zoom:="LAlt"
CheckVar := 0
loop {
sleep 1
;Menu handling
if GetKeyState(key_AK)
{
CheckVar := true
}
if GetKeyState(key_M4A1)
{
CheckVar := true
}
if GetKeyState(key_M4A4)
{
CheckVar := true
}
if GetKeyState(key_Famas)
{
CheckVar := true
}
if GetKeyState(key_Galil)
{
CheckVar := true
}
if GetKeyState(key_RCoff)
{
CheckVar := true
}
if GetKeyState(key_UMP)
{
CheckVar := true
}
if GetKeyState(key_SG)
{
CheckVar := true
}
if GetKeyState(key_AUG)
{
CheckVar := true
}
if GetKeyState(key_RCoff)
{
CheckVar := false
}
Func1()
{
global CheckVar
if CheckVar
{
GetKeyState, IsClicked, LButton
if IsClicked = D
{
MouseGetPos, MouseX, MouseY
loop
{
if IsClicked = U
{
MouseMove, %MouseX%, %MouseY%
break
}
else
{
Func1()
}
}
}
}
}
}