GuiDumper.ahk
From DwarfFortressWiki
This script will clear out a specified rectange of stone/ corpses/ etc. DF must be windowed to run this script. Invoke while the game is paused at the loo(k) menu. Remember that rows go left to right and columns go up and down. For external use only. Remember to have a garbage dump set up in your zones (i menu).Important!This script has issues detecting DF's window for some reason, and it doesn't always make the switch cleanly. I've written in a 3 second pause before the dumping actually begins so that you can switch to DF manually before the script runs.
;
; This script will designate a rectangle of stone to be dumped.
; Invoke while at the top left of the region to be dumped.
;
DetectHiddenWindows, on
Gui, Add, Text,, Rows to dump
Gui, Add, Text,, Cols to dump
Gui, Add, Edit, vRows ym
Gui, Add, Edit, vCols
Gui, Add, Button, Default, OK
Gui, Add, Button, Default, Cancel
Gui, Show,, Autodumper
Return
;
; end autoexec.
;
Enter::
GuiClose:
ButtonOK:
Gui, Submit, NoHide ; Save the input from the user to each control's associated variable.
dir=r
IfWinExist, Dwarf Fortress ; make sure df is running
WinActivate
sleep, 3000 ;; three seconds to open the DF window if it doesn't open automatically.
Cols--
loop, %Rows% {
loop, %Cols% {
send, d ; dump
if (dir == "r") {
send, {RIGHT}
} else {
send, {LEFT}
}
}
send,d ; one last dump for the tail end of the row
if (dir=="r") {
dir = l
} else {
dir = r
}
send, {DOWN}
}
Escape::
ButtonCancel:
ExitApp

