Is there a script or plugin for exporting and importing stockpile settings?
There are a Falconne plugin that enables you to copy the settings of a stockpile, no import/export however, and I am not sure if it has been migrated to 40.xx.
Maybe your best option at the moment for exporting and importing your stockpile settings is to define some aliases for quickfort by joelpt in Dwarf Fortress macro format, and then use quickfort query phase to place your stockpiles.
Some examples of defined stockpile aliases taken from my modified aliases.txt file in the config directory of the quickfort utility
##################################
# food stockpile adjustments
##################################
seeds: s{Down}deb{Right}{Down 9}p^
noseeds: s{Down}dea{Right}{Down 9}f^
booze: s{Down}deb{Right}{Down 5}p{Down}p^
food: s{Down}dea{Right}{Down 5}f{Down}f{Down 3}f^
plants: s{Down}deb{Right}{Down 4}p^
PreparedFoods: s{down}debu^
plantsandseeds: s{Down}deb{Right}{Down 4}p{Down 5}p^
cookableSolids: s{Down}debu{Right}p{Down}p{Down 2}p{Down 5}p{Down}p{Down}p{Down}f{Right}&{Down}&{Down 2}&{Down 5}&{left}{Down 4}p{Right}{up}&{left}{Down 2}{Right}sroy&&{Down}&^
Some examples using the defined stockpile aliases in a quickfort designation:
#place Place a food stockpile
` ` ` ` #
` ` ` ` #
` f(2x1)#
` ` ` ` #
# # # # #
This illustration may be a little hard to understand. The f(2x1) is in column 2, row 3. All the other cells are empty. QF considers both ` and ~ characters within cells to be empty cells; this can help with multilayer or fortresswide blueprint layouts as 'chalk lines'.
With f(2x1), we've asked QF to place a Food stockpile 2 units wide by 1 high unit, or f(2x1). QF sends the necessary keys to resize the placement region. This also works properly in all modes, including build mode (floors Cf(10x10), bridges ga(4x4), etc. that are sized with UMKH keys).
Note that the f(2x1) syntax isn't actually necessary here; we could have just used:
#place Place a food stockpile
` ` ` ` #
` ` ` ` #
` f f ` #
` ` ` ` #
# # # # #
QF2 is smart enough to recognize this as a 2x1 food stockpile, and creates it as such rather than as two 1x1 food stockpiles. This applies to most cases where f(WxH) could also be used. The f(WxH) style can still be useful in cases where the layout would be ambiguous; consider an L-shaped food stockpile(s).
Lastly, let's turn the bed into a bedroom, and set the food stockpile to hold only booze.
#query
` ` ` ` #
` r+` ` #
` booze #
` ` ` ` #
# # # # #
In column 2, row 2 we have "r+". This sends r+ keys to DF when the cursor is over the bed, causing us to 'make room' and then increase its size to ensure the 'room' fills the entire area.
In column 2, row 3 we have "booze". booze is an alias keyword defined in the included config/aliases.txt file. This particular alias sets a food stockpile to carry booze only, by sending the commands needed to navigate DF's stockpile settings menu.
The included Blueprints/Examples/bedroom-*.csv files provide a good simple example of a 4-layer QF blueprint. Check out aliases.txt for some helpful starting aliases. Blueprints/TheQuickFortress/ provides a good detailed set of examples covering some more complex designs.
# Various aliases to simplify repetitive tasks, such as adjusting a food stockpile to accept seeds only.
# Making new aliases like this is just a matter of mimicking the keys to navigate through the menus, etc.
# Aliases also work with the Alt+T interface.
#
# Syntax:
# aliasname: keystrokes
#
# Special keys:
# {Right}, {Left}, {Up}, {Down}, >, < move the DF cursor
# {/}, {*}, {+}, {-} can be used to navigate some DF menus
# {Enter}, +{Enter}, {ExitMenu} send Enter, Shift+Enter, Escape
# {Wait} pauses playback briefly (ignored in DF macros)
#
# Some shorthand:
# & expands to {Enter}
# @ expands to +{Enter}
# ^ expands to {ExitMenu}
# % expands to {Wait}
#
# The below aliases were created and tested in DF 0.31.25 on 2011 Apr 5.
##################################
# food stockpile adjustments
##################################
seeds: s{Down}deb{Right}{Down 9}p^
noseeds: s{Down}dea{Right}{Down 9}f^
booze: s{Down}deb{Right}{Down 5}p{Down}p^
food: s{Down}dea{Right}{Down 5}f{Down}f{Down 3}f^
plants: s{Down}deb{Right}{Down 4}p^
PreparedFoods: s{down}debu^
plantsandseeds: s{Down}deb{Right}{Down 4}p{Down 5}p^
cookableSolids: s{Down}debu{Right}p{Down}p{Down 2}p{Down 5}p{Down}p{Down}p{Down}f{Right}&{Down}&{Down 2}&{Down 5}&{left}{Down 4}p{Right}{up}&{left}{Down 2}{Right}sroy&&{Down}&^
##################################
# refuse stockpile adjustments
##################################
corpses: s{Down 4}deb{Right 2}&{Down 2}&{Left}{Down}p{Down}p^
bones: s{Down 4}deb{Right}{Down 3}p{Down}p^
rawhides: s{Down 4}deb{Right 2}{Down}&^
tannedhides: s{Down 4}deb{Right 2}{Down 53}&^
refuse: s{Down 4}deb{Right}{Down 3}&{Down}&{Down}&{Down}&{Down}&{Down}&^
bodyParts: s{Down 4}deb{Right}&{Down 2}&^
tcorpses:^
##################################
# stone stockpile adjustments
##################################
metal: s{Down 5}deb{Right}p^
nometal: s{Down 5}dea{Right}f^
bauxite: s{Down 5}deb{Right}{Down 2}{Right}{Down 42}&^
# Only use nobauxite on stone piles that you want to accept all "Other Stone" on.
# This alias works by permitting all "Other Stone",then forbidding just bauxite.
# Thus you wouldn't want to use this on a metal-only pile, for example.
nobauxite: s{Down 5}{Right}{Down 2}p{Right}{Down 42}&^
##################################
# misc stockpile adjustments
##################################
# Artifacts-only stockpile, usable on any type of existing pile.
artifacts: sd{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down}d{Down 4}deu{Right}{Up}f{Right}{Up}&{Left 2}{Down 4}e{Right}{Up}f{Right}{Up}&{Left 2}{Down 4}e{Right}{Up}f{Right}{Up}&{Left 2}{Down 4}e{Right}{Up}f{Right}{Up}&{Left 2}{Down}e{Right}{Up}f{Right}{Up}&{Left 2}^
# Bans artifacts on any pile (or rather, allows items of any quality except Artifact quality).
# This should be safe to run on any type of pile.
noartifacts: sd{Down 2}{Right}{Up}fp{Right}{Up}&{Down 2}{Left 2}{Down 4}{Right}{Up}fp{Right}{Up}&{Down 2}{Left 2}{Down 4}{Right}{Up}fp{Right}{Up}&{Down 2}{Left 2}{Down 4}{Right}{Up}fp{Right}{Up}&{Down 2}{Left 2}{Down}{Right}{Up}fp{Right}{Up}&{Down 2}{Left 2}^
# Set a finished goods stockpile to crappy low-quality trade goods only.
# Position such a stockpile near fort entrances to (hopefully) let thieves steal low quality junk.
junkgoods: s{Down 10}de{Right 2}&{Down 5}&{Down}&{Down}&{Down}&{Down 8}&{Down 2}&{Down}&{Down}&{Down}&{Down}&{Down}&{Left}{Down}f{Right}{Down}&{Down}&{Left}{Down}f{Down 2}f{Right}&{Down}&^
##################################
# farm plots
##################################
# Sets a farm plot to grow the LAST type of seed in the list of available seeds, for all 4 seasons.
# The last seed is used because it's usually Plump helmet spawn, suitable for post-embark. If you
# only have 1 seed type, that'll be grown.
growlastcropall: a{/}&b{/}&c{/}&d{/}&
# Like growlastcropall but grows the first one in the list instead.
growfirstcropall: a&b&c&d&
##################################
# mining tracks
##################################
# The following aliases make it more convenient to build the various types of mine tracks.
# For example, to build a north/south track 'Track (NS)', you would put trackNS in a cell(s).
trackN: CT{Enter}
trackS: CT{+ 1}{Enter}
trackE: CT{+ 2}{Enter}
trackW: CT{+ 3}{Enter}
trackNS: CT{+ 4}{Enter}
trackNE: CT{+ 5}{Enter}
trackNW: CT{+ 6}{Enter}
trackSE: CT{+ 7}{Enter}
trackSW: CT{+ 8}{Enter}
trackEW: CT{+ 9}{Enter}
trackNSE: CT{+ 10}{Enter}
trackNSW: CT{+ 11}{Enter}
trackNEW: CT{+ 12}{Enter}
trackSEW: CT{+ 13}{Enter}
trackNSEW: CT{+ 14}{Enter}
trackrampN: CT{+ 15}{Enter}
trackrampS: CT{+ 15}{+ 1}{Enter}
trackrampE: CT{+ 15}{+ 2}{Enter}
trackrampW: CT{+ 15}{+ 3}{Enter}
trackrampNS: CT{+ 15}{+ 4}{Enter}
trackrampNE: CT{+ 15}{+ 5}{Enter}
trackrampNW: CT{+ 15}{+ 6}{Enter}
trackrampSE: CT{+ 15}{+ 7}{Enter}
trackrampSW: CT{+ 15}{+ 8}{Enter}
trackrampEW: CT{+ 15}{+ 9}{Enter}
trackrampNSE: CT{+ 15}{+ 10}{Enter}
trackrampNSW: CT{+ 15}{+ 11}{Enter}
trackrampNEW: CT{+ 15}{+ 12}{Enter}
trackrampSEW: CT{+ 15}{+ 13}{Enter}
trackrampNSEW: CT{+ 15}{+ 14}{Enter}
# Aliases for building track rollers; use e.g. rollerHqqq to make a low-speed horizontal roller
rollerH: Mrs
rollerV: Mr
# Aliases for building track stops that dump in each of the four directions
trackstopN: CSd
trackstopS: CSdd
trackstopE: CSddd
trackstopW: CSdddd