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.

User:Jondan/stitch.ahk

From Dwarf Fortress Wiki
Jump to navigation Jump to search
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; mineshaft.ahk                                                              ;
 ; 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     ;
 ; explored then use CTRL+SHIFT+S to run.                                     ;
 ;                                                                            ;
 ; NOTE:                                                                      ;
 ; Change variables x, y and depth, or press CTRL+SHIFT+C, to suit your       ;
 ; conditions.                                                                ;
 ;                                                                            ;
 ; Original author: StrawberryBunny                                           ;
 ; Modified by: Jondan                                                        ;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

x = 3
y = 3
depth = 3
wait = 100

 ^+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 wait, Input Delay, Delay in miliseconds (>= 100 recommended)
return

 ^+s::
SetKeyDelay %wait%

VarRuntime := ((5 * x * y * depth) + (22 * x * y)) / 10
VarRuntimeMinutes := VarRuntime / 60
VarRuntimeHours := VarRuntimeMinutes / 60
VarXCount = 1

MsgBox Estimated time to run is %VarRuntime% seconds / %VarRuntimeMinutes% minutes / %VarRuntimeHours% hours

Loop %x%
{
   VarYCount = 1

   Loop %y%
   {
      Loop %depth%
      {
         if ( A_Index = 1 )
         {
            Send j
         }
         else
         {
            Send i
         }

         Send {Enter 2}+.
      }

      Send u{Enter 2}d

      if ( VarXCount < x )
      {
         Send {Right}{Enter}{Right}{Enter}{Left 2}
      }

      Loop %depth%
      {
         Send +,
      }

      if ( VarYCount < y )
      {
         Send {Down}{Enter}{Down}{Enter}{Down}
      }

      VarYCount += 1
   }

   if ( VarXCount < x )
   {
      Send {Right 3}

      Loop % y - 1
      {
         Send {Up 3}
      }
   }

   VarXCount += 1
}

MsgBox All done!

return