Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #NoEnv
  2. CoordMode, Mouse, Screen
  3. SetBatchLines -1
  4. IfWinExist, ahk_class Ace of Spades
  5. {
  6.     IniRead, HotTrig, config.ini, airstrike, key
  7.     If (HotTrig = "ERROR")
  8.     {
  9.         IniWrite, q, config.ini, airstrike, key
  10.         HotTrig := "q"
  11.     }
  12.  
  13.     Menu, Tray, NoStandard
  14.     Menu, Tray, Add, Set Key, Key
  15.     Menu, Tray, Add
  16.     Menu, Tray, Add, Exit, Exit
  17.     Hotkey, ~%HotTrig%, Trigger
  18.     Gui, font, s14 cBlack
  19.     Loop, 8
  20.     {
  21.         NY := a_index - 1
  22.         Loop, 8
  23.         {
  24.             NX := a_index - 1
  25.             Gui, Add, Button, % " x" . (NX * 64) + 10 . " y" . (NY * 64) + 10 . " w64 h64 gAirstrike v" . Chr(65 + NX) . NY + 1, % Chr(65 + NX) . NY + 1
  26.         }
  27.     }
  28.     WinGetPos, X, Y, Width, Height, ahk_class Ace of Spades
  29.     NX := ((Width/2) - (532/2)) + X
  30.     NY := ((Height/2) - (532/2)) + Y
  31.     Gui, Color, White, White
  32.     Gui, -Caption
  33.     Gui, Show, % "w532 h532 x" . 0 . " y" . 0, AoS Airstriker
  34.     WinMove, AoS Airstriker,, %NX%, %NY%
  35.     WinMinimize, AoS Airstriker
  36. }
  37. Else
  38. {
  39.     MsgBox, Ace of Spades not running.
  40.     ExitApp
  41. }
  42. Return
  43.  
  44. Airstrike:
  45. IfWinExist, ahk_class Ace of Spades
  46. {
  47.     WinActivate
  48.     IfWinActive, ahk_class Ace of Spades
  49.         SendInput,,{Blind}t/airstrike %A_GuiControl%{ENTER}
  50.     WinMinimize, AoS Airstriker
  51. }
  52. Return
  53.  
  54. Trigger:
  55. IfWinActive, ahk_class Ace of Spades
  56. {
  57.     Send, {w UP}{a UP}{s UP}{d UP}
  58.     WinActivate, AoS Airstriker
  59.     WinGetPos, X, Y, Width, Height, ahk_class Ace of Spades
  60.     WinMove, AoS Airstriker, % ((Width/2) - (532/2)) + X, % ((Height/2) - (532/2)) + Y
  61. }
  62. Return
  63.  
  64. Key:
  65. InputBox, NewKey, Set key, What would you like the trigger key to be?,,,,,,,,%HotTrig%
  66. If (StrLen(NewKey) = 1)
  67. {
  68.     Hotkey, ~%HotTrig%, Trigger, Off
  69.     HotTrig := NewKey
  70.     Hotkey, ~%HotTrig%, Trigger, On
  71.     IniWrite, %HotTrig%, config.ini, airstrike, key
  72. }
  73. Else
  74. {
  75.     MsgBox, New key not set.
  76. }
  77. Return
  78.  
  79. Exit:
  80. GuiClose:
  81. ExitApp