From d8a9a3dbaf9d43ebc262332801413e57e91949a6 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 17 Jul 2023 23:58:31 +0200 Subject: [PATCH] Refactor scripts for AutoHotKey v2 --- .../Windows/Software/TobiiGameHub/GameHub.ahk | 24 +++++++++---------- scripts/Windows/Software/TobiiGhost/Ghost.ahk | 22 ++++++++--------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/scripts/Windows/Software/TobiiGameHub/GameHub.ahk b/scripts/Windows/Software/TobiiGameHub/GameHub.ahk index 5b05c43f..7783b37e 100644 --- a/scripts/Windows/Software/TobiiGameHub/GameHub.ahk +++ b/scripts/Windows/Software/TobiiGameHub/GameHub.ahk @@ -1,19 +1,19 @@ InstallGameHub() { - SetTitleMatchMode, RegEx + SetTitleMatchMode("RegEx") windowTitle := "^Tobii Game Hub$" - Run, "setup.exe" - WinWait % windowTitle,, 60 - WinActivate % windowTitle - MouseClick, Left, 485, 365 - MouseClick, Left, 600, 455 - MouseClick, Left, 533, 623 - MouseClick, Left, 936, 662 - Sleep, 10 * 1000 - WinActivate % windowTitle - WinGet, pid, PID - Run, pwsh -c "Stop-Process -Force %pid%" + Run("setup.exe") + WinWait(windowTitle, unset, 60) + WinActivate(windowTitle) + MouseClick("Left", 485, 365) + MouseClick("Left", 600, 455) + MouseClick("Left", 533, 623) + MouseClick("Left", 936, 662) + Sleep(10 * 1000) + WinActivate(windowTitle) + pid := WinGetPID() + Run("pwsh -c Stop-Process -Force ".pid) } InstallGameHub() diff --git a/scripts/Windows/Software/TobiiGhost/Ghost.ahk b/scripts/Windows/Software/TobiiGhost/Ghost.ahk index c26a99a7..febcc749 100644 --- a/scripts/Windows/Software/TobiiGhost/Ghost.ahk +++ b/scripts/Windows/Software/TobiiGhost/Ghost.ahk @@ -1,18 +1,18 @@ InstallGhost() { - SetTitleMatchMode, RegEx + SetTitleMatchMode("RegEx") windowTitle := "^Tobii Ghost$" - Run, "setup.exe" - WinWait % windowTitle,, 60 - WinActivate % windowTitle - MouseClick, Left, 44, 694 - MouseClick, Left, 330, 752 - WinWaitNotActive - WinWait % windowTitle,, 20 - MouseClick, Left, 563, 397 - MouseClick, Left, 650, 497 - Sleep, 10 * 1000 + Run("setup.exe") + WinWait(windowTitle, unset, 60) + WinActivate(windowTitle) + MouseClick("Left", 44, 694) + MouseClick("Left", 330, 752) + WinWaitNotActive() + WinWait(windowTitle, unset, 20) + MouseClick("Left", 563, 397) + MouseClick("Left", 650, 497) + Sleep(10 * 1000) } InstallGhost()