Skip to content

Comments

Bug Fixes#27

Open
Adealia wants to merge 7 commits intoSpaceGT:masterfrom
Adealia:stability-hardening
Open

Bug Fixes#27
Adealia wants to merge 7 commits intoSpaceGT:masterfrom
Adealia:stability-hardening

Conversation

@Adealia
Copy link

@Adealia Adealia commented Jan 28, 2026

Summary

Fixes several correctness and safety issues in Anti-AFK.ahk without changing the overall "foreground + Send()" approach.

Changes

  • Fix WinTitle matching for ahk_exe / ahk_id selectors (missing spaces prevented window detection).
  • Fix timer logic bug where = was used instead of := (comparison vs assignment).
  • Add timeouts to window activation waits to prevent hangs.
  • Ensure cleanup is always performed via try/finally (restores transparency state; guarantees BlockInput("Off") if it was turned on).
  • Add #Requires AutoHotkey v2.0 and fix a misleading getLoops() comment.

User Impact

  • Script can reliably find and manage windows again.
  • Prevents "script hangs forever" during focus/restore attempts.
  • Reduces risk of leaving a window invisible or input blocked after a failure.

Testing

  • Parse/syntax check on AutoHotkey v2 (AutoHotkey64.exe /ErrorStdOut Anti-AFK.ahk) shows no errors.
  • Add a process to PROCESS_LIST, open/close it, confirm windows are detected.
  • Force an activation failure scenario, confirm the script doesn't hang (activation wait times out).
  • Confirm transparency returns to normal after a reset attempt.
  • If BLOCK_INPUT := True is used, confirm input is always restored after failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant