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:Valdemar/Bedroom Macro

From Dwarf Fortress Wiki
< User:Valdemar
Revision as of 16:28, 22 November 2007 by Valdemar (talk | contribs) (New page: For instructions, go back to User:Valdemar <pre> GoSub PromptBox SetKeyDelay 5 $+!R:: GoSub PromptBox return $!R:: Loop %numrow% { Loop %number% { ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

For instructions, go back to User:Valdemar

GoSub PromptBox
SetKeyDelay 5
$+!R::
    GoSub PromptBox
return
$!R::
    Loop %numrow%
    {
        Loop %number%
        {
            if builddir = 1
            {
                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 %height%}{Up}{Left %doorpos2%}{Enter 2}{Right %doorpos2%}{Down %height%}{Down}
                    if doordir=3
                        Send {Up %doorpos2%}{Right}{Enter 2}{Down %doorpos2%}{Left}
                    if doordir=4
                        Send {Left %width%}{Left}{Up %doorpos2%}{Enter 2}{Down %doorpos2%}{Right %width%}{Right}
                }
                Send {Right 2}{Up %height%}   
            }
            if builddir = 2
            {
                Send {Enter}{Left %width%}{Down %height%}{Enter}
                if enabledoors=1
                {
                    if doordir=1
                        Send {Down}{Right %doorpos2%}{Enter 2}{Left %doorpos2%}{Up}
                    if doordir=2
                        Send {Up %height%}{Up}{Right %doorpos2%}{Enter 2}{Left %doorpos2%}{Down %height%}{Down}
                    if doordir=4
                        Send {Up %doorpos2%}{Left}{Enter 2}{Down %doorpos2%}{Right}
                    if doordir=3
                        Send {Right %width%}{Right}{Up %doorpos2%}{Enter 2}{Down %doorpos2%}{Left %width%}{Left}
                }
                Send {Left 2}{Up %height%}   
            }
        }
        if builddir = 1
            Send {Left %backnum%}
        if builddir = 2
            Send {Right %backnum%}
        if rowdir = 1
            Send {Down %height%}{Down 2}
        if rowdir = 2
            Send {Up %height%}{Up 2}
    }
return

PromptBox:
InputBox, width, Width, Width of Rooms
InputBox, height, Height, Height of Rooms
InputBox, number, Rows, Number of rooms in each row
InputBox, numrow, Columns, Number of rows to create
backnum := number * (width +1)
InputBox, builddir, Direction, Direction to build 1=left to right 2=right to left
InputBox, rowdir, Row Direction, Direction to build rows in 1=top to bottom 2=bottom to top
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 3=right 4=left
    InputBox, doorpos, Doors, What position should doors be at? 1=first row/column 2=second row/column and so on
    doorpos2 := width - doorpos
}
width := width-1
height := height-1
return