Skip to content

Instantly share code, notes, and snippets.

@Zren
Last active Aug 29, 2015
Embed
What would you like to do?
Dolphin AutoHotKey Script
; 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