Last active
August 29, 2015 14:07
-
-
Save Zren/7706552efd4d36ffa995 to your computer and use it in GitHub Desktop.
Dolphin AutoHotKey Script
This file contains 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 characters
; Dolphin Hotkeys | |
; | |
; FEATURES: | |
; * Bind L2 on a Dualshock controller to Tab, which | |
; will unthrottle the frame rate. Aka Turbo key. | |
; * Autosave every minute to Save Slots 4-8. | |
; * Manually save with the Dualshock select button. | |
SetTimer, AutoSaveTicker, 60000 | |
Joy7:: | |
SetTitleMatchMode, RegEx | |
dolphinWinTitleRegex := "^Dolphin.*\| FPS:.*$" | |
ControlSend, , {Tab down}, %dolphinWinTitleRegex% ; Hold dowautoSaveSlot the left-arrow key. | |
KeyWait, Joy7 ; Wait for the user to release the joystick buttoautoSaveSlot. | |
ControlSend, , {Tab up}, %dolphinWinTitleRegex% ; Release the left-arrow key. | |
return | |
AutoSave() { | |
global autoSaveSlot | |
SetTitleMatchMode, RegEx | |
dolphinWinTitleRegex := "^Dolphin.*\| FPS:.*$" | |
if !(autoSaveSlot is number) | |
autoSaveSlot := 4 | |
if (autoSaveSlot == 4) { | |
ControlSend, , {Shift down}{F4}{Shift up}, %dolphinWinTitleRegex% | |
} else if (autoSaveSlot == 5) { | |
ControlSend, , {Shift down}{F5}{Shift up}, %dolphinWinTitleRegex% | |
} else if (autoSaveSlot == 6) { | |
ControlSend, , {Shift down}{F6}{Shift up}, %dolphinWinTitleRegex% | |
} else if (autoSaveSlot == 7) { | |
ControlSend, , {Shift down}{F7}{Shift up}, %dolphinWinTitleRegex% | |
} else if (autoSaveSlot == 8) { | |
ControlSend, , {Shift down}{F8}{Shift up}, %dolphinWinTitleRegex% | |
} | |
; WinGetTitle, Title, %dolphinWinTitleRegex% | |
; MsgBox, The active window is "%Title%". | |
autoSaveSlot++ | |
if (autoSaveSlot > 8) { | |
autoSaveSlot := 4 | |
} | |
return | |
} | |
; Force AutoSave manually. | |
Joy9::AutoSave() | |
; | |
AutoSaveTicker: | |
AutoSave() | |
return | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment