#NoEnv
CoordMode, Mouse, Screen
SetBatchLines -1
IfWinExist, ahk_class Ace of Spades
{
IniRead, HotTrig, config.ini, airstrike, key
If (HotTrig = "ERROR")
{
IniWrite, q, config.ini, airstrike, key
HotTrig := "q"
}
Menu, Tray, NoStandard
Menu, Tray, Add, Set Key, Key
Menu, Tray, Add
Menu, Tray, Add, Exit, Exit
Hotkey, ~%HotTrig%, Trigger
Gui, font, s14 cBlack
Loop, 8
{
NY := a_index - 1
Loop, 8
{
NX := a_index - 1
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
}
}
WinGetPos, X, Y, Width, Height, ahk_class Ace of Spades
NX := ((Width/2) - (532/2)) + X
NY := ((Height/2) - (532/2)) + Y
Gui, Color, White, White
Gui, -Caption
Gui, Show, % "w532 h532 x" . 0 . " y" . 0, AoS Airstriker
WinMove, AoS Airstriker,, %NX%, %NY%
WinMinimize, AoS Airstriker
}
Else
{
MsgBox, Ace of Spades not running.
ExitApp
}
Return
Airstrike:
IfWinExist, ahk_class Ace of Spades
{
WinActivate
IfWinActive, ahk_class Ace of Spades
SendInput,,{Blind}t/airstrike %A_GuiControl%{ENTER}
WinMinimize, AoS Airstriker
}
Return
Trigger:
IfWinActive, ahk_class Ace of Spades
{
Send, {w UP}{a UP}{s UP}{d UP}
WinActivate, AoS Airstriker
WinGetPos, X, Y, Width, Height, ahk_class Ace of Spades
WinMove, AoS Airstriker, % ((Width/2) - (532/2)) + X, % ((Height/2) - (532/2)) + Y
}
Return
Key:
InputBox, NewKey, Set key, What would you like the trigger key to be?,,,,,,,,%HotTrig%
If (StrLen(NewKey) = 1)
{
Hotkey, ~%HotTrig%, Trigger, Off
HotTrig := NewKey
Hotkey, ~%HotTrig%, Trigger, On
IniWrite, %HotTrig%, config.ini, airstrike, key
}
Else
{
MsgBox, New key not set.
}
Return
Exit:
GuiClose:
ExitApp