Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: The Ultimative Autohotkey Uniform Macro!  (Read 3256 times)

Couchmonster

  • Bay Watcher
    • View Profile
The Ultimative Autohotkey Uniform Macro!
« on: February 10, 2012, 02:10:23 pm »

Behold!
After a long time of !!Science!! and pain I made myself this epic script to get rid of the annoyence of making the uniforms again on every new fort!
It only activates when you have DF as active window!
Watch it here: http://mkv25.net/dfma/movie-2411-uniformautohotkeyscript

You need this tool: http://www.autohotkey.com/
Copy the code into the Autohotkey.ahk in your "my documents" folder and start autohotkey.exe from anywhere you want.
Or make an .exe-file out of the code :)

Have fun!

Code: [Select]
SetKeyDelay, 0, 1, Play
SendMode Play
WinWaitActive, Dwarf Fortress
SendPlay m ; Military
SendPlay n ; Uniforms
SendPlay c+n+standard{Enter} ; Name Uniform Standard
SendPlay +a ; Armor
SendPlay {Right}{Down}{Enter}{Enter}{Enter} ; Mailshirt x3
SendPlay {Down}{Enter} ; Breastplate x1
SendPlay {Down}{Down}{Down}{Down}{Enter}{Enter}{Enter}{Enter}{Enter}{Enter} ; cloaks x6
SendPlay +l ; Legs
SendPlay {Down}{Enter} ; Greaves x1
SendPlay {Down}{Enter}{Enter} ; Trousers x2
SendPlay +h ; Helm
SendPlay {Enter} ; Helm x1
SendPlay {Down}{Enter}{Enter} ; Cap x2
SendPlay {Down}{Enter}{Enter}{Enter}{Enter}{Enter}{Enter} ; Cloak x6
SendPlay +g ; Gloves
SendPlay {Enter} ; Gauntlets x1
SendPlay {Up}{Enter} ; Mittens x1
SendPlay +b ; Boots
SendPlay {Enter} ; High Boots x1
SendPlay {Down}{Down}{Enter} ; Socks x1
SendPlay +s ; Shields
SendPlay {Enter} ; Shield x1
SendPlay +w ; Weapon
SendPlay {Enter} ; IC Weapon x1
SendPlay +m ; Material
SendPlay {Up}{Enter}{Left}{Down} ; Adamantine Mailshirts
SendPlay {Right}{Up}{Enter}{Left}{Down} ; Adamantine Mailshirts
SendPlay {Right}{Up}{Enter}{Left}{Down} ; Adamantine Mailshirts
SendPlay {Right}{Up}{Enter}{Left}{Down} ; Adamantine Breastplates
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Cloaks
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Cloaks
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Cloaks
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Cloaks
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Cloaks
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Cloaks
SendPlay {Right}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Adamantine Helms
SendPlay {Right}{PgDn}{PgDn}{PgDn}{Down}{Down}{Down}{Enter}{Left}{Down} ; Adamantine Caps
SendPlay {Right}{PgDn}{PgDn}{PgDn}{Down}{Down}{Down}{Enter}{Left}{Down} ; Adamantine Caps
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Hoods
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Hoods
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Hoods
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Hoods
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Hoods
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Hoods
SendPlay {Right}{Up}{Enter}{Left}{Down} ; Adamantine Greaves
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Trousers
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Trousers
SendPlay {Right}{Up}{Enter}{Left}{Down} ; Adamantine Gauntlets
SendPlay {Right}{Down}{Down}{Down}{Down}{Enter}{Left}{Down} ; Leather Mittens
SendPlay {Right}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Down}{Enter}{Left}{Down}{Down} ; Adamantine High Boots
SendPlay {Right}{Up}{Enter} ; Adamantine Shields
; Made by Couchmonster
« Last Edit: February 15, 2012, 04:31:29 pm by Couchmonster »
Logged

Gergination

  • Bay Watcher
  • The world is on fire
    • View Profile
Re: The Ultimative Autohotkey Uniform Macro!
« Reply #1 on: February 10, 2012, 02:42:48 pm »

Autohotkey is great for Dwarf Fortress.  I have a super simple script for trading that just presses down and enter as long as I'm holding down F1.  It makes trading all those bins of worthless trinkets a breeze.
Logged
With [SLOW_LEARNER], dwarves probably don't sit around and talk anymore. They just stand in the same corner altogether, staring at each other, sticking their bearded lips out trying to make sounds. And giggling when someone actually says a whole word.

Maklak

  • Bay Watcher
    • View Profile
Re: The Ultimative Autohotkey Uniform Macro!
« Reply #2 on: February 10, 2012, 03:27:58 pm »

Individual Choice melee is AFAIK bugged, and they will pick the most expensive weapon, regardless of what skills they have. It is better to assign weapons individually, or have multiple uniforms with different weapons.

I agree with specifying cloaks and hoods as leather, but adamantine is so expensive, that they will choose it automatically. Steel is expensive too, co they'll choose that over copper, and other stuff. I think if you tell them specifically to wear adamatine they won't touch all this copper armor lying around, and don't use armor until you get blue stuff. I prefer them to pick what i have, and upgrade it as new items become available.
Logged
Quote from: Omnicega
Since you seem to criticize most things harsher than concentrated acid, I'll take that as a compliment.
On mining Organics
Military guide for FoE mod.
Research: Crossbow with axe and shield.
Dropbox referral

Couchmonster

  • Bay Watcher
    • View Profile
Re: The Ultimative Autohotkey Uniform Macro!
« Reply #3 on: February 10, 2012, 06:23:40 pm »

I had no problems with chosing of armor so far.
I also melt away all bad armor, so they have no choice but to pick better ones.
Plus the script can be easily adapted to your needs.

Couchmonster

  • Bay Watcher
    • View Profile
Re: The Ultimative Autohotkey Uniform Macro!
« Reply #4 on: February 15, 2012, 04:31:49 pm »

Updated for the new version :)