; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a ; semicolon, such as this one, are comments.  They are not executed.   ; This script has a special filename and path because it is automatically ; launched when you run the program directly.  Also, any text file whose ; name ends in .ahk is associated with the program, which means that it ; can be launched simply by double-clicking it.  You can have as many .ahk ; files as you want, located in any folder.  You can also run more than ; one ahk file simultaneously and each will get its own tray icon.   ; ==================================== ;        AUTO-EXECUTE ON LAUNCH ; ==================================== ; ------------------------------------ ;         SETUP FIX FOCUS GROUP   GroupAdd, FocusFixers, ahk_class CabinetWClass GroupAdd, FocusFixers, ahk_class MozillaWindowClass GroupAdd, FocusFixers, ahk_class MediaPlayerClassicW ; ------------------------------------ ;          SETUP KEYBIND GROUPS   SetTitleMatchMode, 3   ; VN Standard Keybinds:   ; Up Arrow: Scroll Wheel Up ; Down Arrow: Enter ; Left Arrow: Spacebar ; Right Arrow: Scroll Wheel Down ; Spacebar: Right Click ; Middle Click: Hide Mouse Cursor (Requires Borderless Gaming)   GroupAdd, VNStandard, A Sky Full of Stars GroupAdd, VNStandard, 大番長 - System4.0 Ver.1.31 ; Big Bang Age GroupAdd, VNStandard, CHAOS;HEAD English RC2 GroupAdd, VNStandard, Cartagra GroupAdd, VNStandard, ahk_exe cmvs64.exe ; Chrono Clock GroupAdd, VNStandard, Da Capo 3 R GroupAdd, VNStandard, Dies irae ~Amantes amentes~ GroupAdd, VNStandard, DRACU-RIOT! GroupAdd, VNStandard, FATAL TWELVE GroupAdd, VNStandard, ahk_exe fureraba.exe ; Fureraba GroupAdd, VNStandard, Hatsukoi 1/1 GroupAdd, VNStandard, KARANOSHOJO GroupAdd, VNStandard, Kindred Spirits on the Roof GroupAdd, VNStandard, 恋色空模様 ; Koiiro Soramoyou GroupAdd, VNStandard, ahk_exe mon_que.exe ; Monster Girl Quest! Final Chapter GroupAdd, VNStandard, Re;Lord -The witch of Herfort and stuffed animals- Ver1.00 GroupAdd, VNStandard, Saku Saku: Love Blooms with the Cherry Blossoms (patch) GroupAdd, VNStandard, Sorcery Jokers GroupAdd, VNStandard, Steins;Gate Linear Bounded Phenogram (English) GroupAdd, VNStandard, Tenioha! -Girls Can Be Pervy Too!- GroupAdd, VNStandard, The Fruit of Grisaia Unrated Version GroupAdd, VNStandard, Tokyo Babel GroupAdd, VNStandard, Tsujidou-san no Jun'ai Road GroupAdd, VNStandard, Utawarerumono GroupAdd, VNStandard, Wagamama High Spec GroupAdd, VNStandard, Wonderful Everyday   ; Modified VN Keybinds:   ; Use Page Up/Down as Up/Right Arrow   GroupAdd, VNAltPgUpDown, FATAL TWELVE GroupAdd, VNAltPgUpDown, Sorcery Jokers GroupAdd, VNAltPgUpDown, Utawarerumono   ; Use Right Click as Left Arrow   GroupAdd, VNAltRightClick, DRACU-RIOT! GroupAdd, VNAltRightClick, KARANOSHOJO GroupAdd, VNAltRightClick, Saku Saku: Love Blooms with the Cherry Blossoms (patch) GroupAdd, VNAltRightClick, Tsujidou-san no Jun'ai Road GroupAdd, VNAltRightClick, Utawarerumono   ; Use Shift as Left Arrow   GroupAdd, VNAltShift, Kindred Spirits on the Roof   ; Use Mid Click as Left Arrow   GroupAdd, VNAltMidClick, Steins;Gate Linear Bounded Phenogram (English)   ; Use Escape as Left Arrow   GroupAdd, VNAltEscape, Wonderful Everyday   ; Use H as Left Arrow   GroupAdd, VNAltH, FATAL TWELVE   ; Alt-tab out and back into window before taking screenshot   GroupAdd, VNTabOutSS, FATAL TWELVE ; ------------------------------------ ;         SET GLOBAL VARIABLES   ; OS related variables   OsVersion := ((r := DllCall("GetVersion") & 0xFFFF) & 0xFF) "." (r >> 8) OsWin7OrLower := (OsVersion <= 6.1)   ; Path related variables   PCSX2Folder = E:\Programs\Games\Emulators\PCSX2 ScreenshotFolder = F:\Pictures\Screenshots ScriptsFolder = E:\Programs\Applications\Misc Scripts   ; GTA timer variable   GTATimerOn = 0 ; ------------------------------------ Return ; ==================================== ;           GLOBAL HOTKEYS ; ====================================   ; Volume Up/Down increment one step at a time ^Volume_Down::SoundSet, -1 ^Volume_Up::SoundSet, +1   ; Mute affects only focused window Volume_Mute::Run nircmd muteappvolume focused 2   ; Calculator (Win+F11) #F11::Run "C:\Windows\System32\calc.exe"   ; FeedDemon (Win+F10) #F10::Run "C:\Program Files (x86)\FeedDemon\FeedDemon.exe"   ; Daemon Tools (Win+F9) #F9::Run "C:\Program Files\DAEMON Tools Lite\DTLite.exe"   ; JDownloader (Win+F8) #F8::Run "C:\Programs\Applications\JDownloader v2.0\JDownloader2.exe"   ; Open Window Spy (Win+F7) #F7::Run "C:\Program Files\AutoHotkey\AU3_Spy.exe"   ; Edit This Script (Win+F6) #F6::Run "C:\Program Files (x86)\Notepad++\notepad++.exe" "F:\Documents\Documents\AutoHotkey.ahk"   ; Reload This Script (Win+F5) #F5::Reload   ; Edit Firefox Start Page (Win+F4) #F4::Run "C:\Program Files (x86)\Notepad++\notepad++.exe" "E:\Dropbox\Program Data\Firefox Startpage\newtab.html"   ; Run Borderless Gaming (Win+F3) #F3:: DetectHiddenWindows, On IfWinNotExist ahk_exe BorderlessGaming.exe     Run "C:\Program Files (x86)\Borderless Gaming\BorderlessGaming.exe" else     WinActivate ahk_exe BorderlessGaming.exe Return   ; Show/Hide Taskbar (Win+A) #a:: if (TaskbarHidden = 1) {     WinShow, ahk_class Shell_TrayWnd     TaskbarHidden = 0 } else {     WinHide, ahk_class Shell_TrayWnd     TaskbarHidden = 1 } Return   ; Reopen Logitech Gaming Software (Win+RMB) #RButton:: Process, Close, LCore.exe Run "C:\Program Files\Logitech Gaming Software\LCore.exe" Return   ; Hidden Files toggle (Win+H) #h:: RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden if (HiddenFiles_Status = 2) {     RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1     RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, ShowSuperHidden, 1 } else {     RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2     RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, ShowSuperHidden, 0 } Send {F5} Return   ; Minimize Active Window (Win+N) #n::Send !{Space}n   ; Copy Current Window Unique ID to Clipboard (Win+Del) #Del:: WinGet, getId, ID, A clipboard = %getId% Return   ; Temporarily Suspend All Hotkeys (Shift+Pause) +Pause::Suspend   ; Exit AutoHotkey (Alt+Pause) !Pause::ExitApp   ; Use RAlt+\ as Alt+Tab >!\::>!Tab   ; Launch KeePass if not already running (Ctrl+Alt+K) $^!k:: DetectHiddenWindows, On IfWinNotExist ahk_exe KeePass.exe     Run "C:\Program Files (x86)\KeePass Password Safe 2\KeePass.exe" else     Send ^!k Return   ; ==================================== ;       PROGRAM-SPECIFIC HOTKEYS ; ==================================== ; ------------------------------------ ;         SHORT-TERM HOTKEYS   #IfWinActive ahk_exe EoCApp.exe Home::End End::Del Ins::Home ; ------------------------------------ ;         INDIVIDUAL HOTKEYS   ; Media Player Classic keybinds #IfWinActive ahk_class MediaPlayerClassicW RButton & Volume_Down::SoundSet, -1 RButton & Volume_Up::SoundSet, +1 RButton & XButton1::Send ^{PgUp} RButton & XButton2::Send ^{PgDn} RButton & WheelDown::Send {Left} RButton & WheelUp::Send {Right} RButton & MButton::Reload   ; PCSX2 keybinds #IfWinActive ahk_exe pcsx2.exe ;     Toggle PCSX2 graphic settings then trigger GSdx refresh (Mouse back button) XButton1:: SetWorkingDir, %PCSX2Folder%\inis if FileExist("GSdx_2.ini") {     FileMove, GSdx.ini, GSdx_1.ini     FileMove, GSdx_2.ini, GSdx.ini } else if FileExist("GSdx_1.ini") {     FileMove, GSdx.ini, GSdx_2.ini     FileMove, GSdx_1.ini, GSdx.ini } SetKeyDelay, 200, 20 Send {F9}{F9} Return ;     Refresh GSdx on bottom right mouse button MButton:: SetKeyDelay, 200, 20 Send {F9}{F9} Return   ; GTA V keybinds   ;     Connection switches #IfWinActive ahk_exe GTA5.exe ScrollLock:: Run "%ScriptsFolder%\GTA V\Toggle GTAV Solo.lnk" SoundPlay *64 Return End:: Run "%ScriptsFolder%\GTA V\GTAV Emergency DC.lnk" SoundPlay *16 Return ;     Idle avoiding loop (ctrl+shift+I) ^+i:: if GTATimerOn {     MsgBox Disabling anti-idle loop.     GTATimerOn = 0     SetTimer, GTATimer, Delete } else {     MsgBox Enabling anti-idle loop.     GTATimerOn = 1      SetTimer, GTATimer, 420000 } Return GTATimer: IfWinExist, ahk_exe GTA5.exe {     SetKeyDelay, 60, 60     IfWinExist, A     {         WinActivate, ahk_exe GTA5.exe         Send, {w down}{s down}         Sleep 100         Send, {w up}{s up}          WinActivate     } } else {     MsgBox GTA 5 window not detected.  Ending anti-idle loop.     GTATimerOn = 0     SetTimer, GTATimer, Delete } Return ;     Toggle expanded radar (shift+Z) +z:: SetKeyDelay, 100, 60 Send {Esc} Sleep 100 Send {Right 4} Sleep 300 Send {Enter} Sleep 300 Send {Down 5}{Enter} Sleep 100 Send {Down 5}{Enter} Sleep 100 Send {Backspace 3} Return   ; Save to last used location #IfWinActive ahk_class Qt5QWindowIcon Home UP::Send {Tab 4}{Down} ; ------------------------------------ ;            HOTKEY GROUPS   ; VN Alternate Keybinds #IfWinActive ahk_group VNAltPgUpDown Up::PgUp Right::PgDn   #IfWinActive ahk_group VNAltRightClick Left::RButton Space::Space   #IfWinActive ahk_group VNAltShift Left::Shift Space::Space   #IfWinActive ahk_group VNAltMidClick Left::MButton Space::Space   #IfWinActive ahk_group VNAltEscape Left::Esc Space::Space   #IfWinActive ahk_group VNAltH Left::h Space::Space   #IfWinActive ahk_group VNTabOutSS #PrintScreen:: SetKeyDelay, 100, 60 Send !{Tab}!{Tab}#{PrintScreen} Return   ; VN Standard Keybinds #IfWinActive ahk_group VNStandard Up::Send {WheelUp} Down::Enter Left::Space Right::Send {WheelDown} Space::RButton MButton:: Send #{ScrollLock} Send {ScrollLock} Return   ; Fix Focus (RMB + Enter) #IfWinActive ahk_group FocusFixers RButton & Enter:: IfWinExist, A {     WinActivate, ahk_class Progman     WinActivate } Return $RButton::RButton ; ------------------------------------ ; ==================================== ;          OS-SPECIFIC HOTKEYS ; ==================================== ; ------------------------------------ ;          WINDOWS 7 OR OLDER   #If %OsWin7OrLower%   ; Take screenshots with nircmd (Win+Print Screen) #PrintScreen:: If (ScreenshotIndex < 1) {     Loop, %ScreenshotFolder%\*     {          FileGetTime, Time, %A_LoopFileFullPath%, C          If (Time > Time_Orig) {               Time_Orig := Time               NewIndexFile := A_LoopFileName          }     }     Loop, Parse, NewIndexFile, (|)         If A_LoopField is integer             NewIndexNum := A_LoopField     ScreenshotIndex := NewIndexNum     MsgBox, Screenshot indexing complete.  Repeat hotkey to take screenshot. } Else {     Run nircmd savescreenshot "%ScreenshotFolder%\Screenshot (%ScreenshotIndex%).png"     SoundPlay, *64 } ScreenshotIndex++ Return ; ------------------------------------