A Python based macro script for HELLDIVERS 2
You can assign Stratagem macros to keybinds.
Caution
I am not responsible for any bans or data loss as a result of using this. This was a project for me to learn Python. If you are worried about getting banned, don't use it and be a legitimate player :)
- Linux. This is not supported on Windows or MacOS though it may in the future.
- X11. This is not supported on Wayland.
- Sudo. This requires access to
/dev
. - Python packages:
evdev pyyaml
- You can get the package in my flake repository.
- Clone the repo
- Run
sudo python3 __main__.py
- Edit the generated config file in your
~/.config/hd2pystratmacro/config.yaml
. You can also supply a config file with-f <path to config.yaml
. Please read the configuration below, you need to configure the file to enable functionality.
- Arguments can be found by tacking
-h
or--help
- Arguments can be found by tacking
When running, hold ctrl and press your keybind to activate the macro.
main:
(stratagem): "KEY_*"
main:
reload: "KEY_P"
reinforce: "KEY_Y"
- You can define any Stratagems without duplicates.
reload
: Hot-reload the configuration file to change keybind without restarting the script
reinforce
: Reinforceresupply
: Resupplysos
: SOS Beaconhellbomb
: Hellbombflare
: Orbital Illumination Flareflag
: Super Earth Flagseaf
: SEAF Artillery
machine
: Machine Gunantimaterial
: Anti-Material Riflestalwart
: Stalwartexpendable
: Expendable Anti-Tankrecoilless
: Recoilless Rifleflamethrower
: Flamethrowerautocannon
: Autocannonrailgun
: Railgunspear
: Spear
orbital_gatling
: Orbital Gatling Strikeorbital_airburst
: Orbital Airburst Strikeorbital_120mm
: Orbital 120MM HE Barrageorbital_380mm
: Orbital 380MM HE Barrageorbital_walking
: Orbital Walking Barrageorbital_laser
: Orbital Laserorbital_railcannon
: Orbital Railcannon Strike
eagle_rearm
: Eagle Rearmeagle_strafing
: Eagle Strafing Runeagle_airstrike
: Eagle Airstrikeeagle_cluster
: Eagle Cluster Bombeagle_napalm
: Eagle Napalm Airstrikejump_pack
: Jump Packeagle_smoke
: Eagle Smoke Strikeeagle_110mm
: Eagle 110MM Rocket Podseagle_500kg
: Eagle 500KG Bomb
orbital_precision
: Orbital Precision Strikeorbital_gas
: Orbital Gas Strikeorbital_ems
: Orbital EMS Strikeorbital_smoke
: Orbital Smoke Strikehmg_placement
: HMG Placementshield_relay
: Shield Generator Relaytesla_tower
: Tesla Tower
minefield
: Anti-Personnel Minefieldsupply_pack
: Supply Packgrenade_launcher
: Grenade Launcherlaser_cannon
: Laser Cannonincendiary_mines
: Incendiary Minesguard_dog_rover
: Guard Dog Roverballistic_shield
: Ballistic Shield Backpackarc_thrower
: Arc Throwershield_generator
: Shield Generator Pack
machine_sentry
: Machine Gun Sentrygatling_sentry
: Gatling Sentrymortar_sentry
: Mortar Sentryguard_dog
: Guard Dogautocannon_sentry
: Autocannon Sentryrocket_sentry
: Rocket Sentryems_sentry
: EMS Mortar Sentry
You can have other sets of keybinds but the script currently only reads from main
. Definable sets will be implemented in the future.