-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlabor-all.lua
More file actions
142 lines (136 loc) · 4.21 KB
/
labor-all.lua
File metadata and controls
142 lines (136 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
-- Assign all labors to all active dwarves
-- by vjek
--[====[
labor-all
=============
assign all dwarves all labors, minus hunting & fishing, and assign one dwarf to cut wood
]====]
function labor_all(unit)
if unit==nil then
print ("No unit available! Aborting with extreme prejudice.")
return
end
for key,v in pairs(unit.status.labors) do
if tonumber(key) then
break
elseif key == "CUTWOOD" then
unit.status.labors.CUTWOOD = false
elseif key == "HUNT" then
unit.status.labors.HUNT = false
elseif key == "FISH" then
unit.status.labors.FISH = false
else
unit.status.labors[key] = true
end
end
end
function adjust_all_dwarves()
for _,v in ipairs(df.global.world.units.all) do
if v.race == df.global.ui.race_id and v.status.current_soul then
print("Adjusting "..dfhack.TranslateName(dfhack.units.getVisibleName(v)))
labor_all(v)
v.military.pickup_flags.update = true
lastdwarf=v
end
end
lastdwarf.status.labors.MINE = false
lastdwarf.status.labors.CUTWOOD = true
lastdwarf.military.pickup_flags.update = true
end
adjust_all_dwarves()
--[====[
MINE = true
HAUL_STONE = true
HAUL_WOOD = true
HAUL_BODY = true
HAUL_FOOD = true
HAUL_REFUSE = true
HAUL_ITEM = true
HAUL_FURNITURE = true
HAUL_ANIMALS = true
CLEAN = true
CUTWOOD = true
CARPENTER = true
DETAIL = true
MASON = true
ARCHITECT = true
ANIMALTRAIN = true
ANIMALCARE = true
DIAGNOSE = true
SURGERY = true
BONE_SETTING = true
SUTURING = true
DRESSING_WOUNDS = true
FEED_WATER_CIVILIANS = true
RECOVER_WOUNDED = true
BUTCHER = true
TRAPPER = true
DISSECT_VERMIN = true
LEATHER = true
TANNER = true
BREWER = true
ALCHEMIST = true
SOAP_MAKER = true
WEAVER = true
CLOTHESMAKER = true
MILLER = true
PROCESS_PLANT = true
MAKE_CHEESE = true
MILK = true
COOK = true
PLANT = true
HERBALIST = true
FISH = true
CLEAN_FISH = true
DISSECT_FISH = true
HUNT = true
SMELT = true
FORGE_WEAPON = true
FORGE_ARMOR = true
FORGE_FURNITURE = true
METAL_CRAFT = true
CUT_GEM = true
ENCRUST_GEM = true
WOOD_CRAFT = true
STONE_CRAFT = true
BONE_CARVE = true
GLASSMAKER = true
EXTRACT_STRAND = true
SIEGECRAFT = true
SIEGEOPERATE = true
BOWYER = true
MECHANIC = true
POTASH_MAKING = true
LYE_MAKING = true
DYER = true
BURN_WOOD = true
OPERATE_PUMP = true
SHEARER = true
SPINNER = true
POTTERY = true
GLAZING = true
PRESSING = true
BEEKEEPING = true
WAX_WORKING = true
HANDLE_VEHICLES = true
HAUL_TRADE = true
PULL_LEVER = true
REMOVE_CONSTRUCTION = true
HAUL_WATER = true
GELD = true
BUILD_ROAD = true
BUILD_CONSTRUCTION = true
PAPERMAKING = true
BOOKBINDING = true
83 = true
84 = true
85 = true
86 = true
87 = true
88 = true
89 = true
90 = true
91 = true
92 = true
93 = true
]====]