Skip to content

Commit df2c685

Browse files
Move base scripts
1 parent e9d6e58 commit df2c685

54 files changed

Lines changed: 715 additions & 37 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ban-cooking.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# convenient way to ban cooking categories of food
2+
=begin
3+
4+
ban-cooking
5+
===========
6+
A more convenient way to ban cooking various categories of foods than the
7+
kitchen interface. Usage: ``ban-cooking <type>``. Valid types are ``booze``,
8+
``honey``, ``tallow``, ``oil``, and ``seeds`` (non-tree plants with seeds).
9+
10+
=end
211

312
already_banned = {}
413
kitchen = df.ui.kitchen

binpatch.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
-- Apply or remove binary patches at runtime.
2+
--[[=begin
3+
4+
binpatch
5+
========
6+
Implements functions for in-memory binpatches. See `binpatches`.
7+
8+
=end]]
29

310
local bp = require('binpatch')
411

brainwash.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
-- This script will brainwash a dwarf, modifying their personality
22
-- usage is: target a unit in DF, and execute this script in dfhack
33
-- by vjek
4+
--[[=begin
5+
6+
brainwash
7+
=========
8+
Modify the personality traits of the selected dwarf to match an 'ideal'
9+
personality - as stable and reliable as possible. This makes dwarves very
10+
stable, preventing tantrums even after months of misery.
11+
12+
=end]]
413

514
function brainwash_unit(profile)
615
local i,unit_name

burial.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
-- allows burial in unowned coffins
22
-- by Putnam https://gist.github.com/Putnam3145/e7031588f4d9b24b9dda
3+
--[[=begin
4+
5+
burial
6+
======
7+
Sets all unowned coffins to allow burial. ``burial -pets`` also allows burial
8+
of pets.
9+
10+
=end]]
311

412
local utils=require('utils')
513

create-items.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
11
# create first necessity items under cursor
2+
=begin
3+
4+
create-items
5+
============
6+
Spawn items under the cursor, to get your fortress started.
7+
8+
The first argument gives the item category, the second gives the material,
9+
and the optionnal third gives the number of items to create (defaults to 20).
10+
11+
Currently supported item categories: ``boulder``, ``bar``, ``plant``, ``log``,
12+
``web``.
13+
14+
Instead of material, using ``list`` makes the script list eligible materials.
15+
16+
The ``web`` item category will create an uncollected cobweb on the floor.
17+
18+
Note that the script does not enforce anything, and will let you create
19+
boulders of toad blood and stuff like that.
20+
However the ``list`` mode will only show 'normal' materials.
21+
22+
Examples::
23+
24+
create-items boulders COAL_BITUMINOUS 12
25+
create-items plant tail_pig
26+
create-items log list
27+
create-items web CREATURE:SPIDER_CAVE_GIANT:SILK
28+
create-items bar CREATURE:CAT:SOAP
29+
create-items bar adamantine
30+
31+
=end
232

333
category = $script_args[0] || 'help'
434
mat_raw = $script_args[1] || 'list'

deathcause.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# show death cause of a creature
2+
=begin
3+
4+
deathcause
5+
==========
6+
Select a body part ingame, or a unit from the :kbd:`u` unit list, and this
7+
script will display the cause of death of the creature.
8+
9+
=end
210

311
def display_death_event(e)
412
str = "The #{e.victim_hf_tg.race_tg.name[0]} #{e.victim_hf_tg.name} died in year #{e.year}"

dfusion.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
-- a collection of misc lua scripts
2+
--[[=begin
3+
4+
dfusion
5+
=======
6+
Interface to a lecacy script system.
7+
8+
=end]]
9+
210
local dfu=require("plugins.dfusion")
311
local myos=dfhack.getOSType()
412
args={...}

digfort.rb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
# designate an area for digging according to a plan in csv format
2+
=begin
3+
4+
digfort
5+
=======
6+
A script to designate an area for digging according to a plan in csv format.
7+
8+
This script, inspired from quickfort, can designate an area for digging.
9+
Your plan should be stored in a .csv file like this::
10+
11+
# this is a comment
12+
d;d;u;d;d;skip this tile;d
13+
d;d;d;i
14+
15+
Available tile shapes are named after the 'dig' menu shortcuts:
16+
``d`` for dig, ``u`` for upstairs, ``d`` downstairs, ``i`` updown,
17+
``h`` channel, ``r`` upward ramp, ``x`` remove designation.
18+
Unrecognized characters are ignored (eg the 'skip this tile' in the sample).
19+
20+
Empty lines and data after a ``#`` are ignored as comments.
21+
To skip a row in your design, use a single ``;``.
22+
23+
One comment in the file may contain the phrase ``start(3,5)``. It is interpreted
24+
as an offset for the pattern: instead of starting at the cursor, it will start
25+
3 tiles left and 5 tiles up from the cursor.
26+
27+
The script takes the plan filename, starting from the root df folder (where
28+
``Dwarf Fortress.exe`` is found).
29+
30+
=end
231

332
fname = $script_args[0].to_s
433

drain-aquifer.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
-- Remove all aquifers from the map
2+
--[[=begin
3+
4+
drain-aquifer
5+
=============
6+
Remove all 'aquifer' tag from the map blocks. Irreversible.
7+
8+
=end]]
29

310
local function drain()
411
local layers = {}

elevate-mental.lua

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
-- This script will elevate all the mental attributes of a unit
2-
-- usage is: target a unit in DF, and execute this script in dfhack
3-
-- all physical attributes will be set to whatever the max value is
42
-- by vjek
3+
--[[=begin
4+
5+
elevate-mental
6+
==============
7+
Set all mental attributes of the selected dwarf to 2600, which is very high.
8+
Numbers between 0 and 5000 can be passed as an argument: ``elevate-mental 100``
9+
for example would make the dwarf very stupid indeed.
10+
11+
=end]]
512

613
function ElevateMentalAttributes(value)
714
unit=dfhack.gui.getSelectedUnit()

0 commit comments

Comments
 (0)