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.

Difference between revisions of "40d:GuiDumper.ahk"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(New page: thumb|leftThis 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...)
 
m (link to main ahk page)
Line 1: Line 1:
[[Image:GuiDumper.png|thumb|left]]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).
+
[[Image:GuiDumper.png|thumb|right]]
<em>Important!</em>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 [[dump]] 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|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 [[zone]]s ({{k|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#AutoHotKey Examples|Macros and Keymaps]].
 +
 
 
<br clear="both" />
 
<br clear="both" />
 
  ;
 
  ;

Revision as of 19:20, 8 November 2009

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