Last active
February 21, 2025 19:10
-
-
Save OneNot/0a47d501924d8d4499b52a411f4c8383 to your computer and use it in GitHub Desktop.
Revisions
-
OneNot revised this gist
Feb 21, 2025 . No changes.There are no files selected for viewing
-
OneNot revised this gist
Feb 21, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ losslessScalingExePath := "C:\Program Files (x86)\Steam\steamapps\common\Lossles ; replace with your game exe path OR set to empty string ("") if you do not want the script to start the game gameExePath := "N:\GameLibraries\Steam\SteamLibrary\steamapps\common\Helldivers 2\bin\helldivers2.exe" ; put the window title of the game you want detected here. Uses regex. If you don't know what that means, just know that "^game name$" will find a window with exactly "game name" as it's window title, where as "game name" will find the first window with "game title" anywhere in it's title. gameWindowTitle := "^HELLDIVERS™ 2$" ; change this to the match the profile you want activated. (1 means first profile after Default and so on...) -
OneNot revised this gist
Feb 21, 2025 . 2 changed files with 68 additions and 52 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,68 @@ #Requires AutoHotkey v2.0 ;========== SETTINGS ==========; ; Replace with your LS exe filepath losslessScalingExePath := "C:\Program Files (x86)\Steam\steamapps\common\Lossless Scaling\LosslessScaling.exe" ; replace with your game exe path OR set to empty string ("") if you do not want the script to start the game gameExePath := "N:\GameLibraries\Steam\SteamLibrary\steamapps\common\Helldivers 2\bin\helldivers2.exe" ; put the window title of the game you want detected here. Uses regex. If you don't know what that means, just know that "^game name$" will find a window with exactly "game name" in it's window title, where as "game name" will find the first window with "game title" anywhere in it's title. gameWindowTitle := "^HELLDIVERS™ 2$" ; change this to the match the profile you want activated. (1 means first profile after Default and so on...) nthProfileToUse := 1 ; true = keep this script running until the game is closed, at which point it will auto-close LS and then itself || false = exit this script after turning on scaling closeLSWithGame := true ;==============================; SetTitleMatchMode "RegEx" ; Check if Lossless Scaling is already running and if not, start it. Get it's PID. if !(losslessScalingPID := ProcessExist("LosslessScaling.exe")) Run(losslessScalingExePath,,,&losslessScalingPID) ; Wait for LS WinWait("ahk_pid " losslessScalingPID) WinRestore("ahk_pid " losslessScalingPID) WinActivate("ahk_pid " losslessScalingPID) WinWaitActive("ahk_pid " losslessScalingPID) ; Set coordinate mode to be relative to the active window CoordMode("Mouse", "Client") ; Click default profile to set focus there Click(50, 100) ; Select profile by simulating Down press nthProfileToUse times Loop nthProfileToUse Send("{Down}") ; Wait for focus change Sleep(200) ; Minimize Lossless Scaling WinMinimize("ahk_pid " losslessScalingPID) ; Start game if gamExePath is given if(gameExePath != "") Run(gameExePath) ; Wait for game WinWait(gameWindowTitle) WinWaitActive(gameWindowTitle) ; Send CTRL+ALT+S to activate scaling Send("^!s") if(closeLSWithGame) { ; Wait for game to close WinWaitClose(gameWindowTitle) ; Close LS if it's still running if ProcessExist(losslessScalingPID) ProcessClose(losslessScalingPID) } 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 charactersOriginal file line number Diff line number Diff line change @@ -1,52 +0,0 @@ -
OneNot revised this gist
Feb 21, 2025 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ #Requires AutoHotkey v2.0 losslessScalingExePath := "C:\Program Files (x86)\Steam\steamapps\common\Lossless Scaling\LosslessScaling.exe" ; Replace with your LS exe filepath gameExePath := "" ; paste game exe filepath here to have this script also start up the game. If this is left empty, it is assumed that you will be launching the game yourself or by other means. closeLSWithGame := false ; change to true to auto close LS after game closes (otherwise, this script exits after turning on scaling) nthProfileToUse := 1 ; change this to the match the profile you want activated. (1 means first profile after Default and so on...) -
OneNot revised this gist
Feb 21, 2025 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ losslessScalingExePath := "C:\Program Files (x86)\Steam\steamapps\common\Lossless Scaling\LosslessScaling.exe" gameExePath := "" ; paste game exe path here to have this script also start up the game closeLSWithGame := false ; change to true to auto close LS after game closes (otherwise, this script exits after turning on scaling) nthProfileToUse := 1 ; change this to the match the profile you want activated. (1 means first profile after Default and so on...) ; Check if Lossless Scaling is already running and if not, start it. Get it's PID. if !(pid := ProcessExist("LosslessScaling.exe")) @@ -21,8 +21,9 @@ CoordMode("Mouse", "Client") ; Click default profile to set focus there Click(50, 100) ; Select profile by simulating Down press nthProfileToUse times Loop nthProfileToUse Send("{Down}") ; Wait for focus change Sleep(200) -
OneNot revised this gist
Feb 21, 2025 . 1 changed file with 13 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ #Requires AutoHotkey v2.0 losslessScalingExePath := "C:\Program Files (x86)\Steam\steamapps\common\Lossless Scaling\LosslessScaling.exe" gameExePath := "" ; paste game exe path here to have this script also start up the game closeLSWithGame := false ; change to true to auto close LS after game closes (otherwise, this script exits after turning on scaling) ; Check if Lossless Scaling is already running and if not, start it. Get it's PID. if !(pid := ProcessExist("LosslessScaling.exe")) @@ -27,7 +30,8 @@ Sleep(200) ; Minimize Lossless Scaling WinMinimize("ahk_pid " pid) if(gameExePath != "") Run(gameExePath) ; Wait for HELLDIVERS™ 2 WinWait("HELLDIVERS™ 2") @@ -36,9 +40,12 @@ WinWaitActive("HELLDIVERS™ 2") ; Send CTRL+ALT+S to activate scaling Send("^!s") if(closeLSWithGame) { ; Wait for HELLDIVERS™ 2 to close WinWaitClose("HELLDIVERS™ 2") ; Close LS if it's still running if ProcessExist(pid) ProcessClose(pid) } -
OneNot revised this gist
Feb 21, 2025 . No changes.There are no files selected for viewing
-
OneNot revised this gist
Feb 21, 2025 . 1 changed file with 39 additions and 15 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,44 @@ #Requires AutoHotkey v2.0 losslessScalingExePath := "C:\Program Files (x86)\Steam\steamapps\common\Lossless Scaling\LosslessScaling.exe" ; Check if Lossless Scaling is already running and if not, start it. Get it's PID. if !(pid := ProcessExist("LosslessScaling.exe")) Run(losslessScalingExePath,,,&pid) ; Wait for LS WinWait("ahk_pid " pid) WinRestore("ahk_pid " pid) WinActivate("ahk_pid " pid) WinWaitActive("ahk_pid " pid) ; Set coordinate mode to be relative to the active window CoordMode("Mouse", "Client") ; Click default profile to set focus there Click(50, 100) ; Select profile (adjust the number in {Down x} to change selection) Send("{Down 1}") ; Wait for focus change Sleep(200) ; Minimize Lossless Scaling WinMinimize("ahk_pid " pid) ;Run("gameExePath") ; launch game ;Uncomment this line and replace gameExePath to use this script as a launcher ; Wait for HELLDIVERS™ 2 WinWait("HELLDIVERS™ 2") WinWaitActive("HELLDIVERS™ 2") ; Send CTRL+ALT+S to activate scaling Send("^!s") ; Wait for HELLDIVERS™ 2 to close WinWaitClose("HELLDIVERS™ 2") ; Close LS if it's still running if ProcessExist(pid) ProcessClose(pid) -
OneNot revised this gist
Feb 20, 2025 . No changes.There are no files selected for viewing
-
OneNot revised this gist
Feb 20, 2025 . No changes.There are no files selected for viewing
-
OneNot created this gist
Feb 20, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ losslessScalingExePath := "C:\Program Files (x86)\Steam\steamapps\common\Lossless Scaling\LosslessScaling.exe" Run, %losslessScalingExePath%,,,pid ;run it Process, Wait, %pid% ;wait for process WinActivate, ahk_pid %pid% ;set active WinWaitActive, ahk_pid %pid% ;wait for active CoordMode, Mouse, Relative ;set coordinates to relative to window Click, 50, 100 ;click default profile to set focus there Send, {Down 1} ;select the nth profile after Default, where n = number after "Down" e.g. {Down 2} to select second profile after Default Sleep, 200 ;wait for focus to move / profile to switch (probably not needed, but just in case) WinMinimize, ahk_pid %pid% ;minimize LS ;Run, "gameExePath" ; launch game ;Uncomment this line and fill in gameExePath to use this script as a launcher WinWaitActive, HELLDIVERS™ 2 ;wait for game window to be active Sleep, 5000 ;wait extra 5s just in case Send, ^!s ; send CTRL+ALT+S to activate scaling ;WinWaitClose, HELLDIVERS™ 2 ;uncomment this and next line to wait for Helldivers 2 to close and then auto-close Lossless Scaling ;Process, Close, %pid%