-
Notifications
You must be signed in to change notification settings - Fork 1
⚡ Optimize Spider-Man start script by replacing fixed sleeps with WinWaitActive #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,8 +17,7 @@ SetTitleMatchMode("Fast") | |
|
|
||
| ; Spider-Man requires Enter key to dismiss splash screen | ||
| WinWait("ahk_exe Spider-Man.exe") | ||
| Sleep(500) | ||
| WinWaitActive("ahk_exe Spider-Man.exe") | ||
|
Comment on lines
19
to
+20
|
||
| ControlSend("{Enter}", , "ahk_exe Spider-Man.exe") | ||
| Sleep(3500) | ||
| WinActivate("ahk_exe Spider-Man.exe") | ||
| ExitApp() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WinWaitActive("ahk_exe Spider-Man.exe")is called without a timeout and without handlingTimeoutError, so the script can block indefinitely if the game never reaches an active window (crash, launcher focus, admin/UAC, etc.). Add a bounded timeout and fail fast with an actionableMsgBox+ExitApp(1)when it times out.