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.

40d:GuiDumper.ahk

From Dwarf Fortress Wiki
Jump to navigation Jump to search
GuiDumper.png

This script will dump a specified rectange of stone, corpses, etc. DF must be windowed to run this script. Invoke while the game is paused at the look 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.

For more scripts, see Macros and Keymaps.


;
;  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