diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..44a0964 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.ini \ No newline at end of file diff --git a/Icons/AlwaysOnTop.png b/Icons/AlwaysOnTop.png new file mode 100644 index 0000000..2cb81f3 Binary files /dev/null and b/Icons/AlwaysOnTop.png differ diff --git a/Icons/AntiMaterielRifle.png b/Icons/AntiMaterielRifle.png new file mode 100644 index 0000000..0f435af Binary files /dev/null and b/Icons/AntiMaterielRifle.png differ diff --git a/Icons/AntiPersonnelMinefield.png b/Icons/AntiPersonnelMinefield.png index 6e9348b..910fdd6 100644 Binary files a/Icons/AntiPersonnelMinefield.png and b/Icons/AntiPersonnelMinefield.png differ diff --git a/Icons/ArcThrower.png b/Icons/ArcThrower.png new file mode 100644 index 0000000..8f5cdf6 Binary files /dev/null and b/Icons/ArcThrower.png differ diff --git a/Icons/Autocannon.png b/Icons/Autocannon.png new file mode 100644 index 0000000..8c37e8b Binary files /dev/null and b/Icons/Autocannon.png differ diff --git a/Icons/AutocannonSentry.png b/Icons/AutocannonSentry.png new file mode 100644 index 0000000..1b300fa Binary files /dev/null and b/Icons/AutocannonSentry.png differ diff --git a/Icons/BallisticShieldBackpack.png b/Icons/BallisticShieldBackpack.png new file mode 100644 index 0000000..6bfb0ca Binary files /dev/null and b/Icons/BallisticShieldBackpack.png differ diff --git a/Icons/Blank.png b/Icons/Blank.png new file mode 100644 index 0000000..3957dab Binary files /dev/null and b/Icons/Blank.png differ diff --git a/Icons/EMSMortarSentry.png b/Icons/EMSMortarSentry.png new file mode 100644 index 0000000..a727124 Binary files /dev/null and b/Icons/EMSMortarSentry.png differ diff --git a/Icons/Eagle110MMRocketPods.png b/Icons/Eagle110MMRocketPods.png new file mode 100644 index 0000000..cad5717 Binary files /dev/null and b/Icons/Eagle110MMRocketPods.png differ diff --git a/Icons/Eagle500KgBomb.png b/Icons/Eagle500KgBomb.png new file mode 100644 index 0000000..2a10e46 Binary files /dev/null and b/Icons/Eagle500KgBomb.png differ diff --git a/Icons/EagleAirstrike.png b/Icons/EagleAirstrike.png new file mode 100644 index 0000000..2a60b26 Binary files /dev/null and b/Icons/EagleAirstrike.png differ diff --git a/Icons/EagleClusterBomb.png b/Icons/EagleClusterBomb.png new file mode 100644 index 0000000..647c774 Binary files /dev/null and b/Icons/EagleClusterBomb.png differ diff --git a/Icons/EagleNapalmAirstrike.png b/Icons/EagleNapalmAirstrike.png new file mode 100644 index 0000000..ca38505 Binary files /dev/null and b/Icons/EagleNapalmAirstrike.png differ diff --git a/Icons/EagleRearm.png b/Icons/EagleRearm.png new file mode 100644 index 0000000..94ce340 Binary files /dev/null and b/Icons/EagleRearm.png differ diff --git a/Icons/EagleSmokeStrike.png b/Icons/EagleSmokeStrike.png new file mode 100644 index 0000000..5c1a7ed Binary files /dev/null and b/Icons/EagleSmokeStrike.png differ diff --git a/Icons/EagleStrafingRun.png b/Icons/EagleStrafingRun.png new file mode 100644 index 0000000..ae6997f Binary files /dev/null and b/Icons/EagleStrafingRun.png differ diff --git a/Icons/ExpendableAntiTank.png b/Icons/ExpendableAntiTank.png new file mode 100644 index 0000000..38ff86b Binary files /dev/null and b/Icons/ExpendableAntiTank.png differ diff --git a/Icons/Flamethrower.png b/Icons/Flamethrower.png new file mode 100644 index 0000000..1ddced9 Binary files /dev/null and b/Icons/Flamethrower.png differ diff --git a/Icons/GatlingSentry.png b/Icons/GatlingSentry.png index 583b7b7..227021e 100644 Binary files a/Icons/GatlingSentry.png and b/Icons/GatlingSentry.png differ diff --git a/Icons/GrenadeLauncher.png b/Icons/GrenadeLauncher.png new file mode 100644 index 0000000..cb09dc7 Binary files /dev/null and b/Icons/GrenadeLauncher.png differ diff --git a/Icons/GuardDog.png b/Icons/GuardDog.png new file mode 100644 index 0000000..a8536a9 Binary files /dev/null and b/Icons/GuardDog.png differ diff --git a/Icons/GuardDogRover.png b/Icons/GuardDogRover.png new file mode 100644 index 0000000..5d42258 Binary files /dev/null and b/Icons/GuardDogRover.png differ diff --git a/Icons/HMGEmplacement.png b/Icons/HMGEmplacement.png new file mode 100644 index 0000000..f31681a Binary files /dev/null and b/Icons/HMGEmplacement.png differ diff --git a/Icons/Hellbomb.png b/Icons/Hellbomb.png new file mode 100644 index 0000000..bb0c6ed Binary files /dev/null and b/Icons/Hellbomb.png differ diff --git a/Icons/IncendiaryMines.png b/Icons/IncendiaryMines.png new file mode 100644 index 0000000..4c51150 Binary files /dev/null and b/Icons/IncendiaryMines.png differ diff --git a/Icons/JumpPack.png b/Icons/JumpPack.png new file mode 100644 index 0000000..c7b6b61 Binary files /dev/null and b/Icons/JumpPack.png differ diff --git a/Icons/LaserCannon.png b/Icons/LaserCannon.png new file mode 100644 index 0000000..e021e5b Binary files /dev/null and b/Icons/LaserCannon.png differ diff --git a/Icons/MachineGun.png b/Icons/MachineGun.png new file mode 100644 index 0000000..e2ec556 Binary files /dev/null and b/Icons/MachineGun.png differ diff --git a/Icons/MachineGunSentry.png b/Icons/MachineGunSentry.png index 6a2bc82..37c67ea 100644 Binary files a/Icons/MachineGunSentry.png and b/Icons/MachineGunSentry.png differ diff --git a/Icons/MortarSentry.png b/Icons/MortarSentry.png new file mode 100644 index 0000000..245e8dc Binary files /dev/null and b/Icons/MortarSentry.png differ diff --git a/Icons/Orbital120MMHEBarrage.png b/Icons/Orbital120MMHEBarrage.png new file mode 100644 index 0000000..63ee960 Binary files /dev/null and b/Icons/Orbital120MMHEBarrage.png differ diff --git a/Icons/Orbital380MMHEBarrage.png b/Icons/Orbital380MMHEBarrage.png new file mode 100644 index 0000000..c4d9b46 Binary files /dev/null and b/Icons/Orbital380MMHEBarrage.png differ diff --git a/Icons/OrbitalAirburstStrike.png b/Icons/OrbitalAirburstStrike.png new file mode 100644 index 0000000..0d95148 Binary files /dev/null and b/Icons/OrbitalAirburstStrike.png differ diff --git a/Icons/OrbitalEMSStrike.png b/Icons/OrbitalEMSStrike.png new file mode 100644 index 0000000..8268dad Binary files /dev/null and b/Icons/OrbitalEMSStrike.png differ diff --git a/Icons/OrbitalGasStrike.png b/Icons/OrbitalGasStrike.png new file mode 100644 index 0000000..64b1d30 Binary files /dev/null and b/Icons/OrbitalGasStrike.png differ diff --git a/Icons/OrbitalGatlingBarrage.png b/Icons/OrbitalGatlingBarrage.png new file mode 100644 index 0000000..aa4c410 Binary files /dev/null and b/Icons/OrbitalGatlingBarrage.png differ diff --git a/Icons/OrbitalIlluminationFlare.png b/Icons/OrbitalIlluminationFlare.png new file mode 100644 index 0000000..bdf0309 Binary files /dev/null and b/Icons/OrbitalIlluminationFlare.png differ diff --git a/Icons/OrbitalLaser.png b/Icons/OrbitalLaser.png new file mode 100644 index 0000000..2bf6a68 Binary files /dev/null and b/Icons/OrbitalLaser.png differ diff --git a/Icons/OrbitalPrecisionStrike.png b/Icons/OrbitalPrecisionStrike.png new file mode 100644 index 0000000..1a03b5f Binary files /dev/null and b/Icons/OrbitalPrecisionStrike.png differ diff --git a/Icons/OrbitalPrecisionStrinke.png b/Icons/OrbitalPrecisionStrinke.png deleted file mode 100644 index f3ded6c..0000000 Binary files a/Icons/OrbitalPrecisionStrinke.png and /dev/null differ diff --git a/Icons/OrbitalRailcannonStrike.png b/Icons/OrbitalRailcannonStrike.png new file mode 100644 index 0000000..7e411b3 Binary files /dev/null and b/Icons/OrbitalRailcannonStrike.png differ diff --git a/Icons/OrbitalSmokeStrike.png b/Icons/OrbitalSmokeStrike.png new file mode 100644 index 0000000..dddd2f4 Binary files /dev/null and b/Icons/OrbitalSmokeStrike.png differ diff --git a/Icons/OrbitalWalkingBarrage.png b/Icons/OrbitalWalkingBarrage.png new file mode 100644 index 0000000..5d78407 Binary files /dev/null and b/Icons/OrbitalWalkingBarrage.png differ diff --git a/Icons/RailGun.png b/Icons/RailGun.png new file mode 100644 index 0000000..ea73463 Binary files /dev/null and b/Icons/RailGun.png differ diff --git a/Icons/RecoillessRifle.png b/Icons/RecoillessRifle.png new file mode 100644 index 0000000..3d283f7 Binary files /dev/null and b/Icons/RecoillessRifle.png differ diff --git a/Icons/Reinforce.png b/Icons/Reinforce.png index f317e2d..36f224c 100644 Binary files a/Icons/Reinforce.png and b/Icons/Reinforce.png differ diff --git a/Icons/Resupply.png b/Icons/Resupply.png index 2adbde9..724605d 100644 Binary files a/Icons/Resupply.png and b/Icons/Resupply.png differ diff --git a/Icons/RocketSentry.png b/Icons/RocketSentry.png new file mode 100644 index 0000000..6ad11fd Binary files /dev/null and b/Icons/RocketSentry.png differ diff --git a/Icons/SOSBeacon.png b/Icons/SOSBeacon.png new file mode 100644 index 0000000..af7e55f Binary files /dev/null and b/Icons/SOSBeacon.png differ diff --git a/Icons/SSSDDelivery.png b/Icons/SSSDDelivery.png new file mode 100644 index 0000000..5e99fd3 Binary files /dev/null and b/Icons/SSSDDelivery.png differ diff --git a/Icons/ShieldGeneratorPack.png b/Icons/ShieldGeneratorPack.png new file mode 100644 index 0000000..2ff470a Binary files /dev/null and b/Icons/ShieldGeneratorPack.png differ diff --git a/Icons/ShieldGeneratorRelay.png b/Icons/ShieldGeneratorRelay.png new file mode 100644 index 0000000..388ffa5 Binary files /dev/null and b/Icons/ShieldGeneratorRelay.png differ diff --git a/Icons/Spear.png b/Icons/Spear.png new file mode 100644 index 0000000..7992492 Binary files /dev/null and b/Icons/Spear.png differ diff --git a/Icons/Stalwart.png b/Icons/Stalwart.png new file mode 100644 index 0000000..7377461 Binary files /dev/null and b/Icons/Stalwart.png differ diff --git a/Icons/SupplyPack.png b/Icons/SupplyPack.png new file mode 100644 index 0000000..49bff15 Binary files /dev/null and b/Icons/SupplyPack.png differ diff --git a/Icons/TeslaTower.png b/Icons/TeslaTower.png new file mode 100644 index 0000000..4e44219 Binary files /dev/null and b/Icons/TeslaTower.png differ diff --git a/Icons/UploadData.png b/Icons/UploadData.png new file mode 100644 index 0000000..c529c25 Binary files /dev/null and b/Icons/UploadData.png differ diff --git a/Icons/stratagems.png b/Icons/stratagems.png deleted file mode 100644 index f8b5f33..0000000 Binary files a/Icons/stratagems.png and /dev/null differ diff --git a/stratagems.ahk b/stratagems.ahk index ddbf236..89cff4e 100644 --- a/stratagems.ahk +++ b/stratagems.ahk @@ -2,399 +2,202 @@ SendMode "Event" SetKeyDelay 100, 50 -; Macro keys definition -; https://www.autohotkey.com/docs/v2/Hotkeys.htm - how hotkeys work -; https://www.autohotkey.com/docs/v2/KeyList.htm - key names to use -; Modificators: -; ^ - Ctrl - combinations with Ctrl might need some modifications, better not use -; + - Shift -; ! - Alt -; # - Win -; -; v-----v key combination, can be single key or combination of keys, examples: ^x, +a, !q -; Numpad7:: Reinforce() -; ^^ needs to be there -; ^---------^ stratagem function name, same as below -#HotIf WinActive("Helldivers™ 2") -NumpadDiv:: return -NumpadMult:: return -NumpadSub:: return +; Stratagem sequence definition +{ + stratagems := Map() + stratagems.Default := "" + stratagems["Reinforce"] := "wsdaw" + stratagems["SOSBeacon"] := "wsdw" + stratagems["Resupply"] := "sswd" + stratagems["EagleRearm"] := "wwawd" + stratagems["Hellbomb"] := "swaswdsw" + stratagems["SSSDDelivery"] := "sssww" + stratagems["UploadData"] := "adwww" + stratagems["OrbitalIlluminationFlare"] := "ddaa" + stratagems["MachineGun"] := "saswd" + stratagems["AntiMaterielRifle"] := "sadws" + stratagems["Stalwart"] := "" + stratagems["ExpendableAntiTank"] := "ssawd" + stratagems["RecoillessRifle"] := "sadda" + stratagems["Flamethrower"] := "" + stratagems["Autocannon"] := "saswwd" + stratagems["RailGun"] := "sdswad" + stratagems["Spear"] := "" + stratagems["GrenadeLauncher"] := "" + stratagems["LaserCannon"] := "" + stratagems["ArcThrower"] := "" + stratagems["JumpPack"] := "swwsw" + stratagems["SupplyPack"] := "" + stratagems["GuardDog"] := "swawds" + stratagems["GuardDogRover"] := "" + stratagems["BallisticShieldBackpack"] := "" + stratagems["ShieldGeneratorPack"] := "swadad" + stratagems["OrbitalGatlingBarrage"] := "dsaww" + stratagems["OrbitalAirburstStrike"] := "ddd" + stratagems["Orbital120MMHEBarrage"] := "ddsads" + stratagems["Orbital380MMHEBarrage"] := "dswwass" + stratagems["OrbitalWalkingBarrage"] := "" + stratagems["OrbitalLaser"] := "dswds" + stratagems["OrbitalRailcannonStrike"] := "" + stratagems["OrbitalPrecisionStrike"] := "ddw" + stratagems["OrbitalGasStrike"] := "" + stratagems["OrbitalEMSStrike"] := "" + stratagems["OrbitalSmokeStrike"] := "" + stratagems["EagleStrafingRun"] := "wdd" + stratagems["EagleAirstrike"] := "wdsd" + stratagems["EagleClusterBomb"] := "wdssd" + stratagems["EagleNapalmAirstrike"] := "" + stratagems["EagleSmokeStrike"] := "" + stratagems["Eagle110MMRocketPods"] := "wdwa" + stratagems["Eagle500KgBomb"] := "wdsss" + stratagems["AntiPersonnelMinefield"] := "sawd" + stratagems["IncendiaryMines"] := "" + stratagems["HMGEmplacement"] := "swadda" + stratagems["ShieldGeneratorRelay"] := "" + stratagems["TeslaTower"] := "" + stratagems["MachineGunSentry"] := "swddw" + stratagems["GatlingSentry"] := "swda" + stratagems["MortarSentry"] := "swdds" + stratagems["AutocannonSentry"] := "" + stratagems["RocketSentry"] := "swdda" + stratagems["EMSMortarSentry"] := "" +} -NumpadHome:: -Numpad7:: Reinforce() -NumpadUp:: -Numpad8:: EagleRearm() -NumpadPgUp:: -Numpad9:: Resupply() - -NumpadIns:: -Numpad0:: EagleClusterBomb() -NumpadEnd:: -Numpad1:: OrbitalPrecisionStrike() -NumpadDown:: -Numpad2:: MortarSentry() -NumpadPgDn:: -Numpad3:: GatlingSentry() - -NumpadLeft:: -Numpad4:: MachineGun() -NumpadClear:: -Numpad5:: RailGun() -NumpadRight:: -Numpad6:: AntiMaterielRifle() - -NumpadDot:: return -NumpadDel:: return -NumpadEnter:: return -NumpadAdd:: Hellbomb() - -; Stratagem definition, copy the template, change name to stratagem name and fill in the sequence same as in game. -; v-------v change the name -; Template() { -; BlockInput "On" ; v enter the sequence between the brackets -; Send "{LControl down}{LControl up}" -; BlockInput "Off" -; } - -Template() { +sendStratagem(keyname) { BlockInput "On" - Send "{LControl down}{LControl up}" + ; Send "{LControl down}" . stratagems[getValue("HOTKEYS", keyname)] . "{LControl up}" + Send stratagems[getValue("HOTKEYS", keyname)] BlockInput "Off" } -; Default -Reinforce() { - BlockInput "On" - Send "{LControl down}wsdaw{LControl up}" - BlockInput "Off" +; Config handling +{ + ; Enable numlock, revert previous state on exit + orgNumlockState := GetKeyState("NumLock", "T") + SetNumLockState "AlwaysOn" + + ; Config path + configPath := A_ScriptDir . "\config.ini" + + ; Config file init + if ( not FileExist(configPath)) { + FileAppend("", configPath) + + ; load defaults + initValue("HOTKEYS", "NumpadDiv") + initValue("HOTKEYS", "NumpadMult") + initValue("HOTKEYS", "NumpadSub") + initValue("HOTKEYS", "Numpad7") + initValue("HOTKEYS", "Numpad8") + initValue("HOTKEYS", "Numpad9") + initValue("HOTKEYS", "NumpadAdd") + initValue("HOTKEYS", "Numpad4") + initValue("HOTKEYS", "Numpad5") + initValue("HOTKEYS", "Numpad6") + initValue("HOTKEYS", "Numpad1") + initValue("HOTKEYS", "Numpad2") + initValue("HOTKEYS", "Numpad3") + initValue("HOTKEYS", "NumpadEnter") + initValue("HOTKEYS", "Numpad0") + initValue("HOTKEYS", "NumpadDot") + + FileAppend("`n", configPath) + + for key, value in stratagems { + setValue("STRATAGEMS", key, value) + } + + FileAppend("`n", configPath) + + initValue("WINDOW", "X", 0) + initValue("WINDOW", "Y", 0) + initValue("WINDOW", "AlwaysOnTop", False) + } + + ; Update stratagems sequences + for key, value in stratagems { + setValue("STRATAGEMS", key, value) + } + + ; Config functions + getValue(section, key, default := "") { + return IniRead(configPath, section, key, default) + } + + setValue(section, key, value) { + IniWrite(value, configPath, section, key) + return value + } + + initValue(section, key, default := "Blank") { + return setValue(section, key, getValue(section, key, default)) + } } -SOSBeacon() { - BlockInput "On" - Send "{LControl down}wsdw{LControl up}" - BlockInput "Off" +; Load hotkeys +loop parse, IniRead(configPath, "HOTKEYS"), "`n" { + hotkeyPair := StrSplit(A_LoopField, "=") + + HotIfWinactive("Helldivers™ 2") + Hotkey(hotkeyPair[1], sendStratagem) } -Resupply() { - BlockInput "On" - Send "{LControl down}sswd{LControl up}" - BlockInput "Off" -} +; GUI +{ + MyGui := Gui("-Resize " . getValue("WINDOW", "AlwaysOnTop") . "AlwaysOnTop", "HD2 Stratagems") + MyGui.BackColor := "292929" + MyGui.OnEvent("Close", MyGui_Close) + OnExit(MyGui_Close) -EagleRearm() { - BlockInput "On" - Send "{LControl down}wwawd{LControl up}" - BlockInput "Off" -} + MyGui_Close(*) { + SetNumLockState(orgNumlockState = 0 ? "Off" : "On") -Hellbomb() { - BlockInput "On" - Send "{LControl down}swaswdsw{LControl up}" - BlockInput "Off" -} + MyGui.GetPos(&guiX, &guiY) + setValue("WINDOW", "X", guiX) + setValue("WINDOW", "Y", guiY) + ExitApp(0) + } -SSSDDelivery() { - BlockInput "On" - Send "{LControl down}sssww{LControl up}" - BlockInput "Off" -} + MyGui.Add("Picture", "VAlwaysOnTop X0 Y0 W64 H64", A_ScriptDir . "\Icons\" . "AlwaysOnTop" . ".png").OnEvent("Click", (*) => MyGui.Opt(setValue("WINDOW", "AlwaysOnTop", getValue("WINDOW", "AlwaysOnTop") = "-" ? "+" : "-") . "AlwaysOnTop")) ; AlwaysOnTop -UploadData() { - BlockInput "On" - Send "{LControl down}adwww{LControl up}" - BlockInput "Off" -} + MyGui.Add("Picture", "VNumpadDiv X64 Y0 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "NumpadDiv") . ".png").OnEvent("Click", buttonClick) ; NumpadDiv + MyGui.Add("Picture", "VNumpadMult X128 Y0 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "NumpadMult") . ".png").OnEvent("Click", buttonClick) ; NumpadMult + MyGui.Add("Picture", "VNumpadSub X192 Y0 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "NumpadSub") . ".png").OnEvent("Click", buttonClick) ; NumpadSub -OrbitalIlluminationFlare() { - BlockInput "On" - Send "{LControl down}ddaa{LControl up}" - BlockInput "Off" -} + MyGui.Add("Picture", "VNumpad7 X0 Y64 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "Numpad7") . ".png").OnEvent("Click", buttonClick) ; Numpad7 + MyGui.Add("Picture", "VNumpad8 X64 Y64 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "Numpad8") . ".png").OnEvent("Click", buttonClick) ; Numpad8 + MyGui.Add("Picture", "VNumpad9 X128 Y64 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "Numpad9") . ".png").OnEvent("Click", buttonClick) ; Numpad9 -; Support Weapons -MachineGun() { - BlockInput "On" - Send "{LControl down}saswd{LControl up}" - BlockInput "Off" -} + ; MyGui.Add("Picture", "X192 Y64 W64 H128", A_ScriptDir . "\Icons\Blank.png") ; NumpadAdd background + MyGui.Add("Picture", "VNumpadAdd X192 Y96 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "NumpadAdd") . ".png").OnEvent("Click", buttonClick) ; NumpadAdd -AntiMaterielRifle() { - BlockInput "On" - Send "{LControl down}sadws{LControl up}" - BlockInput "Off" -} + MyGui.Add("Picture", "VNumpad4 X0 Y128 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "Numpad4") . ".png").OnEvent("Click", buttonClick) ; Numpad4 + MyGui.Add("Picture", "VNumpad5 X64 Y128 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "Numpad5") . ".png").OnEvent("Click", buttonClick) ; Numpad5 + MyGui.Add("Picture", "VNumpad6 X128 Y128 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "Numpad6") . ".png").OnEvent("Click", buttonClick) ; Numpad6 -Stalwart() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} + MyGui.Add("Picture", "VNumpad1 X0 Y192 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "Numpad1") . ".png").OnEvent("Click", buttonClick) ; Numpad1 + MyGui.Add("Picture", "VNumpad2 X64 Y192 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "Numpad2") . ".png").OnEvent("Click", buttonClick) ; Numpad2 + MyGui.Add("Picture", "VNumpad3 X128 Y192 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "Numpad3") . ".png").OnEvent("Click", buttonClick) ; Numpad3 -ExpendableAntiTank() { - BlockInput "On" - Send "{LControl down}ssawd{LControl up}" - BlockInput "Off" -} + ; MyGui.Add("Picture", "X192 Y192 W64 H128", A_ScriptDir . "\Icons\Blank.png") ; NumpadEnter background + MyGui.Add("Picture", "VNumpadEnter X192 Y224 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "NumpadEnter") . ".png").OnEvent("Click", buttonClick) ; NumpadEnter -RecoillessRifle() { - BlockInput "On" - Send "{LControl down}sadda{LControl up}" - BlockInput "Off" -} + ; MyGui.Add("Picture", "X0 Y256 W128 H64", A_ScriptDir . "\Icons\Blank.png") ; Numpad0 background + MyGui.Add("Picture", "VNumpad0 X32 Y256 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "Numpad0") . ".png").OnEvent("Click", buttonClick) ; Numpad0 + MyGui.Add("Picture", "VNumpadDot X128 Y256 W64 H64", A_ScriptDir . "\Icons\" . getValue("HOTKEYS", "NumpadDot") . ".png").OnEvent("Click", buttonClick) ; NumpadDot -Flamethrower() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} + buttonClick(GuiCtrlObj, Info) { + stratagemPath := FileSelect(3, A_ScriptDir . "\Icons", "Select stratagem", "Stratagem (*.png)") + if ( not stratagemPath = "") { + stratagem := StrSplit(stratagemPath, "\") + stratagem := StrSplit(stratagem[stratagem.Length], ".")[1] -Autocannon() { - BlockInput "On" - Send "{LControl down}saswwd{LControl up}" - BlockInput "Off" -} + setValue("HOTKEYS", GuiCtrlObj.Name, stratagem) -RailGun() { - BlockInput "On" - Send "{LControl down}sdswad{LControl up}" - BlockInput "Off" -} + GuiCtrlObj.Value := stratagemPath + GuiCtrlObj.Redraw() + } + } -Spear() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -GrenadeLauncher() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -LaserCannon() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -ArcThrower() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -; Support Equipement -JumpPack() { - BlockInput "On" - Send "{LControl down}swwsw{LControl up}" - BlockInput "Off" -} - -SupplyPack() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -GuardDog() { - BlockInput "On" - Send "{LControl down}swawds{LControl up}" - BlockInput "Off" -} - -GuardDogRover() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -BallisticShieldBackpack() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -ShieldGeneratorPack() { - BlockInput "On" - Send "{LControl down}swadad{LControl up}" - BlockInput "Off" -} - -; Orbital Cannons -OrbitalGatlingBarrage() { - BlockInput "On" - Send "{LControl down}dsaww{LControl up}" - BlockInput "Off" -} - -OrbitalAirburstStrike() { - BlockInput "On" - Send "{LControl down}ddd{LControl up}" - BlockInput "Off" -} - -Orbital120MMHEBarrage() { - BlockInput "On" - Send "{LControl down}ddsads{LControl up}" - BlockInput "Off" -} - -Orbital380MMHEBarrage() { - BlockInput "On" - Send "{LControl down}dswwass{LControl up}" - BlockInput "Off" -} - -OrbitalWalkingBarrage() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -OrbitalLaser() { - BlockInput "On" - Send "{LControl down}dswds{LControl up}" - BlockInput "Off" -} - -OrbitalRailcannonStrike() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -OrbitalPrecisionStrike() { - BlockInput "On" - Send "{LControl down}ddw{LControl up}" - BlockInput "Off" -} - -OrbitalGasStrike() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -OrbitalEMSStrike() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -OrbitalSmokeStrike() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -; Eagle Strike -EagleStrafingRun() { - BlockInput "On" - Send "{LControl down}wdd{LControl up}" - BlockInput "Off" -} - -EagleAirstrike() { - BlockInput "On" - Send "{LControl down}wdsd{LControl up}" - BlockInput "Off" -} - -EagleClusterBomb() { - BlockInput "On" - Send "{LControl down}wdssd{LControl up}" - BlockInput "Off" -} - -EagleNapalmAirstrike() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -EagleSmokeStrike() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -Eagle110MMRocketPods() { - BlockInput "On" - Send "{LControl down}wdwa{LControl up}" - BlockInput "Off" -} - -Eagle500KgBomb() { - BlockInput "On" - Send "{LControl down}wdsss{LControl up}" - BlockInput "Off" -} - -; Field Effects -AntiPersonnelMinefield() { - BlockInput "On" - Send "{LControl down}sawd{LControl up}" - BlockInput "Off" -} - -IncendiaryMines() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -HMGEmplacement() { - BlockInput "On" - Send "{LControl down}swadda{LControl up}" - BlockInput "Off" -} - -ShieldGeneratorRelay() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -TeslaTower() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -; Turrets -MachineGunSentry() { - BlockInput "On" - Send "{LControl down}swddw{LControl up}" - BlockInput "Off" -} - -GatlingSentry() { - BlockInput "On" - Send "{LControl down}swda{LControl up}" - BlockInput "Off" -} - -MortarSentry() { - BlockInput "On" - Send "{LControl down}swdds{LControl up}" - BlockInput "Off" -} - -AutocannonSentry() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" -} - -RocketSentry() { - BlockInput "On" - Send "{LControl down}swdda{LControl up}" - BlockInput "Off" -} - -EMSMortarSentry() { - BlockInput "On" - Send "{LControl down}{LControl up}" - BlockInput "Off" + MyGui.Show("X" . getValue("WINDOW", "X") . " Y" . getValue("WINDOW", "Y") . " W256 H320") } \ No newline at end of file