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.

Editing User:Valdemar/Bedroom Macro

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.


The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
For instructions, go back to [[User:Valdemar]]
 
For instructions, go back to [[User:Valdemar]]
==bedroom.ini==
 
<pre>
 
[rooms]
 
; Width of your bedrooms
 
width          = 3   
 
; Height of your bedroom
 
height        = 3   
 
; Number of bedrooms placed per row
 
number_per_row = 5   
 
; Number of rows placed
 
number_of_rows = 1   
 
; Directions rooms will be built (right, left)
 
build_dir      = right
 
; Directions rows will be build (down, up)
 
row_dir        = down 
 
 
 
[doors]
 
; (yes, no)
 
enable_doors  = yes   
 
; Direction doors will be in (left, right, top, bottom)
 
door_dir      = bottom
 
; Column doors will be in
 
door_pos      = 2 
 
</pre>
 
==bedroom.ahk==
 
 
<pre>
 
<pre>
 +
GoSub PromptBox
 
SetKeyDelay 5
 
SetKeyDelay 5
 +
$+!R::
 +
    GoSub PromptBox
 +
return
 
$!R::
 
$!R::
    GoSub Read
+
     Loop %numrow%
     Loop %numrows%
 
 
     {
 
     {
 
         Loop %number%
 
         Loop %number%
 
         {
 
         {
             if(builddir=="right")
+
             if builddir = 1
 
             {
 
             {
 
                 Send {Enter}{Right %width%}{Down %height%}{Enter}
 
                 Send {Enter}{Right %width%}{Down %height%}{Enter}
                 if(enabledoors="yes")
+
                 if enabledoors=1
 
                 {
 
                 {
                     if(doordir="bottom")
+
                     if doordir=1
 
                         Send {Down}{Left %doorpos2%}{Enter 2}{Right %doorpos2%}{Up}
 
                         Send {Down}{Left %doorpos2%}{Enter 2}{Right %doorpos2%}{Up}
                     if(doordir="top")
+
                     if doordir=2
 
                         Send {Up %height%}{Up}{Left %doorpos2%}{Enter 2}{Right %doorpos2%}{Down %height%}{Down}
 
                         Send {Up %height%}{Up}{Left %doorpos2%}{Enter 2}{Right %doorpos2%}{Down %height%}{Down}
                     if(doordir="right")
+
                     if doordir=3
 
                         Send {Up %doorpos2%}{Right}{Enter 2}{Down %doorpos2%}{Left}
 
                         Send {Up %doorpos2%}{Right}{Enter 2}{Down %doorpos2%}{Left}
                     if(doordir="left")
+
                     if doordir=4
 
                         Send {Left %width%}{Left}{Up %doorpos2%}{Enter 2}{Down %doorpos2%}{Right %width%}{Right}
 
                         Send {Left %width%}{Left}{Up %doorpos2%}{Enter 2}{Down %doorpos2%}{Right %width%}{Right}
 
                 }
 
                 }
 
                 Send {Right 2}{Up %height%}   
 
                 Send {Right 2}{Up %height%}   
 
             }
 
             }
             if(builddir=="left")
+
             if builddir = 2
 
             {
 
             {
 
                 Send {Enter}{Left %width%}{Down %height%}{Enter}
 
                 Send {Enter}{Left %width%}{Down %height%}{Enter}
                 if(enabledoors="yes")
+
                 if enabledoors=1
 
                 {
 
                 {
                     if(doordir="bottom")
+
                     if doordir=1
 
                         Send {Down}{Right %doorpos2%}{Enter 2}{Left %doorpos2%}{Up}
 
                         Send {Down}{Right %doorpos2%}{Enter 2}{Left %doorpos2%}{Up}
                     if(doordir="top")
+
                     if doordir=2
 
                         Send {Up %height%}{Up}{Right %doorpos2%}{Enter 2}{Left %doorpos2%}{Down %height%}{Down}
 
                         Send {Up %height%}{Up}{Right %doorpos2%}{Enter 2}{Left %doorpos2%}{Down %height%}{Down}
                     if(doordir="left")
+
                     if doordir=4
 
                         Send {Up %doorpos2%}{Left}{Enter 2}{Down %doorpos2%}{Right}
 
                         Send {Up %doorpos2%}{Left}{Enter 2}{Down %doorpos2%}{Right}
                     if(doordir="right")
+
                     if doordir=3
 
                         Send {Right %width%}{Right}{Up %doorpos2%}{Enter 2}{Down %doorpos2%}{Left %width%}{Left}
 
                         Send {Right %width%}{Right}{Up %doorpos2%}{Enter 2}{Down %doorpos2%}{Left %width%}{Left}
 
                 }
 
                 }
Line 67: Line 44:
 
             }
 
             }
 
         }
 
         }
         if(builddir=="right")
+
         if builddir = 1
 
             Send {Left %backnum%}
 
             Send {Left %backnum%}
         if(builddir=="left")
+
         if builddir = 2
 
             Send {Right %backnum%}
 
             Send {Right %backnum%}
         if(rowdir=="down")
+
         if rowdir = 1
 
             Send {Down %height%}{Down 2}
 
             Send {Down %height%}{Down 2}
         if(rowdir=="up")
+
         if rowdir = 2
 
             Send {Up %height%}{Up 2}
 
             Send {Up %height%}{Up 2}
 
     }
 
     }
 
return
 
return
  
 
+
PromptBox:
Read:
+
InputBox, width, Width, Width of Rooms
    IniRead, width, bedroom.ini, rooms, width
+
InputBox, height, Height, Height of Rooms
    IniRead, height, bedroom.ini, rooms, height
+
InputBox, number, Rows, Number of rooms in each row
    IniRead, number, bedroom.ini, rooms, number_per_row
+
InputBox, numrow, Columns, Number of rows to create
    IniRead, numrows, bedroom.ini, rooms, number_of_rows
+
backnum := number * (width +1)
    IniRead, builddir, bedroom.ini, rooms, build_dir
+
InputBox, builddir, Direction, Direction to build 1=left to right 2=right to left
    IniRead, rowdir, bedroom.ini, rooms, row_dir
+
InputBox, rowdir, Row Direction, Direction to build rows in 1=top to bottom 2=bottom to top
    IniRead, enabledoors, bedroom.ini, doors, enable_doors
+
InputBox, enabledoors, Doors, Do you want to automatically add doors? 0=no 1=yes
     IniRead, doordir, bedroom.ini, doors, door_dir
+
if enabledoors=1
     IniRead, doorpos, bedroom.ini, doors, door_pos
+
{
    backnum := number * (width +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
 
     doorpos2 := width - doorpos
    width := width-1
+
}
    height := height-1
+
width := width-1
 +
height := height-1
 
return
 
return
 
</pre>
 
</pre>

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)