Hi,
I've got a problem with the game League of Legends. I made an ahk file for this game and it wouldn't work in the beginning, so I forced it by running the ahk file as admin. Altough the file then worked as intended, the by-product was tremendous lag. So I exited the file. The lag however remained in an eased state. I deinstalled lol and ahk completely (also deleted hidden files and registry entries), and reinstalled League. It didn't change for the good. I tried everything to solve the problem in cooperation with leagues' customer support and my internet providers' customer support for over four weeks. League of Legends' customer support detected corrupted files, but couldn't help me to fix them. I even relocated my pc into factory state, didn't help either. Several internet connection/package loss and system checks proved that everything works perfectly fine. It isn't surprising since no problem with my system or connectivity caused the game lags in first place, I always played League without any problems. The problem immediately occured the first time when I made my ahk file working by running it as admin. I will present you the code in the following, an important part is probably the #IfWinActive context in combination of running the ahk file as admin. Because only then the ahk file will work for League of Legends. Furthermore I could significantly improve my gaming experience in terms of lags by capping the fps from "uncapped" to 144 fps, the lag isn't completely vanished though. I made a video of the current lag I experience (https://vid.me/ZjoC). However before the ahk incident, I played League for like half a year in "uncapped" mode. I had no problems besides some noise in the first 2 minutes after a game started, which hinted towards a coil whine. I'm sorry that I can't provide you all the measures I tried to solve the problem, because it was really a shit ton. However I don't know until today, why I've got this problem at all. So I hope for some sort of insight about errors or bad side-effects caused by autohotkey and how to fix them, because my problem feels like black magic. I notice this lag nearly every game, the customer support sees corrupt files in my r3d logs, but no one knows why and how this problematic state could happen. If there is a Dr. House of Computer Science out there, pls help me. And here is the promised code.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #MaxHotkeysPerInterval 9999 #SingleInstance Force #UseHook On SetTimer, CheckLOL, 300 ; checks if LOL processes exist Run, "C:\Riot Games\League of Legends\lol.launcher.exe" ;runs League of Legends #IfWinActive League of Legends (TM) Client ; the following works only with ingame window being active a:: SendInput {c Down} Sleep 10 SendInput {c Up} Sleep 70 SendInput {w Down} Sleep 10 SendInput {w Up} Return s:: SendInput {v Down} Sleep 10 SendInput {v Up} Sleep 70 SendInput {w Down} Sleep 10 SendInput {w Up} Return #IfWinActive ; end of context-sensitive CheckLOL: ;ahk file closes when League of Legends related processes are closed Process, Exist, LOLLauncher.exe if (ErrorLevel = 0 ) { Process, Exist, LOLClient.exe if (ErrorLevel = 0) { ExitApp } Return } Return