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

From Dwarf Fortress Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
== Dump Macro ==
 
== Dump Macro ==
  
<!-- 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 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-return" so that it can be left running when not needed and not interfere with any other commands in DF.
+
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.
 
To use.
* Go to the top leftmost square you want to dump using the k "look around" button
+
* Go to the top leftmost tile you want to dump from using the k "look around" button
* Press "ctrl-return"
+
* Press "ctrl-d" (press q here to quit if you pressed it accidentally)
* Using w a s d, move the yellow cross to the bottom rightmost square of things you wish to dump. To cancel press q
+
* Press shift
* press k
+
* Using the arrow keys move to the bottomrightmost tile. To cancel press q
 +
* press return and watch the yellow cross fly about designatin'
  
The limitations are that only the first two items on each tile's list are set to be dumped. Also, it seems non-trivial to map this to the arrow keys rather than w a s d but that's not so bad right?
+
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?
  
Here is the code, for those not in the know [http://www.autohotkey.com 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.
+
Anyway, here is the code, for those not in the know [http://www.autohotkey.com 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'''
 +
<pre>
 +
^d::
 +
RunWait, "blockdumpmain.ahk"
 +
Return
 +
</pre>
 +
 
 +
 
 +
'''Call this one blockdumpmain.ahk'''
 +
<pre>
 +
SetKeyDelay 25
 +
+up::
 +
Send {up 10}
 +
return
 +
+left::
 +
Send {left 10}
 +
return
 +
+down::
 +
Send {down 10}
 +
+right::
 +
Send {right 10}
 +
return
 +
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
 +
</pre>
 +
 
 +
 
 +
<!--
 
   
 
   
 
----
 
----

Revision as of 17:10, 22 January 2008

Dump Macro

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
+up::
Send {up 10}
return
+left::
Send {left 10}
return
+down::
Send {down 10}
+right::
Send {right 10}
return
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