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:Mineshaft stitching"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m (Changed quality rating from "Unrated" to "Fine" using the rating script)
 
(20 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 +
{{Quality|Fine|11:03, 18 May 2015 (UTC)}}
 +
{{av}}
 
When using [[Exploratory mining#Mine shafts|mine shafts]], dwarves will prefer to dig all of one level before moving on to the next. This can result in a lot of time spent moving, as miners go up and down mine shafts. If you have a large number of relatively unskilled miners, this is unlikely to be a problem: digging time will dominate in any case. If you have one or two legendary miners, this is quite annoying. As a solution, you can creating a single path that forces your dwarf to finish one shaft before moving on to the next. To do so, connect shafts alternately at the top and bottom layers, so the shaft snakes through the area. For example, the top, middle, and bottom layers could look like:  
 
When using [[Exploratory mining#Mine shafts|mine shafts]], dwarves will prefer to dig all of one level before moving on to the next. This can result in a lot of time spent moving, as miners go up and down mine shafts. If you have a large number of relatively unskilled miners, this is unlikely to be a problem: digging time will dominate in any case. If you have one or two legendary miners, this is quite annoying. As a solution, you can creating a single path that forces your dwarf to finish one shaft before moving on to the next. To do so, connect shafts alternately at the top and bottom layers, so the shaft snakes through the area. For example, the top, middle, and bottom layers could look like:  
  
  
<div style="font-family: monospace; white-space: pre; line-height: 126.5%"><nowiki>  
+
<pre style="font:bold 20px/1 'Courier New';color:#ccc;background:black;width:auto;padding:5px;float:left">
 
▒▒▒▒▒▒▒▒▒
 
▒▒▒▒▒▒▒▒▒
.X▒▒X▒▒X▒
+
.X▒▒X..X▒
.▒▒.▒▒.▒
+
▒▒▒▒▒▒▒▒▒
.▒▒.▒▒.▒
+
▒▒▒▒▒▒▒▒▒
▒X▒▒X▒▒X▒
+
▒X..X▒▒X▒
 
▒▒▒▒▒▒▒▒▒
 
▒▒▒▒▒▒▒▒▒
</nowiki></div>
 
  
 
+
</pre>
<div style="font-family: monospace; white-space: pre; line-height: 126.5%"><nowiki>  
+
{{-}}
 +
<pre style="font:bold 20px/1 'Courier New';color:#ccc;background:black;width:auto;padding:5px;float:left">
 
▒▒▒▒▒▒▒▒▒
 
▒▒▒▒▒▒▒▒▒
 
▒X▒▒X▒▒X▒
 
▒X▒▒X▒▒X▒
Line 19: Line 21:
 
▒X▒▒X▒▒X▒
 
▒X▒▒X▒▒X▒
 
▒▒▒▒▒▒▒▒▒
 
▒▒▒▒▒▒▒▒▒
</nowiki></div>
+
</pre>
 
+
{{-}}
 
+
<pre style="font:bold 20px/1 'Courier New';color:#ccc;background:black;width:auto;padding:5px;float:left">
<div style="font-family: monospace; white-space: pre; line-height: 126.5%"><nowiki>  
 
 
▒▒▒▒▒▒▒▒▒
 
▒▒▒▒▒▒▒▒▒
▒X..X..X▒
+
▒X▒▒X▒▒X▒
 +
.▒▒.▒▒.
 +
.▒▒.▒▒.▒
 +
▒X▒▒X▒▒X▒
 
▒▒▒▒▒▒▒▒▒
 
▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒
+
</pre>
▒X..X..X▒
+
{{-}}
▒▒▒▒▒▒▒▒▒
+
 
</nowiki></div>
 
  
An AKH script to construct such a pattern is provided below, based on [[User:StrawberryBunny/Mineshaft.ahk|this script]], but using many fewer keystrokes.
+
Clearly you can repeat the middle layer as often as you want: I recommend at least 5-10 levels to really make this worthwhile. 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.
  
length = 12
+
=== AHK script ===
width = 12
+
An AHK script to construct such a pattern is provided below, based on [[User:StrawberryBunny/Mineshaft.ahk|this script]], but using many fewer keystrokes.
depth = 3
 
wait = 100
 
spacing = 1
 
vdir = +.
 
  
DropShaft(vertdir, depth, wait)
+
There is an alternate version [[User:Jondan/stitch.ahk|here]].
{
 
Send i
 
Send {Enter}
 
Send {Enter}
 
Loop %depth%
 
{
 
Send %vertdir%
 
Send {Enter}
 
Send {Enter}
 
Sleep %wait%
 
}
 
}
 
  
 
<pre>
 
<pre>
Line 71: Line 58:
  
 
x = 4
 
x = 4
width = 4
+
y = 4
 
depth = 3
 
depth = 3
 
wait =  100
 
wait =  100
Line 95: Line 82:
 
inputbox y, Input Width, Horizontal pattern width: y-axis
 
inputbox y, Input Width, Horizontal pattern width: y-axis
 
inputbox depth, Input Depth, Mineshaft depth: z-axis
 
inputbox depth, Input Depth, Mineshaft depth: z-axis
inputbox spacing, Spacing multiplier (1 for complete visiblity)
+
inputbox spacing, Input Spacing, Spacing multiplier (1 for complete visiblity)
 
inputbox wait, Input Delay, Delay in miliseconds (100 recommended)
 
inputbox wait, Input Delay, Delay in miliseconds (100 recommended)
 
return  
 
return  
Line 166: Line 153:
  
 
</pre>
 
</pre>
 +
 +
[[Category:Ahk scripts]]
 +
[[Category:FAQ - Mining]]
 +
[[Category:Guides]]

Latest revision as of 11:03, 18 May 2015

This article is about an older version of DF.

When using mine shafts, dwarves will prefer to dig all of one level before moving on to the next. This can result in a lot of time spent moving, as miners go up and down mine shafts. If you have a large number of relatively unskilled miners, this is unlikely to be a problem: digging time will dominate in any case. If you have one or two legendary miners, this is quite annoying. As a solution, you can creating a single path that forces your dwarf to finish one shaft before moving on to the next. To do so, connect shafts alternately at the top and bottom layers, so the shaft snakes through the area. For example, the top, middle, and bottom layers could look like:


▒▒▒▒▒▒▒▒▒
.X▒▒X..X▒
▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒
▒X..X▒▒X▒
▒▒▒▒▒▒▒▒▒


▒▒▒▒▒▒▒▒▒
▒X▒▒X▒▒X▒
▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒
▒X▒▒X▒▒X▒
▒▒▒▒▒▒▒▒▒


▒▒▒▒▒▒▒▒▒
▒X▒▒X▒▒X▒
▒.▒▒.▒▒.▒
▒.▒▒.▒▒.▒
▒X▒▒X▒▒X▒
▒▒▒▒▒▒▒▒▒



Clearly you can repeat the middle layer as often as you want: I recommend at least 5-10 levels to really make this worthwhile. 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.

AHK script[edit]

An AHK script to construct such a pattern is provided below, based on this script, but using many fewer keystrokes.

There is an alternate version here.


 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; 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 
 ;							   ;
 ; NOTE:					           ;
 ; Author: Seth Fogarty				           ;
 ; Based on a script by StrawberryBunny			   ;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

x = 4
y = 4
depth = 3
wait =  100
spacing = 1
vdir = +.

DropShaft(vertdir, depth, wait)
{
	Send i
	Send {Enter}
	Send {Enter}
	Loop %depth%
	{
		Send %vertdir%
		Send {Enter}
		Send {Enter}
		Sleep %wait%
	}
}

 ^+c::
inputbox x, Input Length, Vertical pattern length: x-axis
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::
shafts := (x * y) -1
i := x-1
hdir = {Down}
next = {Up} 

Loop %shafts%
{
	DropShaft(vdir, depth, wait)
        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)
if (vdir = "+.") 
{
	Loop %depth%
	{
		Send +,
	}
}	
return