I want to be able to switch windows while playing League of Legends, but #^Left doesn't work on its own. So I thought "okay, let's make a script". However, strange things happen when I use the included code below. I'm not sure what I want to do is even possible to be honest, because LoL won't have the focus for the latter part of the script, even if the !Tab would actually work, which it doesn't. The really strange thing is that this script actually loops, as if I hadn't included the $. Please help. I'm totally confused. Is it even possible to have a script that continues to run when the #ifwinactive stops being true?
Code: Select all
#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.
#SingleInstance Force
SendMode Event
SetTitleMatchMode 2
#ifwinactive League of Legends (TM) Client
{
$#^Left::
Send !Tab
Sleep 1000
Send #^Left
Return
$#^Right::
Send !Tab
Sleep 1000
Send #^Right
Return
$#^Up::
Reload
Return
}