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 User:Jondan/stitch.ahk

Jump to navigation Jump to search

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


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:
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ; mineshaft.ahk                                                             ;
+
; stitch.ahk                                                                 ;
  ; This is an AHK script to place exploratory mine shafts. Press d and place  ;
+
; This is an AHK script to place exploratory mine shafts. Press d and place  ;
  ; the cursor in the top left corner (on the top floor) of the area to be    ;
+
; the cursor in the top left corner (on the top floor) of the area to be    ;
  ; explored then use CTRL+SHIFT+S to run.                                    ;
+
; explored then use CTRL+SHIFT+S to run.                                    ;
  ;                                                                            ;
+
;                                                                            ;
  ; NOTE:                                                                      ;
+
; NOTE:                                                                      ;
  ; Change variables x, y and depth, or press CTRL+SHIFT+C, to suit your      ;
+
; Change variables x, y and depth, or press CTRL+SHIFT+C, to suit your      ;
  ; conditions.                                                                ;
+
; conditions.                                                                ;
  ;                                                                            ;
+
;                                                                            ;
  ; Original author: StrawberryBunny                                          ;
+
; Original author: StrawberryBunny                                          ;
  ; Modified by: Jondan                                                        ;
+
; Modified by: Jondan                                                        ;
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
 
x = 3
+
x = 3
y = 3
+
y = 3
depth = 3
+
depth = 3
wait = 100
+
wait = 100
   
+
 
  ^+c::
+
  ^+c::
inputbox x, Input Length, Vertical pattern length: x-axis
+
inputbox x, Input Length, Vertical pattern length: x-axis
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 wait, Input Delay, Delay in miliseconds (>= 100 recommended)
+
inputbox wait, Input Delay, Delay in miliseconds (>= 100 recommended)
return
+
return
   
+
 
  ^+s::
+
  ^+s::
SetKeyDelay %wait%
+
SetKeyDelay %wait%
+
 
VarRuntime := ((5 * x * y * depth) + (22 * x * y)) / 10
+
VarRuntime := ((5 * x * y * depth) + (22 * x * y)) / 10
VarRuntimeMinutes := VarRuntime / 60
+
VarRuntimeMinutes := VarRuntime / 60
VarRuntimeHours := VarRuntimeMinutes / 60
+
VarRuntimeHours := VarRuntimeMinutes / 60
VarXCount = 1
+
VarXCount = 1
+
 
MsgBox Estimated time to run is %VarRuntime% seconds / %VarRuntimeMinutes% minutes / %VarRuntimeHours% hours
+
MsgBox Estimated time to run is %VarRuntime% seconds / %VarRuntimeMinutes% minutes / %VarRuntimeHours% hours
+
 
Loop %x%
+
Loop %x%
{
+
{
    VarYCount = 1
+
  VarYCount = 1
+
 
    Loop %y%
+
  Loop %y%
    {
+
  {
      Loop %depth%
+
      Loop %depth%
      {
+
      {
          if ( A_Index = 1 )
+
        if ( A_Index = 1 )
          {
+
        {
            Send j
+
            Send j
          }
+
        }
          else
+
        else
          {
+
        {
            Send i
+
            Send i
          }
+
        }
+
 
          Send {Enter 2}+.
+
        Send {Enter 2}+.
      }
+
      }
+
 
      Send u{Enter 2}d
+
      Send u{Enter 2}d
+
 
      if ( VarXCount < x )
+
      if ( VarXCount < x )
      {
+
      {
          Send {Right}{Enter}{Right}{Enter}{Left 2}
+
        Send {Right}{Enter}{Right}{Enter}{Left 2}
      }
+
      }
+
 
      Loop %depth%
+
      Loop %depth%
      {
+
      {
          Send +,
+
        Send +,
      }
+
      }
+
 
      if ( VarYCount < y )
+
      if ( VarYCount < y )
      {
+
      {
          Send {Down}{Enter}{Down}{Enter}{Down}
+
        Send {Down}{Enter}{Down}{Enter}{Down}
      }
+
      }
+
 
      VarYCount += 1
+
      VarYCount += 1
    }
+
  }
+
 
    if ( VarXCount < x )
+
  if ( VarXCount < x )
    {
+
  {
      Send {Right 3}
+
      Send {Right 3}
+
 
      Loop % y - 1
+
      Loop % y - 1
      {
+
      {
          Send {Up 3}
+
        Send {Up 3}
      }
+
      }
    }
+
  }
+
 
    VarXCount += 1
+
  VarXCount += 1
}
+
}
+
 
MsgBox All done!
+
MsgBox All done!
+
 
return
+
return

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)