Insane Performance Inducing autohotkeys!

Post gaming related scripts
alarineth
Posts: 6
Joined: 27 Apr 2018, 23:39

Insane Performance Inducing autohotkeys!

28 Apr 2018, 00:29

Code: Select all

loop
{
MouseGetPos, StartVarX, StartVarY
sleep, 100
MouseGetPos, CheckVarX, CheckVarY
If (StartVarX != CheckVarX) or (StartVarY != CheckVarY)
ChangeResolution(1280, 720)
ChangeResolution(Screen_Width := 1280, Screen_Height := 720, Color_Depth := 8)
{
    VarSetCapacity(Device_Mode,156,0)
    NumPut(156,Device_Mode,36) 
    DllCall( "EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&Device_Mode )
    NumPut(0x5c0000,Device_Mode,40) 
    NumPut(Color_Depth,Device_Mode,104)
    NumPut(Screen_Width,Device_Mode,108)
    NumPut(Screen_Height,Device_Mode,112)
    Return DllCall( "ChangeDisplaySettingsA", UInt,&Device_Mode, UInt,0 )

ChangeResolution(1280, 720)
ChangeResolution(Screen_Width := 1280, Screen_Height := 720, Color_Depth := 32)

    VarSetCapacity(Device_Mode,156,0)
    NumPut(156,Device_Mode,36) 
    DllCall( "EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&Device_Mode )
    NumPut(0x5c0000,Device_Mode,40) 
    NumPut(Color_Depth,Device_Mode,104)
    NumPut(Screen_Width,Device_Mode,108)
    NumPut(Screen_Height,Device_Mode,112)
    Return DllCall( "ChangeDisplaySettingsA", UInt,&Device_Mode, UInt,0 )
}
}
/::ExitApp
Direct X Friendly

Constant Version:

Code: Select all

loop
{
ChangeResolution(1280, 720)
ChangeResolution(Screen_Width := 1280, Screen_Height := 720, Color_Depth := 8)
{
    VarSetCapacity(Device_Mode,156,0)
    NumPut(156,Device_Mode,36) 
    DllCall( "EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&Device_Mode )
    NumPut(0x5c0000,Device_Mode,40) 
    NumPut(Color_Depth,Device_Mode,104)
    NumPut(Screen_Width,Device_Mode,108)
    NumPut(Screen_Height,Device_Mode,112)
    Return DllCall( "ChangeDisplaySettingsA", UInt,&Device_Mode, UInt,0 )

ChangeResolution(1280, 720)
ChangeResolution(Screen_Width := 1280, Screen_Height := 720, Color_Depth := 32)

    VarSetCapacity(Device_Mode,156,0)
    NumPut(156,Device_Mode,36) 
    DllCall( "EnumDisplaySettingsA", UInt,0, UInt,-1, UInt,&Device_Mode )
    NumPut(0x5c0000,Device_Mode,40) 
    NumPut(Color_Depth,Device_Mode,104)
    NumPut(Screen_Width,Device_Mode,108)
    NumPut(Screen_Height,Device_Mode,112)
    Return DllCall( "ChangeDisplaySettingsA", UInt,&Device_Mode, UInt,0 )
}
}
/::ExitApp
Direct X Friendly

Constant fullscreenresize exploit:

Code: Select all

loop
{
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
    WinSet, Style, ^0xC00000 ; hides the title bar
    WinMove, , , 0, 0, 1920, 1080
}
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
   WinSet, Style, -0x400000 ; hides the dialog frame
   WinSet, Style, -0x40000 ; hides the sizebox/thickframe
   WinSet, Style, -0x800000 ; hides the thin-line border
   WinSet, Style, -0xC00000 ; hides the title bar
   WinMove, , , 0, 0, 1920, 1080 ; moves the entire window to 0,0 i.e. upper left corner.
}   
}
/::ExitApp
Direct X Friendly

Code: Select all

;Screen Saver
loop
{
 MouseGetPos, StartVarX, StartVarY
 sleep, 100
 MouseGetPos, CheckVarX, CheckVarY
  If (StartVarX != CheckVarX) or (StartVarY != CheckVarY) 
  {
   Gui, Destroy
   SystemCursor("Show")
   sleep, 5000
  }
   else
   {
    If A_TimeIdlePhysical > 5000
    {
     gui, color, black
     gui,+ToolWindow +owner -SysMenu -Caption
     gui, show, w%A_ScreenWidth%  h%A_ScreenHeight%, test
     WinSet, Transparent, 23, test
     SystemCursor("Hide")
    }
  }
}

/::
exitapp

OnExit(SystemCursor("Show"))

SystemCursor(cmd)  ; cmd = "Show|Hide|Toggle"
{
    static vision := true, c := {}
    static system_cursors := "32512,32513,32514,32515,32516,32642,32643,32644,32645,32646,32648,32649,32650"
    VarSetCapacity(h_cursor, 4444, 1)
    if (cmd = "Reload" or !c.Length())  ; Reload when requested or at first call.
    {
        VarSetCapacity(AndMask, 32*4, 0xFF)
        VarSetCapacity(XorMask, 32*4, 0)
        For i, resID in StrSplit(system_cursors, ",")
        {
            h_cursor := DllCall("LoadCursor", Ptr, 0, Ptr, resID)
            ; System cursors:
            c[i] := {r: resID}
            ; Handles of default cursors:
            c[i][1] := DllCall("CopyImage", Ptr, h_cursor, UInt, 2, Int, 0, Int, 0, UInt, 0)
            ; Blank cursors:
            c[i][0] := DllCall("CreateCursor", Ptr, 0, Int, 0, Int, 0, Int, 32, Int, 32, Ptr, &AndMask, Ptr, &XorMask)
        }
    }
    if (cmd = "Show")
        vision := true
    else if (cmd = "Hide")
        vision := false
    else if (cmd = "Toggle")
        vision := !vision
    else
        return
    For i, cursor in c
    {
        h_cursor := DllCall("CopyImage", Ptr, cursor[vision], UInt, 2, Int, 0, Int, 0, UInt, 0)
        DllCall("SetSystemCursor", Ptr, h_cursor, UInt, cursor.r)
    }
}


Direct X 9

Game screensaver: an attempt to mask some fps if you get any when standing still "input issues caused this not to work well moving mouse"
Set the transparency higher for a dimmer screen timeout. Thankyou goes to XATMO for helping me with this script and autohotkeys discord community :)

Code: Select all

loop
{
 MouseGetPos, StartVarX, StartVarY
 sleep, 100
 MouseGetPos, CheckVarX, CheckVarY
  If (StartVarX != CheckVarX) or (StartVarY != CheckVarY)
  {
    DllCall("SystemParametersInfo", Int,113, Int,0, UInt,11, Int,1)
   Sleep, 100
   DllCall("SystemParametersInfo", Int,113, Int,0, UInt,0, Int,1)
  
  }
   else
   {
    DllCall(“SystemParametersInfo”, Int,113, Int,0, UInt,14, Int,2)
  }
}

/::
DllCall(“SystemParametersInfo”, Int,113, Int,0, UInt,14, Int,2)
Exitapp
Direct X 9

Mouse Cursor Magic: Just a simple mouse speed increaser script that does a little something extra to make the mouse glide alot more smoothly

Code: Select all

loop
{
MouseGetPos, StartVarX, StartVarY
sleep, 100
MouseGetPos, CheckVarX, CheckVarY
If (StartVarX != CheckVarX) or (StartVarY != CheckVarY)
Process, priority, Alpha Protocol, High

Else
Process, priority, Alpha Protocol, Normal

}

Return

.::
WinGetActiveTitle, Title
MsgBox, The active window is "%Title%"

Return

/::
ExitApp
Direct X Friendly

Process Wizard: Sets the process priority to high when the mouse is moving and normal when its not, Run this script and open up the window of the game you want to play and press the period button "." it will tell you what the id of the game is called. Replace "alpha Protocol" with the name of the window shown and rerun the script.

The constant fullscreen exploit, Make sure to only run the game you plan on running after running this script! Also make sure the game is in fullscreen! it will start on the next window opened!. Some games require you to have them open first before this can work, Each game is different and not all games will play nicely.
Also in menus you might have to rely on the keyboard to accept instead of the mouse. The mouse seems to work perfectly fine ingame for shooting and such I just saw an issue in the menus when trying out deus ex:Mankind divided. Press / to exit any of these

Select one of the codes and paste it and save it as a .ahk file it should give you quite a bit of an fps increase When ran :)
Make sure to change the resolution numbers to the resolution that you use.

Codes were made by a mash up of google searched codes, Therefore I can only credit the idealism behind these script mash ups. These are technically not my scripts so I take no credit for the scripts themselves but instead the thought behind them. Press / to exit the mouse and the constant one.
Last edited by alarineth on 28 Apr 2018, 00:31, edited 1 time in total.
Nantu
Posts: 22
Joined: 30 Jun 2017, 11:15

Re: Insane Performance Inducing autohotkeys!

26 Oct 2018, 02:20

can you make them for a windowed fullscreen mode ?
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Insane Performance Inducing autohotkeys!

26 Oct 2018, 08:00

I'm skeptical about the all the code above. It's not user-friendly: parameters need to be changed multiple times throughout the code. It's not clear what it's supposed to do without going through the code. Some code won't be executed as expected or could target the wrong window.
Besides that, looping through different settings or reapplying the same setting can hardly positively affect performance.
alarineth
Posts: 6
Joined: 27 Apr 2018, 23:39

Re: Insane Performance Inducing autohotkeys!

19 Dec 2018, 09:10

I have tested all of these and they all have provided more fps if not by a few frames just because something doesn't seem viable doesn't mean it isnt
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Insane Performance Inducing autohotkeys!

19 Dec 2018, 12:26

Something that seems to work does not have to be viable on a general level.
Recommends AHK Studio

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 25 guests