Skip to content

Instantly share code, notes, and snippets.

@mikeshardmind
Created July 8, 2017 01:53
Show Gist options
  • Select an option

  • Save mikeshardmind/852f76c3c40ca527ebad699a2514fe2b to your computer and use it in GitHub Desktop.

Select an option

Save mikeshardmind/852f76c3c40ca527ebad699a2514fe2b to your computer and use it in GitHub Desktop.

Revisions

  1. mikeshardmind created this gist Jul 8, 2017.
    34 changes: 34 additions & 0 deletions Dofus.ahk
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    ;This section makes the flashing dofus window come to front, dont touch this without knowing what you are doing
    DetectHiddenWindows, On
    Script_Hwnd := WinExist("ahk_class AutoHotkey ahk_pid " DllCall("GetCurrentProcessId"))
    DetectHiddenWindows, Off
    DllCall("RegisterShellHookWindow", "uint", Script_Hwnd)
    OnMessage(DllCall("RegisterWindowMessage", "str", "SHELLHOOK"), "ShellEvent")
    ShellEvent(wParam, lParam) {
    if (wParam = 0x8006) HSHELL_FLASH
    {
    WinGet,descobre,ProcessName, ahk_id %lParam%
    if(descobre = "Dofus.exe")
    WinActivate, ahk_id %lParam%

    }
    }

    ;This section lets you switch windows with function keys, can be edited to match your character names

    #IfWinExist, Sinbad
    {
    F1::WinActivate Sinbad
    }
    #IfWinExist, Guinevere
    {
    F2::WinActivate Guinevere
    }
    #IfWinExist, General-Quackery
    {
    F3::WinActivate General-Quackery
    }
    #IfWinExist, Viviane
    {
    F4::WinActivate Viviane
    }