in this autohotkey script, settimer does not run #NoEnv ; Recommended for performance…
- User
in this autohotkey script, settimer does not run
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. ;SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Mouse, Screen #SingleInstance, Force #Persistent
Run, "C:\Users\user\Desktop\Launchers\BakkesMod.lnk"
WinWait, BakkesModInjectorCpp
Sleep, 5000
if WinExist("Rocket League (32-bit, DX9) ahk_class LaunchUnrealUWindowsClient") WinActivate, Rocket League (32-bit, DX9) ahk_class LaunchUnrealUWindowsClient ;return else Run, steam://rungameid/252950
WinWait, Rocket League (32-bit, DX9) ahk_class LaunchUnrealUWindowsClient
SetTimer, helloRocketLeague, % (helloRocketLeague := !helloRocketLeague) ? 10000 : "Off"
return
helloRocketLeague: Process, Exist, RocketLeague.exe if !ErrorLevel { WinKill, BakkesModInjectorCpp Sleep, 10000 Process, Close, BakkesMod.exe ExitApp } return
Assistant
The
SetTimercommand in your script is not working as expected because the specified function namehelloRocketLeaguedoes not match the function label in your script. For theSetTimercommand to work correctly, you need to use the correct function label as the first argument.Here's the corrected version of your script with the function label fixed:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. ;SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. CoordMode, Mouse, Screen #SingleInstance, Force #Persistent Run, "C:\Users\user\Desktop\Launchers\BakkesMod.lnk" WinWait, BakkesModInjectorCpp Sleep, 5000 if WinExist("Rocket League (32-bit, DX9) ahk_class LaunchUnrealUWindowsClient") WinActivate, Rocket League (32-bit, DX9) ahk_class LaunchUnrealUWindowsClient ;return else Run, steam://rungameid/252950 WinWait, Rocket League (32-bit, DX9) ahk_class LaunchUnrealUWindowsClient SetTimer, CheckIfRocketLeagueIsRunning, 10000 return CheckIfRocketLeagueIsRunning: Process, Exist, RocketLeague.exe if !ErrorLevel { WinKill, BakkesModInjectorCpp Sleep, 10000 Process, Close, BakkesMod.exe ExitApp } returnIn this updated script, I've renamed the
helloRocketLeaguefunction toCheckIfRocketLeagueIsRunningand used this name in theSetTimercommand. Now the timer should work correctly, calling theCheckIfRocketLeagueIsRunningfunction every 10 seconds.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.