Code: Select all
; Double-Tap RControl to Open/Close Elma
ElmaFolder = C:\Path\To\Elma\Folder
WinElmaName = Elasto Mania
ElmaFile = eol.exe
WinDXWindowerName = DirectX Windower v1.88
DXWindowerFile = D3DWindower.exe
~RControl::
if (A_PriorHotkey <> "~RControl" or A_TimeSincePriorHotkey > 400)
{
; Too much time between presses, so this isn't a double-press.
KeyWait, RControl
return
}
IfWinNotExist, %WinElmaName%
{
IfWinNotExist, %WinDXWindowerName%
Run, %DXWindowerFile%, %ElmaFolder%
else
WinActivate
WinWaitActive, %WinDXWindowerName%
MouseClick, left, 30, 70, 2
Process Wait, %ElmaFile%, 5
WinWaitActive, %WinElmaName%
Send {Space down} ; Bypass splashscreen
Sleep, 10
Send {Space up}
Sleep, 1200 ; Usually works around 1000 - 1500ms
Send {Enter down} ; Select first player
Sleep, 10
Send {Enter up}
return
} else {
WinActivate
WinWaitActive, %WinElmaName%
Loop 5 {
Send {Esc down}
Sleep, 10
Send {Esc up}
Sleep, 10
}
Send {Enter down}
Sleep, 10
Send {Enter up}
Sleep, 300
Send {Space down}
Sleep, 10
Send {Space up}
IfWinExist, %WinDXWindowerName%
WinKill
return
}
Edit: changed the closing part of the script to exit normally instead of terminating the eol.exe process.