v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Editing 40d:Macros and keymaps

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.

You are editing a page for an older version of Dwarf Fortress ("Main" is the current version, not "40d"). Please make sure you intend to do this. If you are here by mistake, see the current page instead.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{Quality|Superior|11:05, 18 May 2015 (UTC)}}
+
Playing Dwarf Fortress means lots of typing.  Although the game (as of version v0.27.176.38c) has no internal macro/keymap system, using an external program can save you a great deal of time when dumping, rewalling, designating, and so forth.
{{av}}
 
Playing Dwarf Fortress means lots of typing.  Although the game has no internal macro/keymap system (except in alpha version 40d12), using an external program can save you a great deal of time when dumping, rewalling, designating, and so forth.
 
  
 
#  Go to [[Utilities#AutoHotKey]] and download AutoHotKey.  Installation is simple and the program uses few system resources.
 
#  Go to [[Utilities#AutoHotKey]] and download AutoHotKey.  Installation is simple and the program uses few system resources.
 
#  Write macro scripts (file type .ahk), which may contain any number of commands.  You activate scripts by double-clicking .ahk files and deactivate them by right-clicking the AutoHotKey icon on the task bar.  Both of these can be done at any time - even right in the middle of a game.  AutoHotKey also allows for automated activation of scripts.
 
#  Write macro scripts (file type .ahk), which may contain any number of commands.  You activate scripts by double-clicking .ahk files and deactivate them by right-clicking the AutoHotKey icon on the task bar.  Both of these can be done at any time - even right in the middle of a game.  AutoHotKey also allows for automated activation of scripts.
  
 
==Troubleshooting Scripts==
 
Users may experience some issues in getting scripts to work, particularly when using looping scripts when experiencing low frame-rates.
 
* If experiencing low frame-rates, try adding delays ("Sleep 100" to pause for 100 milliseconds for example) within loops to allow the interface to keep up. If there are nested loops, sometimes adding a pause at the end of an inner loop is all that is needed to flush the keyboard buffer
 
* Another way to add delay during and after each simulated key press is to put <B>SetKeyDelay, 40, 40</B> at the start of the macro.
 
* Make sure that Dwarf Fortress maintains focus. IM windows are the enemy! Who needs friends anyhow? You've got Dwarf Fortress.
 
* This may go without saying, but most macros assume standard key-mappings. If you're using non-standard ones, you may have to edit the macro to get it to work.
 
* Visiting liaisons can bring up screens that eat keystrokes, throwing a long-looping script out-of-phase with where it expects the game to be.  Wait for the farewell screen before running a long script.
 
* The <B>SendPlay</B> function supports keys that the <B>Send</B> function does not, for example {{key|Shift-Enter}}.  According to the AutoHotKey documentation, <B>SendPlay</B> may also be better at preventing dropped keystrokes.
 
 
== [http://sun2design.com/quickfort/ Quickfort] ==
 
 
Quickfort is an AutoHotkey-based utility for Dwarf Fortress that helps you build fortresses from "blueprint" .CSV files (comma separated values). These files are easily created and edited in an app like Excel. Most building-oriented DF commands are supported through the use of multiple .CSV files to describe the different phases of DF construction (designation, building, stockpiles, and making adjustments). Many of the examples below can be reproduced in Quickfort.
 
 
 
== Built-in Macros ==
 
 
With the release of df_28_181_40d13, Dwarf Fortress supports macros without any outside program. They can be created by hitting escape to access the options menu and choosing the Key Bindings section. Once in the Key Bindings menu hit Shift+Tab to open the macro screen. The macros you create here are saved in the file "\data\init\interface.txt". Adding the following to the end of that file will create a macro that selects every item on the trade screen when you hit the tilde key (`).
 
 
<pre>
 
[BIND:MACRO0]
 
[SYM:`]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
[MACRO:SELECT:1]
 
[MACRO:STANDARDSCROLL_DOWN:1]
 
</pre>
 
 
Performance can be increased by changing the macro pause, MACRO_MS, from the default 150ms per command to zero.  Most dig macros can be created using combinations of the following:
 
<pre>
 
[MACRO:CURSOR_UP:1]
 
[MACRO:CURSOR_DOWN:1]
 
[MACRO:CURSOR_LEFT:1]
 
[MACRO:CURSOR_RIGHT:1]
 
[MACRO:SELECT:1]
 
[MACRO:DESIGNATE_DIG:1]
 
[MACRO:DESIGNATE_UNDO:1]
 
[MACRO:CURSOR_UP_FAST:1]
 
[MACRO:CURSOR_DOWN_FAST:1]
 
[MACRO:CURSOR_LEFT_FAST:1]
 
[MACRO:CURSOR_RIGHT_FAST:1]
 
[MACRO:MACRO123:1]
 
</pre>
 
Most of these should be self-explanatory. Each command is followed with a quantity.  To call other macros, use <pre>[MACRO:MACRO###:1]</pre> Each new macro begins with a bind command, consisting of BIND, the macro number, and a description:
 
<pre>[BIND:MACRO11:dig_round_room]</pre>  Spaces are not allowed in the description{{verify}}.  To bind this macro to a key, SYM is used.<pre>[SYM:Ctrl+Right]</pre> Ctrl, Alt, and Shift combinations are allowed, but not chords with more than one{{verify}}, like Ctrl+Shift+Right.  Also, the windows, or meta key, does not appear to be supported{{verify}}. Macros appear to only be terminated by the start of a new macro (BIND command) or the end of the interface.txt file.
 
 
Visit this [http://www.bay12games.com/forum/index.php?topic=40751.0 forum post] for additional macros, and discussion on macro creation.
 
  
 
== AutoHotKey Examples ==
 
== AutoHotKey Examples ==
  
 
===Dumping===
 
===Dumping===
 
====[[GuiDumper.ahk]]====
 
This script allows the user to specify a range of squares to dump.
 
 
 
====Stock Screen Dump====
 
====Stock Screen Dump====
 
Taken from an old version of [[User:Jackard|Jackard's user page]].
 
Taken from an old version of [[User:Jackard|Jackard's user page]].
  
To use, first have your bookkeeper do enough desk work so you can view individual items in the stocks listing.  Then bring it up and press del to quickly mark stuff.  To adjust the key repeat rate, edit the KEY_HOLD_MS value in \data\init\init.txt.
+
To use, first have your bookeeper do enough desk work so you can view individual items in the stocks listing.  Then bring it up and press del to quickly mark stuff.  To adjust the key repeat rate, edit the KEY_HOLD_MS value in \data\init\init.txt.
  
 
<pre>
 
<pre>
Line 107: Line 32:
 
This script uses a system similar the commands in the designations menu to mark most of the contents of a large area for dumping. [[User:Dukederek|My talk page]] has more detailed instruction.
 
This script uses a system similar the commands in the designations menu to mark most of the contents of a large area for dumping. [[User:Dukederek|My talk page]] has more detailed instruction.
  
Essentially you need to create two text files with the following titles and content. When playing DF it is safe to have blockdumpinit running constantly as long as you don't plan on using the ctrl-d combination for something else.
+
Essentially you need to create two text files with the following titles and content. When playing DF it is safe to have blockdumpinit running constantly as long as you dont plan on using the ctrl-d combination for something else.
  
 
'''blockdumpinit.ahk'''
 
'''blockdumpinit.ahk'''
Line 286: Line 211:
 
===Embark Settings macros===
 
===Embark Settings macros===
 
These macros are used to ease the setup of skills and supplies before you embark.
 
These macros are used to ease the setup of skills and supplies before you embark.
 +
====Food-buying macro====
 +
This macro buys all the 2 cost meat items available at the start screen. Simply go to the item screen, erase the random food items the game starts you with, and press F2. By [[User:Napsterbater|Napsterbater]].
  
 +
<pre>
 +
F2::
 +
  send {n}{Right}{Down}{Enter}
 +
  send {n}{Right}{Down}{Enter}
 +
  send {n}{Right}{Down}{Enter}
 +
  send {n}{Right}{Down}{Enter}
 +
  send {n}{Right}{Down}{Enter}
 +
  send {n}{Right}{Down}{Down}{Down}{Enter}
 +
  send {n}{Right}{Down}{Down}{Down}{Enter}
 +
  send {n}{Right}{Down}{Down}{Down}{Down}{Enter}
 +
  send {n}{Right}{Pgdn}{Enter}
 +
  send {n}{Right}{Pgdn}{Enter}
 +
  send {n}{Right}{Pgdn}{Down}{Down}{Down}{Enter}
 +
  send {n}{Right}{Pgdn}{Down}{Down}{Down}{Enter}
 +
  send {n}{Right}{Pgdn}{Down}{Down}{Down}{Enter}
 +
  send {n}{Right}{Pgdn}{Down}{Down}{Down}{Down}{Enter}
 +
  send {n}{Right}{Pgdn}{Down}{Down}{Down}{Down}{Enter}
 +
  send {n}{Right}{Up}{Up}{Up}{Up}{Up}{Enter}
 +
  send {n}{Right}{Up}{Up}{Up}{Up}{Up}{Enter}
 +
  send {n}{Right}{Up}{Up}{Up}{Up}{Up}{Enter}
 +
return
 +
</pre>
 +
 +
Useless, becuse the types of meat you can take with you varies with each world/civ. It will work with the civ you wrote it for, but not for the overwhelming majority of others--[[User:Dorten|Dorten]] 05:08, 2 April 2008 (EDT)
 +
 +
Just realized this. Whoops - Napsterbater
 +
 +
I'll go ahead and delete this soon.
  
 
====Improved Food/Alcohol buying macro====
 
====Improved Food/Alcohol buying macro====
Line 349: Line 304:
  
 
SetKeyDelay, 12 ;Key delay, to keep Dwarf Fortress from being overwhelmed.
 
SetKeyDelay, 12 ;Key delay, to keep Dwarf Fortress from being overwhelmed.
;Set higher if you get weird results, or lower to get the
+
:Set higher if you get weird results, or lower to get the
;script to run faster
+
:script to run faster
 
SLEEPTIME = 12 ;same thing, only used in the repeated key press loops though
 
SLEEPTIME = 12 ;same thing, only used in the repeated key press loops though
  
Line 792: Line 747:
  
 
===Bed Assigning macro===
 
===Bed Assigning macro===
This will assign bedrooms to your dwarves. Press F3 followed by a single digit indicating how many beds to assign. Can repeat the action, as the number of beds assigned is stored in a counter. Room size is default, but easily edited into the script. By [[User:Napsterbater|Napsterbater]].
+
This will assign bedrooms to your dwarfs. Press F3 followed by a single digit indicating how many beds to assign. Can repeat the action, as the number of beds assigned is stored in a counter. Room size is default, but easily edited into the script. By [[User:Napsterbater|Napsterbater]].
  
 
<pre>
 
<pre>
Line 819: Line 774:
  
 
====Valdemar's Designator Macro====
 
====Valdemar's Designator Macro====
This macro can read a spreadsheet and designate rooms according to it. [http://www.bay12games.com/forum/index.php?topic=1428.0 Version 1]
+
This macro can read a spreadsheet and designate rooms according to it. [http://www.bay12games.com/cgi-local/ultimatebb.cgi?ubb=get_topic&f=2&t=001507 Forum Thread/Download]
 
 
Version 2 of this macro apparently only works in versions up to and including 38c {{verify}}, and can be found here: [http://www.bay12games.com/forum/index.php?topic=1890.0 Version 2]
 
  
 
====Fedor's chambered circle====
 
====Fedor's chambered circle====
Line 924: Line 877:
 
</pre>
 
</pre>
  
====LordGrunt's room macro====
+
===Easy Exploration Mining in 2 steps===
Based on 1 of the fractal [[Bedroom_design|bedroom designs.]]
+
This macro will make a 5 row, 11 column UP/DOWN stairway grid (2 empty spaces between each row/column).<br>
 
+
Starting point as indicated (row 3, column 11)<br>
[http://mkv25.net/dfma/movie-1226-fractalbedrooms Demo Movie]
+
'''MUST BE IN DESIGNATION MODE WITH CURSOR AT THE ''<-- START HERE'' LOCATION'''<br>
 
+
Link is <ctrl> <windowskey> `<br>
 +
Dive is <ctrl> <alt> `<br>
 
<pre>
 
<pre>
;
+
Link
; Fractal Apts
+
X--X--X--X--X--X--X--X--X--X--X
; Start script while in 'dig' mode with cursor on desired position of left up staircase
+
|              |              |
;
+
|              |              |
; ALT+G to generate,
+
X--X--X--X--X--X--X--X--X--X--X
; CTRL+ALT+G to erase in case of failure
+
|              |              |
;
+
|              |              |
   
+
X--X--X--X--X--X--X--X--X--X--X <-- start here
!g::
+
|              |              |
base_cross()
+
|              |              |
sleep 100
+
X--X--X--X--X--X--X--X--X--X--X
mid_sqr()
+
|              |              |
sleep 100
+
|              |              |
corridors()
+
X--X--X--X--X--X--X--X--X--X--X
sleep 100
+
</pre>
all_rooms()
+
Filename is ExploreMine-Link.ahk
return
+
<pre>
 
+
;Link
base_cross()
+
^#`::
{
 
Send i{ENTER}3{ENTER}
 
Send d1{ENTER}6{SHIFT}+2{SHIFT}+2{SHIFT}+2{SHIFT}+28{ENTER}
 
Send d{SHIFT}+8{SHIFT}+8{SHIFT}+8{SHIFT}+888{ENTER}4{SHIFT}+8{SHIFT}+8{SHIFT}+8{SHIFT}+82{ENTER}
 
Send d{SHIFT}+2{SHIFT}+2{SHIFT}+2{SHIFT}+24{ENTER}2{SHIFT}+4{SHIFT}+4{SHIFT}+4{SHIFT}+46{ENTER}
 
Send d{SHIFT}+6{SHIFT}+6{SHIFT}+6{SHIFT}+666{ENTER}8{SHIFT}+6{SHIFT}+6{SHIFT}+6{SHIFT}+64{ENTER}
 
Send d{SHIFT}+4{SHIFT}+4{SHIFT}+4{SHIFT}+4474{SHIFT}+8{SHIFT}+888888{ENTER}66666{SHIFT}+2{SHIFT}+2{SHIFT}+2{SHIFT}+2{SHIFT}+2222{ENTER}8
 
Send d{SHIFT}+8{SHIFT}+88884488888{SHIFT}+6{SHIFT}+6666666{ENTER}22222{SHIFT}+4{SHIFT}+4{SHIFT}+4{SHIFT}+4{SHIFT}+4444{ENTER}6
 
}
 
mid_sqr()
 
{
 
Send d{SHIFT}+3666
 
send d{ENTER}{SHIFT}+9{SHIFT}+999999{ENTER}1{ENTER}9999{ENTER}9{ENTER}111{ENTER}
 
send d{SHIFT}+1{SHIFT}+1{SHIFT}+1{ENTER}999{ENTER}99{ENTER}1111{ENTER}99
 
send d{SHIFT}+8{SHIFT}+8{SHIFT}+8444{ENTER}333{ENTER}33{ENTER}7777{ENTER}
 
send d{SHIFT}+3{SHIFT}+3{SHIFT}+37{ENTER}333{ENTER}7{ENTER}7777{ENTER}
 
}
 
corridors()
 
{
 
send d{SHIFT}+7{SHIFT}+7{SHIFT}+7999{ENTER}{SHIFT}+6{SHIFT}+6{SHIFT}+66{ENTER}
 
send d333333{ENTER}{SHIFT}+2{SHIFT}+2{SHIFT}+22{ENTER}
 
send d111111{ENTER}{SHIFT}+4{SHIFT}+4{SHIFT}+44{ENTER}
 
send d777777{ENTER}{SHIFT}+8{SHIFT}+8{SHIFT}+88{ENTER}
 
sleep 100
 
send d3333222{ENTER}{SHIFT}+466{ENTER}
 
send d{SHIFT}+2{SHIFT}+2888{ENTER}{SHIFT}+644{ENTER}
 
send d{SHIFT}+9{SHIFT}+9{SHIFT}+6{SHIFT}+6333
 
send d{ENTER}{SHIFT}+466{ENTER}
 
send d{SHIFT}+2{SHIFT}+2888{ENTER}{SHIFT}+644{ENTER}
 
sleep 100
 
send d{SHIFT}+4{SHIFT}+1966
 
send d{ENTER}{SHIFT}+288{ENTER}
 
send d{SHIFT}+4{SHIFT}+4666{ENTER}{SHIFT}+822{ENTER}
 
sleep 100
 
send d{SHIFT}+9{SHIFT}+9{SHIFT}+8{SHIFT}+8777
 
send d{ENTER}{SHIFT}+288{ENTER}
 
send d{SHIFT}+4{SHIFT}+4666{ENTER}{SHIFT}+822{ENTER}
 
sleep 100
 
send d999988{ENTER}{SHIFT}+64{ENTER}
 
send d{SHIFT}+3{SHIFT}+3{SHIFT}+3777{ENTER}{SHIFT}+28{ENTER}
 
send d{SHIFT}+1{SHIFT}+1{SHIFT}+1999{ENTER}{SHIFT}+46{ENTER}
 
send d{SHIFT}+7{SHIFT}+7{SHIFT}+7333{ENTER}{SHIFT}+82{ENTER}
 
}
 
  
rooms_up()
+
send d
{
+
send {Enter}
send d78{ENTER}96{ENTER}
+
tehLoop(30,"{NumPadLeft}")
send d223{ENTER}32{ENTER}
+
send {Enter}
send d44444{ENTER}87{ENTER}
+
send {Enter}
send d63{ENTER}{ENTER}98{ENTER}{ENTER}23{ENTER}{ENTER}7
+
tehLoop(6,"{NumPadUp}")
}
+
send {Enter}
rooms_down()
+
send {Enter}
{
+
tehLoop(30,"{NumPadRight}")
send d32{ENTER}14{ENTER}
+
send {Enter}
send d887{ENTER}78{ENTER}
+
send {Enter}
send d66666{ENTER}32{ENTER}
+
tehLoop(12,"{NumPadDown}")
send d74{ENTER}{ENTER}21{ENTER}{ENTER}78{ENTER}{ENTER}3
+
send {Enter}
}
+
send {Enter}
rooms_left()
+
tehLoop(30,"{NumPadLeft}")
{
+
send {Enter}
send d14{ENTER}87{ENTER}
+
send {Enter}
send d996{ENTER}63{ENTER}
+
tehLoop(9,"{NumPadUp}")
send d2222{ENTER}41{ENTER}
+
send {Enter}
send d98{ENTER}{ENTER}47{ENTER}{ENTER}96{ENTER}{ENTER}1
+
send {Enter}
}
+
tehLoop(30,"{NumPadRight}")
rooms_right()
+
send {Enter}
{
+
tehLoop(6,"{NumPadDown}")
send d96{ENTER}32{ENTER}
+
send {Enter}
send d114{ENTER}47{ENTER}
+
tehLoop(30,"{NumPadLeft}")
send d8888{ENTER}96{ENTER}
+
send {Enter}
send d21{ENTER}{ENTER}63{ENTER}{ENTER}14{ENTER}{ENTER}9
+
tehLoop(3,"{NumPadDown}")
}
+
tehLoop(15,"{NumPadRight}")
;======= WIDE
+
send {Enter}
rooms_upw()
+
tehLoop(12,"{NumPadUp}")
{
+
send {Enter}
send d78{ENTER}966{ENTER}
+
tehLoop(15,"{NumPadLeft}")
send d223{ENTER}32{ENTER}
 
send d444444{ENTER}87{ENTER}
 
send d63{ENTER}{ENTER}98{ENTER}6{ENTER}23{ENTER}{ENTER}74
 
}
 
rooms_downw()
 
{
 
send d32{ENTER}144{ENTER}
 
send d887{ENTER}78{ENTER}
 
send d666666{ENTER}32{ENTER}
 
send d74{ENTER}{ENTER}21{ENTER}4{ENTER}78{ENTER}{ENTER}36
 
}
 
rooms_leftw()
 
{
 
send d14{ENTER}887{ENTER}
 
send d996{ENTER}63{ENTER}
 
send d22222{ENTER}41{ENTER}
 
send d98{ENTER}{ENTER}47{ENTER}8{ENTER}96{ENTER}{ENTER}12
 
}
 
rooms_rightw()
 
{
 
send d96{ENTER}322{ENTER}
 
send d114{ENTER}47{ENTER}
 
send d88888{ENTER}96{ENTER}
 
send d21{ENTER}{ENTER}63{ENTER}2{ENTER}14{ENTER}{ENTER}98
 
}
 
;============
 
rooms3up()
 
{
 
send d8888888
 
rooms_up()
 
send d1111222
 
rooms_left()
 
send d66666666
 
rooms_right()
 
send d4444
 
}
 
rooms3down()
 
{
 
send d2222222
 
rooms_down()
 
send d7777888
 
rooms_left()
 
send d66666666
 
rooms_right()
 
send d4444
 
}
 
rooms3left()
 
{
 
send d4444444
 
rooms_left()
 
send d9999666
 
rooms_up()
 
send d22222222
 
rooms_down()
 
send d8888
 
}
 
rooms3right()
 
{
 
send d6666666
 
rooms_right()
 
send d7777444
 
rooms_up()
 
send d22222222
 
rooms_down()
 
send d8888
 
}
 
  
;==========
+
send i
all_rooms()
+
send {Enter}{Enter}
{
+
tehOtherLoop("{NumPadDown}")
;left wide:
+
tehLoop(3,"{NumPadRight}")
rooms_up()
+
send {Enter}{Enter}
send d222222222
+
tehOtherLoop("{NumPadUp}")
rooms_down()
+
tehLoop(3,"{NumPadRight}")
send d7777444
 
rooms_leftw()
 
;bottom wide:
 
send d{SHIFT}+3{SHIFT}+3{SHIFT}+3{SHIFT}+378
 
rooms_downw()
 
send d9999888
 
rooms_right()
 
send d444444444
 
rooms_left()
 
;right wide:
 
send d{SHIFT}+9{SHIFT}+9{SHIFT}+999{SHIFT}+66
 
rooms_rightw()
 
send d7777444
 
rooms_up()
 
send d222222222
 
rooms_down()
 
;top wide
 
send d{SHIFT}+7{SHIFT}+7{SHIFT}+777{SHIFT}+88
 
rooms_upw()
 
send d1111222
 
rooms_left()
 
send d666666666
 
rooms_right()
 
;remainin 9-room chambers
 
send d{SHIFT}+26666
 
rooms3right()
 
send d{SHIFT}+4{SHIFT}+4666
 
rooms3left()
 
send d{SHIFT}+1111
 
rooms3up()
 
send d{SHIFT}+2{SHIFT}+2888
 
rooms3down()
 
send d{SHIFT}+3333
 
rooms3left()
 
send d{SHIFT}+6{SHIFT}+6444
 
rooms3right()
 
send d{SHIFT}+9999
 
rooms3down()
 
send d{SHIFT}+8{SHIFT}+8222
 
rooms3up()
 
;send d{SHIFT}+7777
 
;rooms3right()
 
;send d{SHIFT}+2{SHIFT}+4666
 
;rooms3left()
 
send d1111144499{ENTER}{SHIFT}+1{SHIFT}+4{SHIFT}+41{ENTER}
 
send d77444444444{ENTER}8888888{SHIFT}+6{SHIFT}+6{SHIFT}+6{SHIFT}+6{SHIFT}+6666{ENTER}
 
send d{SHIFT}+7{SHIFT}+487{ENTER}{SHIFT}+1{SHIFT}+2{SHIFT}+21{ENTER}
 
send d33222222222{ENTER}6666666{SHIFT}+8{SHIFT}+8{SHIFT}+8{SHIFT}+8{SHIFT}+8888{ENTER}
 
send d{SHIFT}+2{SHIFT}+2221111
 
send i{ENTER}3{ENTER}7
 
deco()
 
}
 
 
 
deco()
 
{
 
send x77774{ENTER}{ENTER}9{ENTER}{ENTER}6669{ENTER}6{ENTER}3666{ENTER}{ENTER}3{ENTER}{ENTER}
 
send x2223{ENTER}2{ENTER}1222{ENTER}{ENTER}1{ENTER}{ENTER}1444{ENTER}4{ENTER}4447
 
send x{ENTER}{ENTER}7{ENTER}{ENTER}7888{ENTER}8{ENTER}666666
 
}
 
  
; CTRL+ALT+G to erase all
+
send {Enter}{Enter}
!^g::
+
tehOtherLoop("{NumPadDown}")
send x{SHIFT}+1{SHIFT}+1{SHIFT}+1{SHIFT}+1{SHIFT}+1{ENTER}{SHIFT}+9{SHIFT}+9{SHIFT}+9{SHIFT}+9{SHIFT}+9{SHIFT}+9{SHIFT}+9{SHIFT}+9{SHIFT}+9{SHIFT}+9{ENTER}{SHIFT}+1{SHIFT}+1{SHIFT}+1{SHIFT}+1{SHIFT}+1
+
tehLoop(3,"{NumPadRight}")
return
+
send {Enter}{Enter}
</pre>
+
tehOtherLoop("{NumPadUp}")
 +
tehLoop(3,"{NumPadRight}")
  
====Pyrofyr's room macro====
+
send {Enter}{Enter}
Based on Palin88's Apartment design based on Raynard's Fractal Design.
+
tehOtherLoop("{NumPadDown}")
 +
tehLoop(3,"{NumPadRight}")
 +
send {Enter}{Enter}
 +
tehOtherLoop("{NumPadUp}")
 +
tehLoop(3,"{NumPadRight}")
  
[[File:Pyrofor_room_macro.png]]
+
send {Enter}{Enter}
 
+
tehOtherLoop("{NumPadDown}")
<pre>
+
tehLoop(3,"{NumPadRight}")
/*
+
send {Enter}{Enter}
* Macro by Pyrofyr for Room Design -- Cleaned up by 0x517A5D
+
tehOtherLoop("{NumPadUp}")
* Enter (d)esignate mode, position the cursor where you want the
+
tehLoop(3,"{NumPadRight}")
* middle of the design to be, then press Ctrl+Alt+D to start the Macro.
 
*/
 
  
;Attn Pyrofor: for slash-star style comments, the ending star-slash must
+
send {Enter}{Enter}
;be the first thing on its line.  Otherwise the comment isn't terminated.
+
tehOtherLoop("{NumPadDown}")
 +
tehLoop(3,"{NumPadRight}")
 +
send {Enter}{Enter}
 +
tehOtherLoop("{NumPadUp}")
 +
tehLoop(3,"{NumPadRight}")
  
#SingleInstance Force
+
send {Enter}{Enter}
#IfWinActive, Dwarf Fortress
+
tehOtherLoop("{NumPadDown}")
SetKeyDelay 0,, Play
+
tehLoop(6,"{NumPadUp}")
  
; Ctrl+Alt+D
 
^!d::
 
send d{NumPadUp 18}{NumPadLeft 18}
 
;Attn Pyrofor: note how repeated keystrokes are done in AHK.
 
;no need for tehLoop().
 
directions()
 
send {NumPadRight 18}
 
directions()
 
send {NumPadLeft 18}
 
send {NumPadDown 18}
 
directions()
 
send {NumPadRight 18}
 
directions()
 
middle()
 
stairs()
 
return
 
  
directions()
+
tehLoop(tehTimes,tehDir)
 
{
 
{
    ;hallway box
+
loop
    send {Enter}{NumPadRight 18}{Enter}
+
{
    send {Enter}{NumPadDown 18}{Enter}
+
if tehTimes <= 0
    send {Enter}{NumPadLeft 18}{Enter}
+
{
    send {Enter}{NumPadUp 18}{Enter}
+
break
    ;indentations on box
+
}
    send {Enter}{NumPadRight 1}{NumPadDown 2}{Enter}
+
send %tehDir%
    send {NumPadDown 6}{Enter}{NumPadDown 2}{NumPadRight 1}{Enter}
+
tehTimes--
    send {NumPadLeft 1}{NumPadDown 6}{Enter}{NumPadDown 1}{Enter}
+
}
    send {NumPadRight 6}{Enter}{NumPadRight 4}{Enter}
 
    send {NumPadRight 6}{Enter}{NumPadUp 1}{Enter}
 
    send {NumPadUp 6}{Enter}{NumPadUp 2}{NumPadLeft 1}{Enter}
 
    send {NumPadRight 1}{NumPadUp 6}{Enter}{NumPadUp 1}{Enter}
 
    send {NumPadLeft 6}{Enter}{NumPadLeft 4}{Enter}
 
    ; middle hallways
 
    send {NumPadRight 2}{Enter}{NumPadDown 6}{Enter}
 
    send {NumPadRight 1}{Enter}{NumPadDown 4}{NumPadLeft 2}{Enter}
 
    send {NumPadRight 1}{Enter}{NumPadDown 6}{Enter}
 
    send {NumPadUp 8}{NumPadLeft 6}{Enter}{NumPadRight 14}{Enter}
 
    ; cross apartments, horizontal segments
 
    send {NumPadDown 4}{Enter}{NumPadLeft 2}{Enter}
 
    send {NumPadDown 1}{NumPadLeft 3}{Enter}{NumPadLeft 6}{Enter}
 
    send {NumPadUp 1}{NumPadLeft 3}{Enter}{NumPadLeft 2}{Enter}
 
    send {NumPadDown 3}{NumPadRight 2}{Enter}{NumPadRight 2}{Enter}
 
    send {NumPadRight 8}{Enter}{NumPadRight 2}{Enter}
 
    send {NumPadUp 5}{NumPadLeft 1}{Enter}{NumPadLeft 2}{Enter}
 
    send {NumPadLeft 6}{Enter}{NumPadLeft 2}{Enter}
 
    send {NumPadUp 4}{Enter}{NumPadRight 2}{Enter}
 
    send {NumPadRight 6}{Enter}{NumPadRight 2}{Enter}
 
    send {NumPadRight 3}{NumPadUp 2}{Enter}{NumPadLeft 2}{Enter}
 
    send {NumPadUp 1}{NumPadLeft 3}{Enter}{NumPadLeft 6}{Enter}
 
    send {NumPadDown 1}{NumPadLeft 3}{Enter}{NumPadLeft 2}{Enter}
 
    send {NumPadUp 3}{NumPadRight 2}{Enter}{NumPadRight 2}{Enter}
 
    send {NumPadRight 8}{Enter}{NumPadRight 2}{Enter}
 
    ; cross apartments, vertical segments
 
    send {NumPadRight 1}{NumPadDown 2}{Enter}{NumPadDown 2}{Enter}
 
    send {NumPadDown 6}{Enter}{NumPadDown 2}{Enter}
 
    send {NumPadDown 3}{NumPadLeft 2}{Enter}{NumPadUp 2}{Enter}
 
    send {NumPadLeft 1}{NumPadUp 3}{Enter}{NumPadUp 6}{Enter}
 
    send {NumPadRight 1}{NumPadUp 3}{Enter}{NumPadUp 2}{Enter}
 
    send {NumPadLeft 3}{NumPadDown 2}{Enter}{NumPadDown 2}{Enter}
 
    send {NumPadDown 8}{Enter}{NumPadDown 2}{Enter}
 
    send {NumPadLeft 4}{Enter}{NumPadUp 2}{Enter}
 
    send {NumPadUp 8}{Enter}{NumPadUp 2}{Enter}
 
    send {NumPadUp 2}{NumPadLeft 3}{Enter}{NumPadDown 2}{Enter}
 
    send {NumPadRight 1}{NumPadDown 3}{Enter}{NumPadDown 6}{Enter}
 
    send {NumPadLeft 1}{NumPadDown 3}{Enter}{NumPadDown 2}{Enter}
 
    send {NumPadLeft 2}{NumPadUp 3}{Enter}{NumPadUp 2}{Enter}
 
    send {NumPadUp 6}{Enter}{NumPadUp 2}{Enter}
 
    send {NumPadUp 4}{NumPadLeft 2}
 
 
}
 
}
  
middle()
+
tehOtherLoop(tehOtherDir)
 
{
 
{
    send {NumPadUp 10}{NumPadLeft 2}{Enter}{NumPadRight 4}{NumPadDown 20}{Enter}
+
loop 4
    send {NumPadUp 5}{NumPadRight 1}{Enter}{NumPadUp 10}{NumPadLeft 6}{Enter}
+
{
    send {NumPadLeft 1}{NumPadDown 1}{Enter}{NumPadDown 8}{NumPadRight 8}{Enter}
+
tehLoop(3,tehOtherDir)
    send {NumPadUp 2}{NumPadRight 1}{Enter}{NumPadUp 4}{NumPadLeft 10}{Enter}
+
send {Enter}{Enter}
    send {NumPadDown 1}{NumPadLeft 6}{Enter}{NumPadDown 2}{NumPadRight 22}{Enter}
+
}
    send {NumPadUp 1}{NumPadLeft 11}
 
}
 
 
 
stairs()
 
{
 
    send i{NumPadUp 18}{NumPadLeft 9}{Enter 2}
 
    send {NumPadRight 18}{Enter 2}
 
    send {NumPadRight 9}{NumPadDown 9}{Enter 2}
 
    send {NumPadLeft 18}{Enter 2}
 
    send {NumPadLeft 18}{Enter 2}
 
    send {NumPadRight 9}{NumPadDown 9}{Enter 2}
 
    send {NumPadRight 18}{Enter 2}
 
    send {NumPadRight 9}{NumPadDown 9}{Enter 2}
 
    send {NumPadLeft 18}{Enter 2}
 
    send {NumPadLeft 18}{Enter 2}
 
    send {NumPadDown 9}{NumPadRight 9}{Enter 2}
 
    send {NumPadRight 18}{Enter 2}
 
    send {NumPadLeft 9}{NumPadUp 18}
 
 
}
 
}
 
</pre>
 
</pre>
  
===Easy Exploration Mining in 2 steps===
 
This macro will make a 5 row, 11 column UP/DOWN stairway grid (2 empty spaces between each row/column).<br>
 
Starting point as indicated (row 3, column 11)<br>
 
'''MUST BE IN DESIGNATION MODE WITH CURSOR AT THE ''<-- START HERE'' LOCATION'''<br>
 
Link is <ctrl> <windowskey> `<br>
 
Dive is <ctrl> <alt> `<br>
 
 
<pre>
 
<pre>
Link
+
Dive
X--X--X--X--X--X--X--X--X--X--X
+
X X X X X X X X X X X
|              |              |
+
 
|              |              |
+
 
X--X--X--X--X--X--X--X--X--X--X
+
X X X X X X X X X X X
|              |              |
+
 
|              |              |
+
 
X--X--X--X--X--X--X--X--X--X--X <-- start here
+
X X X X X X X X X X X <-- start here
|              |              |
+
 
|              |              |
+
 
X--X--X--X--X--X--X--X--X--X--X
+
X X X X X X X X X X X
|              |              |
+
 
|              |              |
+
 
X--X--X--X--X--X--X--X--X--X--X
+
X X X X X X X X X X X
 
</pre>
 
</pre>
Filename is ExploreMine-Link.ahk
+
 
 +
Filename is ExploreMine-Dive.ahk
 
<pre>
 
<pre>
;Link
+
;Dive
^#`::
+
^!`::
 
 
send d
 
send {Enter}
 
 
tehLoop(30,"{NumPadLeft}")
 
tehLoop(30,"{NumPadLeft}")
send {Enter}
 
send {Enter}
 
 
tehLoop(6,"{NumPadUp}")
 
tehLoop(6,"{NumPadUp}")
send {Enter}
 
send {Enter}
 
tehLoop(30,"{NumPadRight}")
 
send {Enter}
 
send {Enter}
 
tehLoop(12,"{NumPadDown}")
 
send {Enter}
 
send {Enter}
 
tehLoop(30,"{NumPadLeft}")
 
send {Enter}
 
send {Enter}
 
tehLoop(9,"{NumPadUp}")
 
send {Enter}
 
send {Enter}
 
tehLoop(30,"{NumPadRight}")
 
send {Enter}
 
tehLoop(6,"{NumPadDown}")
 
send {Enter}
 
tehLoop(30,"{NumPadLeft}")
 
send {Enter}
 
tehLoop(3,"{NumPadDown}")
 
tehLoop(15,"{NumPadRight}")
 
send {Enter}
 
tehLoop(12,"{NumPadUp}")
 
send {Enter}
 
tehLoop(15,"{NumPadLeft}")
 
  
 
send i
 
send i
Line 1,405: Line 1,087:
 
}
 
}
 
}
 
}
</pre>
 
  
<pre>
 
Dive
 
X  X  X  X  X  X  X  X  X  X  X
 
  
 +
</pre>
  
X  X  X  X  X  X  X  X  X  X  X
+
===The MOUSE control===
 +
For unrivaled mouse control in DF try [http://www.dwarffortresswiki.net/index.php/User:Digger this DF Mouse script]
  
 +
===4-Pour Water Creation script===
 +
For Automating creation of water using Gibbeds Tweak.
  
X  X  X  X  X  X  X  X  X  X  X <-- start here
+
<pre>
 +
;
 +
; 4-pour.ahk
 +
; Dwarf fortress water creation script.
 +
;
 +
;Use this script in conjunction with Gibbeds Dwarf Fortress Tweak to create endless amounts of water.;
 +
;
 +
;Directions
 +
;
 +
;1. Have DF running and position the screen such that when you press "K" the X will appear where you
  
 +
;want the water to appear.
 +
;2. Have Gbbed's Dwarf Fortress tweak running in the background (with the proper process selected)
 +
;3. run the 4-pour script
 +
;4. press alt-p to get Pouring
 +
;
 +
;The script will then begin a cycle that moves the cursor around in a little 2x2 square editing each
  
X  X  X  X  X  X  X  X  X  X  X
+
;tile to have 7/7 of water, it then pauses for a half a seond to let the water flow a bit, and repeats.
  
 +
;It does this until you..
 +
;
 +
;5. press and hold <shift> to stop
 +
;
 +
;As always, save before you experiment with this
 +
;I hold no responsibility for what this script ends up doing to your dwarves/fortress/computer/carpet
 +
;Feel free to clean it up, make it more usable, whatever
 +
;
 +
;
  
X X X  X  X  X  X X  X  X  X
+
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
</pre>
+
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
 +
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  
Filename is ExploreMine-Dive.ahk
+
!p::
<pre>
+
loop
;Dive
 
^!`::
 
tehLoop(30,"{NumPadLeft}")
 
tehLoop(6,"{NumPadUp}")
 
  
send i
+
{
send {Enter}{Enter}
+
GetKeyState, state, Shift
tehOtherLoop("{NumPadDown}")
+
if state = D
tehLoop(3,"{NumPadRight}")
+
    Break
send {Enter}{Enter}
 
tehOtherLoop("{NumPadUp}")
 
tehLoop(3,"{NumPadRight}")
 
  
send {Enter}{Enter}
 
tehOtherLoop("{NumPadDown}")
 
tehLoop(3,"{NumPadRight}")
 
send {Enter}{Enter}
 
tehOtherLoop("{NumPadUp}")
 
tehLoop(3,"{NumPadRight}")
 
  
send {Enter}{Enter}
+
IfWinActive Dwarf Fortress
tehOtherLoop("{NumPadDown}")
+
{
tehLoop(3,"{NumPadRight}")
+
    WinActivate
send {Enter}{Enter}
+
}
tehOtherLoop("{NumPadUp}")
+
send k
tehLoop(3,"{NumPadRight}")
+
sleep 100
 +
  send {NumpadRight}
  
send {Enter}{Enter}
+
IfWinExist Gibbed's Dwarf Fortress Tweak [1.2.0.0]
tehOtherLoop("{NumPadDown}")
+
{
tehLoop(3,"{NumPadRight}")
+
    WinActivate
send {Enter}{Enter}
+
}
tehOtherLoop("{NumPadUp}")
 
tehLoop(3,"{NumPadRight}")
 
  
send {Enter}{Enter}
+
click 38, 184, 2
tehOtherLoop("{NumPadDown}")
+
sleep 100
tehLoop(3,"{NumPadRight}")
 
send {Enter}{Enter}
 
tehOtherLoop("{NumPadUp}")
 
tehLoop(3,"{NumPadRight}")
 
  
send {Enter}{Enter}
+
IfWinExist Tile Edit
tehOtherLoop("{NumPadDown}")
 
tehLoop(6,"{NumPadUp}")
 
 
 
 
 
tehLoop(tehTimes,tehDir)
 
 
{
 
{
loop
+
    WinActivate
{
 
if tehTimes <= 0
 
{
 
break
 
}
 
send %tehDir%
 
tehTimes--
 
}
 
 
}
 
}
 
+
sleep 100
tehOtherLoop(tehOtherDir)
+
click 63, 448
 +
sleep 100
 +
click 106, 70
 +
sleep 100
 +
click 207, 255
 +
sleep 100
 +
send {backspace}
 +
sleep 100
 +
send 7
 +
sleep 100
 +
click 348, 449
 +
sleep 100
 +
IfWinExist Dwarf Fortress
 
{
 
{
loop 4
+
    WinActivate
{
 
tehLoop(3,tehOtherDir)
 
send {Enter}{Enter}
 
}
 
 
}
 
}
 +
sleep 100
 +
  send {NumpadDown}
  
 
+
IfWinExist Gibbed's Dwarf Fortress Tweak [1.2.0.0]
</pre>
 
 
 
===Fancy Exploration Mining===
 
This script digs a connected series of mine shafts, as in [[Mineshaft Stitching]]. Start this script in the upper-left corner of the area you want to explore. Set the spacing to a value greater than 1 if you want to look for large clusters. Note that this pattern creates a very long walkway back to the start of the mineshafts. If you do not excavate routinely, consider connecting the top-level paths of areas you have already explored.
 
 
 
<pre>
 
 
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
; stitching.ahk   ;
 
; this is an ahk script to place exploratory mine shafts. ;
 
; press d and place the cursor   ;
 
; in the top left corner of the area to be explored   ;
 
; then use ctrl+shift+s to run   ;
 
; to change parameters, use ctrl+shift+c   ;
 
; Increasing spacing will increase some shafts   ;
 
; This version resets it's state so that it can be re-run ;
 
; without having to reload the script   ;
 
;   ;
 
; NOTE:           ;
 
; Author: Corey Amend   ;
 
; Based on a script by Seth Fogarty,           ;
 
; Which was based on a script by StrawberryBunny   ;
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
 
x = 4
 
y = 4
 
depth = 3
 
wait =  100
 
spacing = 1
 
vdir = +.
 
 
 
DropShaft(vertdir, depth, wait)
 
 
{
 
{
Send i
+
    WinActivate
Send {Enter}
 
Send {Enter}
 
Loop %depth%
 
{
 
Send %vertdir%
 
Send {Enter}
 
Send {Enter}
 
Sleep %wait%
 
}
 
 
}
 
}
  
^+c::
+
click 38, 184, 2
inputbox x, Input Length, Vertical pattern length: x-axis
+
sleep 100
inputbox y, Input Width, Horizontal pattern width: y-axis
 
inputbox depth, Input Depth, Mineshaft depth: z-axis
 
inputbox spacing, Input Spacing, Spacing multiplier (1 for complete visiblity)
 
inputbox wait, Input Delay, Delay in miliseconds (100 recommended)
 
return
 
  
^+s::
+
IfWinExist Tile Edit
shafts := (x * y) -1
 
i := x-1
 
hdir = {Down}
 
next = {Up}
 
 
 
Loop %shafts%
 
 
{
 
{
DropShaft(vdir, depth, wait)
+
    WinActivate
        if (vdir = "+.")
 
{
 
vdir = +,
 
}
 
else
 
{
 
vdir = +.
 
}
 
Send d
 
k := spacing-1
 
Send %hdir%
 
Send {Enter}
 
Loop %k%
 
{
 
Send %hdir%
 
Send {Enter}
 
Send %hdir%
 
Send {Enter}
 
Send %hdir%
 
Sleep %wait%
 
}
 
Send %hdir%
 
Send {Enter}
 
Send %hdir%
 
Sleep %wait%
 
i--
 
if (i = 0)
 
{
 
if (hdir = "{Down}")
 
{
 
hdir = {Right}
 
next = {Up}
 
i=1
 
}
 
else if (hdir = "{Right}")
 
{
 
hdir = %next%
 
i := x-1
 
}
 
else if (hdir = "{Up}")
 
{
 
hdir = {Right}
 
next = {Down}
 
i=1
 
}
 
}
 
 
}
 
}
DropShaft(vdir, depth, wait)
+
sleep 100
if (vdir = "+.")
+
click 63, 448
 +
sleep 100
 +
click 106, 70
 +
sleep 100
 +
click 207, 255
 +
sleep 100
 +
send {backspace}
 +
sleep 100
 +
send 7
 +
sleep 100
 +
click 348, 449
 +
sleep 100
 +
IfWinExist Dwarf Fortress
 
{
 
{
Loop %depth%
+
    WinActivate
{
 
Send +,
 
}
 
 
}
 
}
else
+
sleep 100
 +
  send {NumpadLeft}
 +
 
 +
IfWinExist Gibbed's Dwarf Fortress Tweak [1.2.0.0]
 
{
 
{
vdir = +.
+
    WinActivate
}
+
}
return
 
  
</pre>
+
click 38, 184, 2
 +
sleep 100
  
===Upstairs Mineshaft Finisher===
+
IfWinExist Tile Edit
This script is used to create a series of up staircases in a pattern for use with mineshaft scripts (like the mineshaft stitching above). Most mineshaft scripts use up/down staircases all the way to the bottom, but the lowest z-level will not allow up/down staircases so you mineshafts will be unfinished. This script allows you to correct this problem and place up stairs where the up/down stairs would be.
 
 
 
<pre>
 
 
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
; Upstair stitching.ahk   ;
 
; this is an ahk script to place up stairs at regular   ;
 
; intervals (useful for completing mine shafts).   ;
 
; press d and place the cursor   ;
 
; in the top left corner of the area to be explored   ;
 
; then use ctrl+shift+u to run   ;
 
; to change parameters, use ctrl+shift+p   ;
 
; Increasing spacing will increase some shafts   ;
 
;   ;
 
; NOTE:           ;
 
; Author: Corey Amend   ;
 
; Based on a script by Seth Fogarty,           ;
 
; Which was based on a script by StrawberryBunny   ;
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
 
x = 4
 
y = 4
 
wait =  100
 
spacing = 1
 
vdir = +.
 
 
 
^+p::
 
inputbox x, Input Length, Vertical pattern length: x-axis
 
inputbox y, Input Width, Horizontal pattern width: y-axis
 
inputbox spacing, Input Spacing, Spacing multiplier (1 for complete visiblity)
 
inputbox wait, Input Delay, Delay in miliseconds (100 recommended)
 
return
 
 
 
^+u::
 
shafts := (x * y) -1
 
i := x-1
 
hdir = {Down}
 
next = {Up}
 
 
 
Loop %shafts%
 
 
{
 
{
Send u
+
    WinActivate
Send {Enter}
+
}
Send {Enter}
+
sleep 100
Sleep %wait%
+
click 63, 448
 
+
sleep 100
k := spacing-1
+
click 106, 70
Send %hdir%
+
sleep 100
Loop %k%
+
click 207, 255
{
+
sleep 100
Send %hdir%
+
send {backspace}
Send %hdir%
+
sleep 100
Send %hdir%
+
send 7
Sleep %wait%
+
sleep 100
}
+
click 348, 449
Send %hdir%
+
sleep 100
Send %hdir%
+
IfWinExist Dwarf Fortress
Sleep %wait%
+
{
i--
+
    WinActivate
if (i = 0)
 
{
 
if (hdir = "{Down}")
 
{
 
hdir = {Right}
 
next = {Up}
 
i=1
 
}
 
else if (hdir = "{Right}")
 
{
 
hdir = %next%
 
i := x-1
 
}
 
else if (hdir = "{Up}")
 
{
 
hdir = {Right}
 
next = {Down}
 
i=1
 
}
 
}
 
 
}
 
}
Send u
+
sleep 100
Send {Enter}
+
  send {NumpadUp}
Send {Enter}
 
Sleep %wait%
 
  
return
+
IfWinExist Gibbed's Dwarf Fortress Tweak [1.2.0.0]
 +
{
 +
    WinActivate
 +
}
  
</pre>
+
click 38, 184, 2
 +
sleep 100
  
===Interface Enhancement Scripts===
+
IfWinExist Tile Edit
 
+
{
 
+
    WinActivate
====The MOUSE control====
+
}
For unrivaled mouse control in DF try [[User:Digger|this DF Mouse script]]
+
sleep 100
 
+
click 63, 448
====Tile Counter or Scrolling Accelerator====
+
sleep 100
Lack of reference plus slow scroll speed make planning digging area frustrating,so here is the script that shows coordinate and speed scrolling up.
+
click 106, 70
[[User:Daedalusai|ShowXY]]
+
sleep 100
 
+
click 207, 255
===4-Pour Water Creation script===
+
sleep 100
For Automating creation of water using Gibbeds Tweak.
+
send {backspace}
 
+
sleep 100
<pre>
+
send 7
 +
sleep 100
 +
click 348, 449
 +
sleep 100
 +
IfWinExist Dwarf Fortress
 +
{
 +
    WinActivate
 +
}
 +
send {space}
 +
sleep 800
 +
}
 +
 
 +
</pre>
 +
 
 +
===Tesselated Apartments Builder===
 +
 
 +
This one is another tesselated apartments script, with some larger areas added. Credit for layout to GnomeChomsky.
 +
 
 +
<pre>
 
;
 
;
; 4-pour.ahk
+
; TessApts.ahk
; Dwarf fortress water creation script.
+
; Start script while in 'dig' mode with cursor on desired position of leftmost staircase
;
 
;Use this script in conjunction with Gibbeds Dwarf Fortress Tweak to create endless amounts of water.;
 
 
;
 
;
;Directions
+
; CTRL+G      : Central room, 8 apartments (necessary on at least one z-level)
 +
; ALT+G        : No central room, 16 apartments
 +
; CTRL+ALT+G  : Four "central room" layouts connected in center (28 apartments)
 +
; CTRL+SHIFT+G : Four "16 apartment" layouts, unconnected in center
 
;
 
;
;1. Have DF running and position the screen such that when you press "K" the X will appear where you
+
!g::
 
+
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
;want the water to appear.
+
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
;2. Have Gbbed's Dwarf Fortress tweak running in the background (with the proper process selected)
+
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
;3. run the 4-pour script
+
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
;4. press alt-p to get Pouring
+
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}114444444
;
+
return
;The script will then begin a cycle that moves the cursor around in a little 2x2 square editing each
+
^g::
 
+
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
;tile to have 7/7 of water, it then pauses for a half a seond to let the water flow a bit, and repeats.
+
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
+
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
;It does this until you..
+
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
;
+
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}
;5. press and hold <shift> to stop
+
Send 7444{ENTER}{ENTER}1114{ENTER}{ENTER}3332{ENTER}{ENTER}9996{ENTER}{ENTER}788{ENTER}11111{ENTER}
;
+
return
;As always, save before you experiment with this
+
!^g::
;I hold no responsibility for what this script ends up doing to your dwarves/fortress/computer/carpet
+
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
;Feel free to clean it up, make it more usable, whatever
+
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
;
+
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
;
+
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 
+
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
+
Send 7444{ENTER}{ENTER}1114{ENTER}{ENTER}3332{ENTER}{ENTER}9996{ENTER}{ENTER}788{ENTER}11111{ENTER}88899999999
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
+
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
+
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
+
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
!p::
+
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
loop
+
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}
 
+
Send 7444{ENTER}{ENTER}1114{ENTER}{ENTER}3332{ENTER}{ENTER}9996{ENTER}{ENTER}788{ENTER}11111{ENTER}3333332
{
+
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
GetKeyState, state, Shift
+
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
if state = D
+
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
    Break
+
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 
+
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}
 
+
Send 7444{ENTER}{ENTER}1114{ENTER}{ENTER}3332{ENTER}{ENTER}9996{ENTER}{ENTER}788{ENTER}11111{ENTER}111114444444
IfWinActive Dwarf Fortress
+
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
{
+
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
    WinActivate
+
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
}
+
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
send k
+
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}
sleep 100
+
Send 7444{ENTER}{ENTER}1114{ENTER}{ENTER}3332{ENTER}{ENTER}9996{ENTER}{ENTER}788{ENTER}11111{ENTER}
  send {NumpadRight}
+
Send 9988888888{ENTER}999{ENTER}+444444
 
+
return
IfWinExist Gibbed's Dwarf Fortress Tweak [1.2.0.0]
 
{
 
    WinActivate
 
}
 
 
 
click 38, 184, 2
 
sleep 100
 
 
 
IfWinExist Tile Edit
 
{
 
    WinActivate
 
}
 
sleep 100
 
click 63, 448
 
sleep 100
 
click 106, 70
 
sleep 100
 
click 207, 255
 
sleep 100
 
send {backspace}
 
sleep 100
 
send 7
 
sleep 100
 
click 348, 449
 
sleep 100
 
IfWinExist Dwarf Fortress
 
{
 
    WinActivate
 
}
 
sleep 100
 
  send {NumpadDown}
 
 
 
IfWinExist Gibbed's Dwarf Fortress Tweak [1.2.0.0]
 
{
 
    WinActivate
 
}
 
 
 
click 38, 184, 2
 
sleep 100
 
 
 
IfWinExist Tile Edit
 
{
 
    WinActivate
 
}
 
sleep 100
 
click 63, 448
 
sleep 100
 
click 106, 70
 
sleep 100
 
click 207, 255
 
sleep 100
 
send {backspace}
 
sleep 100
 
send 7
 
sleep 100
 
click 348, 449
 
sleep 100
 
IfWinExist Dwarf Fortress
 
{
 
    WinActivate
 
}
 
sleep 100
 
  send {NumpadLeft}
 
 
 
IfWinExist Gibbed's Dwarf Fortress Tweak [1.2.0.0]
 
{
 
    WinActivate
 
}
 
 
 
click 38, 184, 2
 
sleep 100
 
 
 
IfWinExist Tile Edit
 
{
 
    WinActivate
 
}
 
sleep 100
 
click 63, 448
 
sleep 100
 
click 106, 70
 
sleep 100
 
click 207, 255
 
sleep 100
 
send {backspace}
 
sleep 100
 
send 7
 
sleep 100
 
click 348, 449
 
sleep 100
 
IfWinExist Dwarf Fortress
 
{
 
    WinActivate
 
}
 
sleep 100
 
  send {NumpadUp}
 
 
 
IfWinExist Gibbed's Dwarf Fortress Tweak [1.2.0.0]
 
{
 
    WinActivate
 
}
 
 
 
click 38, 184, 2
 
sleep 100
 
 
 
IfWinExist Tile Edit
 
{
 
    WinActivate
 
}
 
sleep 100
 
click 63, 448
 
sleep 100
 
click 106, 70
 
sleep 100
 
click 207, 255
 
sleep 100
 
send {backspace}
 
sleep 100
 
send 7
 
sleep 100
 
click 348, 449
 
sleep 100
 
IfWinExist Dwarf Fortress
 
{
 
    WinActivate
 
}
 
send {space}
 
sleep 800
 
}
 
 
 
</pre>
 
 
 
===Tesselated Apartments Builder===
 
 
 
This one is another tesselated apartments script, with some larger areas added. Credit for layout to GnomeChomsky.
 
 
 
<pre>
 
;
 
; TessApts.ahk
 
; Start script while in 'dig' mode with cursor on desired position of leftmost staircase
 
;
 
; CTRL+G      : Central room, 8 apartments (necessary on at least one z-level)
 
; ALT+G        : No central room, 16 apartments
 
; CTRL+ALT+G  : Four "central room" layouts connected in center (28 apartments)
 
; CTRL+SHIFT+G : Four "16 apartment" layouts, unconnected in center
 
;
 
!g::
 
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}114444444
 
return
 
^g::
 
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}
 
Send 7444{ENTER}{ENTER}1114{ENTER}{ENTER}3332{ENTER}{ENTER}9996{ENTER}{ENTER}788{ENTER}11111{ENTER}
 
return
 
!^g::
 
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}
 
Send 7444{ENTER}{ENTER}1114{ENTER}{ENTER}3332{ENTER}{ENTER}9996{ENTER}{ENTER}788{ENTER}11111{ENTER}88899999999
 
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}
 
Send 7444{ENTER}{ENTER}1114{ENTER}{ENTER}3332{ENTER}{ENTER}9996{ENTER}{ENTER}788{ENTER}11111{ENTER}3333332
 
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}
 
Send 7444{ENTER}{ENTER}1114{ENTER}{ENTER}3332{ENTER}{ENTER}9996{ENTER}{ENTER}788{ENTER}11111{ENTER}111114444444
 
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}
 
Send 7444{ENTER}{ENTER}1114{ENTER}{ENTER}3332{ENTER}{ENTER}9996{ENTER}{ENTER}788{ENTER}11111{ENTER}
 
Send 9988888888{ENTER}999{ENTER}+444444
 
return
 
 
 
+^g::
 
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}888889
 
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}+221
 
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}+1+46
 
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}+71144444
 
</pre>
 
 
 
===File pattern builder===
 
 
 
This is a script to create a macro out of any building pattern you like. If you like tesselated, this script will do it. If you like blocky, this script can do that, too. Just create a text file that contains the pattern you want to use and this macro will create it like nobody's business.
 
 
 
<pre>
 
 
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
; File Pattern.ahk     ;
 
; this is an ahk script to read a text file and use   ;
 
; the pattern contained inside as a blueprint for digging ;
 
; press d and place the cursor   ;
 
; in a corner of the area to be explored   ;
 
; then use ctrl+shift+d to run   ;
 
; to change parameters, use ctrl+shift+f   ;
 
;   ;
 
; NOTE:           ;
 
; Author: Corey Amend   ;
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
 
filename = C:\pattern.txt
 
loc = ul
 
wait = 100
 
 
 
wallsymbol = 1
 
floorsymbol = 0
 
updownsymbol = 2
 
downsymbol = 3
 
upsymbol = 4
 
rampsymbol = 5
 
channelsymbol = 6
 
 
 
digcommand = d
 
upcommand = u
 
downcommand = j
 
updowncommand = i
 
rampcommand = r
 
channelcommand = h
 
 
 
hdir = {Right}
 
vdir = {Down}
 
 
 
upperleft = ul
 
upperright = ur
 
lowerleft = ll
 
lowerright = lr
 
 
 
inrun = 0
 
 
 
^+f::
 
inputbox filename, Enter Path, Enter the full path to the file that contains the pattern to use
 
inputbox loc, Enter Cursor Location, Enter the location of the cursor within the pattern (Upper Left = ul`, Lower Right = lr...etc.)
 
inputbox wait, Enter Delay, Enter the delay to use (default is 100)
 
return
 
 
 
^+d::
 
 
 
IfExist,  %filename%
 
{
 
FileRead, contents, %filename%
 
StringSplit Array, contents, `r, `n
 
 
 
if (loc = upperleft)
 
{
 
hdir = {Right}
 
vdir = {Down}
 
}
 
else if (loc = upperright)
 
{
 
hdir = {Left}
 
vdir = {Down}
 
}
 
else if (loc = lowerleft)
 
{
 
hdir = {Right}
 
vdir = {Up}
 
}
 
else if (loc = lowerright)
 
{
 
hdir = {Left}
 
vdir = {Up}
 
}
 
else
 
{
 
MsgBox, Invalid cursor location!
 
return
 
}
 
 
 
Loop %Array0%
 
{
 
if (loc = upperleft || loc = upperright)
 
{
 
current_line = %a_index%
 
}
 
else if (loc = lowerleft || loc = lowerright)
 
{
 
current_line := (Array0 - a_index + 1)
 
}
 
 
 
current_value := Array%current_line%
 
 
len := StrLen(current_value)
 
 
 
if (hdir = "{Left}")
 
{
 
new_value =
 
 
 
Loop %len%
 
{
 
new_value := new_value . SubStr(current_value, (len - a_index) + 1, 1)
 
}
 
 
current_value := new_value
 
}
 
 
 
Loop %len%
 
{
 
current_char := SubStr(current_value, a_index, 1)
 
 
 
if (current_char != wallsymbol)
 
{
 
if (!inrun)
 
{
 
if (current_char = floorsymbol)
 
{
 
Send %digcommand%
 
}
 
else if (current_char = updownsymbol)
 
{
 
Send %updowncommand%
 
}
 
else if (current_char = downsymbol)
 
{
 
Send %downcommand%
 
}
 
else if (current_char = upsymbol)
 
{
 
Send %upcommand%
 
}
 
else if (current_char = rampsymbol)
 
{
 
Send %rampcommand%
 
}
 
else if (current_char = channelsymbol)
 
{
 
Send %channelcommand%
 
}
 
 
 
Send {Enter}
 
inrun = 1
 
}
 
 
 
;;If we're at the end of a line or the next char is different, then end the run
 
if ((a_index >= len) || (current_char != SubStr(current_value, a_index + 1, 1)))
 
{
 
Send {Enter}
 
inrun = 0
 
Sleep %wait%
 
}
 
}
 
 
 
if (a_index < len)
 
{
 
Send %hdir%
 
}
 
}
 
 
if (a_index < Array0)
 
{
 
Send %vdir%
 
 
 
if (hdir = "{Right}")
 
{
 
hdir = {Left}
 
}
 
else if (hdir = "{Left}")
 
{
 
hdir = {Right}
 
}
 
}
 
}
 
}
 
else
 
{
 
MsgBox File not found
 
}
 
 
 
</pre>
 
 
 
Sample file to show how this all works:
 
 
 
<pre>
 
 
 
111111
 
100001
 
100201
 
103001
 
100401
 
105001
 
100601
 
100001
 
111111
 
  
 +
+^g::
 +
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 +
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 +
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 +
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 +
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}888889
 +
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 +
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 +
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 +
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 +
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}+221
 +
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 +
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 +
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 +
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 +
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}+1+46
 +
Send i{ENTER}{ENTER}33332{ENTER}{ENTER}99996{ENTER}{ENTER}77778{ENTER}{ENTER}
 +
Send d7{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 +
Send 111{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}
 +
Send 333333{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}32{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}
 +
Send 99999988{ENTER}66{ENTER}2{ENTER}{ENTER}14{ENTER}22{ENTER}4{ENTER}{ENTER}78{ENTER}44{ENTER}8{ENTER}{ENTER}96{ENTER}88{ENTER}6{ENTER}{ENTER}+71144444
 
</pre>
 
</pre>
  
This creates a room filled with up/down stairs, a ramp, and a channel.
 
 
And finally, here's a sample pattern based on the decentralized workshop:
 
 
<pre>
 
  
1111111111111111111111111111111111111
 
1000000000000001000001000000000000001
 
1000000000000001000001000000000000001
 
1000000000000000000000000000000000001
 
1000000000000001000001000000000000001
 
1000000000000001000001000000000000001
 
1000111101111111110111111111011110001
 
1000100000001000100010001000000010001
 
1000100000001000100010001000000010001
 
1000100000001000100010001000000010001
 
1000000000000010000000100000000000001
 
1000111101111000100010001111011110001
 
1000100000001000100010001000000010001
 
1101100010001000100010001000100011011
 
1000100000001000100010001000000010001
 
1000111101111111100011111111011110001
 
1000100000000000030400000000000010001
 
1010000000000000030400000000000000101
 
1000100000000000030400000000000010001
 
1000111101111111100011111111011110001
 
1000100000001000100010001000000010001
 
1101100010001000100010001000100011011
 
1000100000001000100010001000000010001
 
1000111101111000100010001111011110001
 
1000000000000010000000100000000000001
 
1000100000001000100010001000000010001
 
1000100000001000100010001000000010001
 
1000100000001000100010001000000010001
 
1000111101111111110111111111011110001
 
1000000000000001000001000000000000001
 
1000000000000001000001000000000000001
 
1000000000000000000000000000000000001
 
1000000000000001000001000000000000001
 
1000000000000001000001000000000000001
 
1111111111111111111111111111111111111
 
  
</pre>
 
 
=== jokermatt999's pump stack builder ===
 
 
Just a simple macro to place one mined level of a pump stack room, as illustrated in the pump stack page on this wiki. It's recommended you exit out after finishing up with it, as the macro is just assigned to p. Hit/Hold down p for multiple layers.
 
 
<pre>
 
p::Send i{Enter}{Enter}{Right}d{Enter}{Right}{Right}{Down}{Down}{Enter}h{Enter}{Enter}{Up}{Left}x{Enter}{Enter}{Left}{Left}{Down}h{Enter}{Enter}{Up}{Up}{Shift Down}.{Shift Up}
 
</pre>
 
 
<pre>
 
p::
 
Send i{Enter 2}
 
Send d6{Enter}33{Enter}
 
Send h{Enter 2}
 
Send x7{Enter 2}
 
Send h14{Enter 2}
 
Send 88{Shift Down}.{Shift Up}
 
return
 
</pre>
 
  
 
{{Game_Interface FAQ}}
 
{{Game_Interface FAQ}}
 
[[Category:ahk scripts]]
 
[[Category:ahk scripts]]

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

Templates used on this page: