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:Dukederek

From Dwarf Fortress Wiki
Jump to navigation Jump to search

Dump Macro[edit]

I have written a dump macro for AutoHotKey which works something like the designation tools in the actual DF interface. The current limitation is that it only works if you start at the top left of the group of tiles you wish to dump and finish at the bottom right.

I have mapped it to "ctrl-d" so that it can be left running when not needed and not interfere with any other commands in DF.

To use.

  • Go to the top leftmost tile you want to dump from using the k "look around" button
  • Press "ctrl-d" (press q here to quit if you pressed it accidentally)
  • Press shift
  • Using the arrow keys move to the bottomrightmost tile. To cancel press q
  • press return and watch the yellow cross fly about designatin'

The limitation is that only the first two items on each tile's list are set to be dumped but that's not so bad it it?

Anyway, here is the code, for those not in the know install autohotkey, paste the text below into a file named "blockdump.ahk" or something, double click the file so there is a green and white "H" icon in your system tray.


Call this one blockdumpinit.ahk

^d::
RunWait, "blockdumpmain.ahk"
Return


Call this one blockdumpmain.ahk

SetKeyDelay 25
return::
Send k
return
up::
Send w
return
left::
Send a
return
down::
Send s
return
right::
Send d
return
q::
ExitApp
return
shift::
x := 0
y := 1
Loop{
Input, keypress, B, {esc} , w,a,s,d,k,q
if keypress = w
{
y := --y
Send {up}
continue
}else if keypress = s
{
y := ++y
Send {down}
continue
}else if keypress = a
{
x := --x
Send {left}
continue
}else if keypress = d
{
x := ++x
Send {right}
continue
}else if keypress = k 
{
break
}else if keypress = q
{
ExitApp
}
}
y := y / 2
z := y
z := Floor(z)
z := y/z
Send d{NumpadAdd}d
If z = 0
{	
If x = 0
ExitApp
Else{
Loop %x%{
Send {left}d
}ExitApp
}
}If z <> 1
{
Loop %y%{
Loop %x%{
Send {left}d{NumpadAdd}d
}Send {up}d
Loop %x%{
Send {right}d{NumpadAdd}d
}Send {up}d{NumpadAdd}d
}Loop %x%{
Send {left}d{NumpadAdd}d
}
}Else If z = 1
{
y := y + 0.5
Loop %y%{
Loop %x%{
Send {left}d{NumpadAdd}d
}Send {up}d
Loop %x%{
Send {right}d{NumpadAdd}d
}Send {up}d{NumpadAdd}d
}Send d{NumpadSub}d
}ExitApp