SHARE
TWEET

Untitled

a guest Aug 11th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  
  2. #InstallKeybdHook
  3. ; #Warn  
  4. SendMode Input
  5. SetWorkingDir %A_ScriptDir%
  6.  
  7. ; Create Executable group for gameHotkey, IfWinActive
  8. global POEGameArr := ["PathOfExile.exe", "PathOfExile_x64.exe", "PathOfExileSteam.exe", "PathOfExile_x64Steam.exe", "PathOfExile_KG.exe", "PathOfExile_x64_KG.exe"]
  9. for n, exe in POEGameArr {
  10.     GroupAdd, POEGameGroup, ahk_exe %exe%
  11. }
  12.  
  13. Global 1Suffix1Text,1Suffix2Text,1Suffix3Text,1Suffix4Text,1Suffix5Text
  14.  
  15. ; This GUI allows you to register primitive three-key combination hotkeys:
  16. Gui Add, Text, xm section, 1Prefix key:
  17. Gui Add, Edit, yp x100 w50 v1Prefix1, a
  18. Gui Add, Edit, yp x100 y+1 w50 v1Prefix2, s
  19. Gui Add, Text, xm section, 1Suffix hotkey:
  20. Gui Add, Edit, yp x100 w100  v1Suffix1, 1
  21. Gui Add, Edit, yp x100 y+1 w100  v1Suffix2, 2
  22. Gui Add, Edit, yp x100 y+1 w100  v1Suffix3, 3
  23. Gui Add, Edit, yp x100 y+1 w100  v1Suffix4, 4
  24. Gui Add, Edit, yp x100 y+1 w100  v1Suffix5, 5
  25. Gui Add, Edit, x+1 ys w100  v1Suffix1Text, /Hideout
  26. Gui Add, Edit,  y+1 w100  v1Suffix2Text, /oos
  27. Gui Add, Edit,  y+1 w100  v1Suffix3Text, 3
  28. Gui Add, Edit,  y+1 w100  v1Suffix4Text, 4
  29. Gui Add, Edit,  y+1 w100  v1Suffix5Text, 5
  30. Gui Add, Button, Default, Register1
  31. Gui Show
  32. return
  33. ButtonRegister1() {
  34.     global
  35.         If 1Suffix1
  36.             Hotkey, *%1Suffix1%, off
  37.         If 1Suffix2
  38.             Hotkey, *%1Suffix2%, off
  39.         If 1Suffix3
  40.             Hotkey, *%1Suffix3%, off
  41.         If 1Suffix4
  42.             Hotkey, *%1Suffix4%, off
  43.         If 1Suffix5
  44.             Hotkey, *%1Suffix5%, off
  45.     Gui Submit, NoHide
  46.     local fn
  47.     fn := Func("HotkeyShouldFire").Bind(1Prefix1,1Prefix2)
  48.     Hotkey If, % fn
  49.     Loop, 5 {
  50.         If (1Suffix%A_Index%)
  51.             keyval := 1Suffix%A_Index%
  52.             Hotkey, *%keyval%, FireWhisperHotkey%A_Index%, On
  53.         }
  54.     }
  55. HotkeyShouldFire(1Prefix1, 1Prefix2, thisHotkey) {
  56.     IfWinExist, ahk_group POEGameGroup
  57.         {
  58.         If ( 1Prefix1 && 1Prefix2 ){
  59.             If ( GetKeyState(1Prefix1) && GetKeyState(1Prefix2) )
  60.                 return True
  61.             Else
  62.                 return False
  63.             }
  64.         Else If ( 1Prefix1 && !1Prefix2 ) {
  65.             If ( GetKeyState(1Prefix1) )
  66.                 return True
  67.             Else
  68.                 return False
  69.             }
  70.         Else If ( !1Prefix1 && 1Prefix2 ) {
  71.             If ( GetKeyState(1Prefix2) )
  72.                 return True
  73.             Else
  74.                 return False
  75.             }
  76.         Else If ( !1Prefix1 && !1Prefix2 ) {
  77.             return True
  78.             }
  79.         }
  80.     Else {
  81.             Return False
  82.         }
  83. }
  84. FireWhisperHotkey1() {
  85.     Tooltip, %A_ThisHotkey%
  86.     Send, {Enter}%1Suffix1Text%{Enter}
  87. }
  88. FireWhisperHotkey2() {
  89.     MsgBox %A_ThisHotkey%
  90. }
  91. FireWhisperHotkey3() {
  92.     MsgBox %A_ThisHotkey%
  93. }
  94. FireWhisperHotkey4() {
  95.     MsgBox %A_ThisHotkey%
  96. }
  97. FireWhisperHotkey5() {
  98.     MsgBox %A_ThisHotkey%
  99. }
  100. GuiClose:
  101. GuiEscape:
  102. ExitApp
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top