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()
{
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()

View file

@ -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()