Refactor scripts for AutoHotKey v2

This commit is contained in:
Manuel Thalmann 2023-07-17 23:58:31 +02:00
parent 82c05c2121
commit d8a9a3dbaf
2 changed files with 23 additions and 23 deletions

View file

@ -1,19 +1,19 @@
InstallGameHub() InstallGameHub()
{ {
SetTitleMatchMode, RegEx SetTitleMatchMode("RegEx")
windowTitle := "^Tobii Game Hub$" windowTitle := "^Tobii Game Hub$"
Run, "setup.exe" Run("setup.exe")
WinWait % windowTitle,, 60 WinWait(windowTitle, unset, 60)
WinActivate % windowTitle WinActivate(windowTitle)
MouseClick, Left, 485, 365 MouseClick("Left", 485, 365)
MouseClick, Left, 600, 455 MouseClick("Left", 600, 455)
MouseClick, Left, 533, 623 MouseClick("Left", 533, 623)
MouseClick, Left, 936, 662 MouseClick("Left", 936, 662)
Sleep, 10 * 1000 Sleep(10 * 1000)
WinActivate % windowTitle WinActivate(windowTitle)
WinGet, pid, PID pid := WinGetPID()
Run, pwsh -c "Stop-Process -Force %pid%" Run("pwsh -c Stop-Process -Force ".pid)
} }
InstallGameHub() InstallGameHub()

View file

@ -1,18 +1,18 @@
InstallGhost() InstallGhost()
{ {
SetTitleMatchMode, RegEx SetTitleMatchMode("RegEx")
windowTitle := "^Tobii Ghost$" windowTitle := "^Tobii Ghost$"
Run, "setup.exe" Run("setup.exe")
WinWait % windowTitle,, 60 WinWait(windowTitle, unset, 60)
WinActivate % windowTitle WinActivate(windowTitle)
MouseClick, Left, 44, 694 MouseClick("Left", 44, 694)
MouseClick, Left, 330, 752 MouseClick("Left", 330, 752)
WinWaitNotActive WinWaitNotActive()
WinWait % windowTitle,, 20 WinWait(windowTitle, unset, 20)
MouseClick, Left, 563, 397 MouseClick("Left", 563, 397)
MouseClick, Left, 650, 497 MouseClick("Left", 650, 497)
Sleep, 10 * 1000 Sleep(10 * 1000)
} }
InstallGhost() InstallGhost()