Skip to content

Instantly share code, notes, and snippets.

@altbdoor
Created January 14, 2018 02:54
Show Gist options
  • Save altbdoor/d044f8a2d860436361095db647a1a379 to your computer and use it in GitHub Desktop.
Save altbdoor/d044f8a2d860436361095db647a1a379 to your computer and use it in GitHub Desktop.
Runs a windowed Audiosurf with the proper resolution based on config.ini
#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