The script contains syntax errors.
Specifically: WinGetTitle("ahk_pid " CSGOPid) = A_Args[2])
My code:
Code: Select all
Run "`"" A_Args[1] "\Steam.exe`" -login " A_Args[2] " " A_Args[3] " -applaunch 730 -novid -low -nohltv -nosound -novid -window -w 640 -h 480 +exec " A_Args[4] " -x " A_Args[5] " -y " A_Args[6],,, SteamPID
GetCSGOPid(SteamPID)
Loop {
WinSetTitle A_Args[2], "ahk_pid " CSGOPid
If(WinGetTitle("ahk_pid " CSGOPid) = A_Args[2])
Exit
Sleep 1000
}
GetCSGOPid(ValuePID){
Global CSGOPid
Processes := ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process")
ParentPID := "," ValuePID ","
for Process in Processes
If InStr(ParentPID, "," Process.ParentProcessId "," ){
If (process.name = "csgo.exe")
CSGOPid := process.ProcessID
}
}