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:Valdemar"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
 +
__TOC__
 +
 +
==Bedroom-Builder Macro==
 +
This macro will help you build large bedroom complexes. To use, copy-paste the script into a new .ahk file and run it. It will ask you a lot of questions. Most are self-explanatory, but one, door position, is a bit tricky. The number you type will be the column doors are mined out in, 1 being the left-most one.
 +
 +
=====
 +
=...=
 +
=...=
 +
=ABC=
 +
 +
This 3x2 room will have to doors dug out at A if you specify 1, B if you say 2, and C if you say 3.
 +
 +
Pressing Shift-Alt-R allows you to reconfigure the script.
 +
Pressing Alt-R will actually run the script and place the rooms.
 +
 +
I will update the script so you can have doors on the left or right soon.
 +
<pre>
 +
GoSub PromptBox
 +
SetKeyDelay 100
 +
$+!R::
 +
    GoSub PromptBox
 +
return
 +
$!R::
 +
    Loop %number%
 +
    {
 +
        Send {Enter}{Right %width%}{Down %height%}{Enter}
 +
        if enabledoors=1
 +
        {
 +
            if doordir=1
 +
                Send {Down}{Left %doorpos2%}{Enter 2}{Right %doorpos2%}{Up}
 +
            if doordir=2
 +
                Send {Up %width%}{Up}{Left %doorpos2%}{Enter 2}{Right %doorpos2%}{Down %width%}{Down}
 +
        }
 +
        Send {Right 2}{Up %height%}
 +
    }
 +
return
 +
 +
PromptBox:
 +
InputBox, width, Width, Width of Rooms
 +
InputBox, height, Height, Height of Rooms
 +
InputBox, number, Number, Number to create at a time
 +
InputBox, enabledoors, Doors, Do you want to automatically add doors? 0=no 1=yes
 +
if enabledoors=1
 +
{
 +
    InputBox, doordir, Doors, What side should doors be on? 1=bottom 2=top
 +
    InputBox, doorpos, Doors, What position should doors be at? 1=first column 2=second column and so on
 +
    doorpos2 := width - doorpos
 +
}
 +
width := width-1
 +
height := height-1
 +
return
 +
</pre>
 +
 +
 +
 
==Rewall Macro==
 
==Rewall Macro==
 
This is a macro to aid with rewalling. To use, copy-paste the script into a new .ahk file and run the script with AutoHotkey. Then, in Dwarf Fortress, press b-C-w, move the cursor to where you want to start the wall, and hold Ctrl-Shift-Arrowkey, using the direction you want to rewall in. To build floors, press b-C-f instead, and use Ctrl-Alt-Arrowkey. To stop, just release the keys.
 
This is a macro to aid with rewalling. To use, copy-paste the script into a new .ahk file and run the script with AutoHotkey. Then, in Dwarf Fortress, press b-C-w, move the cursor to where you want to start the wall, and hold Ctrl-Shift-Arrowkey, using the direction you want to rewall in. To build floors, press b-C-f instead, and use Ctrl-Alt-Arrowkey. To stop, just release the keys.

Revision as of 03:03, 22 November 2007

Bedroom-Builder Macro

This macro will help you build large bedroom complexes. To use, copy-paste the script into a new .ahk file and run it. It will ask you a lot of questions. Most are self-explanatory, but one, door position, is a bit tricky. The number you type will be the column doors are mined out in, 1 being the left-most one.

=====
=...=
=...=
=ABC=

This 3x2 room will have to doors dug out at A if you specify 1, B if you say 2, and C if you say 3.

Pressing Shift-Alt-R allows you to reconfigure the script. Pressing Alt-R will actually run the script and place the rooms.

I will update the script so you can have doors on the left or right soon.

GoSub PromptBox
SetKeyDelay 100
$+!R::
    GoSub PromptBox
return
$!R::
    Loop %number%
    {
        Send {Enter}{Right %width%}{Down %height%}{Enter}
        if enabledoors=1
        {
            if doordir=1
                Send {Down}{Left %doorpos2%}{Enter 2}{Right %doorpos2%}{Up}
            if doordir=2
                Send {Up %width%}{Up}{Left %doorpos2%}{Enter 2}{Right %doorpos2%}{Down %width%}{Down}
        }
        Send {Right 2}{Up %height%}
    }
return

PromptBox:
InputBox, width, Width, Width of Rooms
InputBox, height, Height, Height of Rooms
InputBox, number, Number, Number to create at a time
InputBox, enabledoors, Doors, Do you want to automatically add doors? 0=no 1=yes
if enabledoors=1
{
    InputBox, doordir, Doors, What side should doors be on? 1=bottom 2=top
    InputBox, doorpos, Doors, What position should doors be at? 1=first column 2=second column and so on
    doorpos2 := width - doorpos
}
width := width-1
height := height-1
return


Rewall Macro

This is a macro to aid with rewalling. To use, copy-paste the script into a new .ahk file and run the script with AutoHotkey. Then, in Dwarf Fortress, press b-C-w, move the cursor to where you want to start the wall, and hold Ctrl-Shift-Arrowkey, using the direction you want to rewall in. To build floors, press b-C-f instead, and use Ctrl-Alt-Arrowkey. To stop, just release the keys.

The script will use the first material in the list. I suggest you create a stockpile near the construction site that only accepts the item you wish to build with and temporarily forbid any nearby materials you don't want to build with.


$^+Left:: ProcessEvent("Left","w")
$^+Right:: ProcessEvent("Right","w")
$^+Up:: ProcessEvent("Up","w")
$^+Down:: ProcessEvent("Down","w")

$^!Left:: ProcessEvent("Left","f")
$^!Right:: ProcessEvent("Right","f")
$^!Up:: ProcessEvent("Up","f")
$^!Down:: ProcessEvent("Down","f")


ProcessEvent(direction, type)
{   
    Send {Enter}
    Sleep 100
    Send {Enter}
    Sleep 100
    Send %type%
    Sleep 100
    Send {%direction%}
    Loop
    {
        if not GetKeyState(direction, "P") 
            break  
        Send {Enter}
        Sleep 100
        Send {Enter}
        Sleep 100
        Send %type%
        Sleep 100
        Send {%direction%}
    }
}