Well, I wanted a better way to gauge how hungry / tired / etc my adventurer was. Dwarf Fortress didn't have an in-game HUD element for them, strangely...
Having played around with some of DFHack's lua scripts, I became curious as to how they worked. I noted the relevant variables from full-heal.lua and simply printed them out.
I'd like to think of this as the first of <NaN> milestones for a new player like me to pass by, as I dive deeper into DF's depths.
Advice needed: How do I get this script to automatically update every 1 second? Can it be done without flooding the DFHack window (i.e. unit-reader, wait 1s, clear window, unit-reader, wait 1s, clear window...)?
--Reads exhaustion, hunger, thirst and sleepiness timers, and blood count
local help = [====[
unit-reader
=========
Reads exhaustion, hunger, thirst and sleepiness timers, and blood
count.
]====]
local utils=require('utils')
validArgs = validArgs or utils.invert({
'r',
'help',
'unit'
})
local args = utils.processArgs({...}, validArgs)
if args.help then
print(help)
return
end
if(args.unit) then
unit = df.unit.find(args.unit)
else
unit = dfhack.gui.getSelectedUnit()
end
if not unit then
qerror('Press L, move cursor to unit, press its key, then run this script.')
end
if unit then
print(" ")
print("BLOOD AMOUNT "..unit.body.blood_count)
print(" ")
print("WINDED "..unit.counters.winded)
print("STUNNED "..unit.counters.stunned)
print("CONSCIO "..unit.counters.unconscious)
print("WEBBED "..unit.counters.webbed)
print("PAIN "..unit.counters.pain)
print("NAUSEA "..unit.counters.nausea)
print("DIZZY "..unit.counters.dizziness)
print(" ")
print("PRLYSIS "..unit.counters2.paralysis)
print("FEVER "..unit.counters2.fever)
print("EXHAUST "..unit.counters2.exhaustion)
print("HUNGER "..unit.counters2.hunger_timer)
print("THIRST "..unit.counters2.thirst_timer)
print("SLEEPY "..unit.counters2.sleepiness_timer)
print("VOMIT "..unit.counters2.vomit_timeout)
end