Created
January 14, 2018 02:54
-
-
Save altbdoor/d044f8a2d860436361095db647a1a379 to your computer and use it in GitHub Desktop.
Runs a windowed Audiosurf with the proper resolution based on config.ini
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#NoEnv | |
#NoTrayIcon | |
#SingleInstance force | |
SetWorkingDir, %A_ScriptDir% | |
If (FileExist("Audiosurf.exe") && FileExist("config.ini")) { | |
ScreenWidth := 800 | |
ScreenHeight := 480 | |
Loop, Read, config.ini | |
{ | |
CurrentSetting := StrSplit(A_LoopReadLine, ":") | |
CurrentSettingName := Trim(CurrentSetting[1]) | |
CurrentSettingValue := Trim(CurrentSetting[2]) | |
If (CurrentSettingName == "resolutionwidth" && RegExMatch(CurrentSettingValue, "^\d+$")) { | |
ScreenWidth := Trim(CurrentSettingValue) | |
} | |
Else If (CurrentSettingName == "resolutionheight" && RegExMatch(CurrentSettingValue, "^\d+$")) { | |
ScreenHeight := Trim(CurrentSettingValue) | |
} | |
} | |
ScreenPosX := (A_ScreenWidth / 2) - (ScreenWidth / 2) | |
ScreenPosY := (A_ScreenHeight / 2) - (ScreenHeight / 2) | |
Run, Audiosurf.exe | |
ProcessIdentifier := "ahk_exe QuestViewer.exe" | |
WinWaitActive, %ProcessIdentifier% | |
WinMove, %ProcessIdentifier%, , %ScreenPosX%, %ScreenPosY%, %ScreenWidth%, %ScreenHeight% | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment