forked from DFHack/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathungeld.lua
36 lines (27 loc) · 770 Bytes
/
ungeld.lua
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
-- Ungelds animals
-- Written by Josh Cooper(cppcooper) on 2019-12-10, last modified: 2020-02-23
utils = require('utils')
local validArgs = utils.invert({
'unit',
'help',
})
local args = utils.processArgs({...}, validArgs)
local help = [====[
ungeld
======
A wrapper around `geld` that ungelds the specified animal.
Valid options:
``-unit <id>``: Ungelds the unit with the specified ID.
This is optional; if not specified, the selected unit is used instead.
``-help``: Shows this help information
]====]
if args.help then
print(help)
return
end
local geld_args = {'-ungeld'}
if args.unit then
table.insert(geld_args, '-unit')
table.insert(geld_args, args.unit)
end
dfhack.run_script('geld', table.unpack(geld_args))