What does
while #unit.body.wounds > 0 do
unit.body.wounds:erase(#unit.body.wounds-1)
end
do?
I've been fooling around with one of those dwarves who's been injured and subsequently ignored, and my initial method of doing so was to pare down the fullheal script and force the dwarf unconscious for a while. This seemed to work, so I set about removing the mysterious parts of fullheal that I'd previously ignored. Doing this resulted in a script that KO'd the dwarf as before (allowing them to be fed and watered), but who went right back to lying about once they regained consciousness.
A script that's just
local unit=dfhack.gui.getSelectedUnit()
while #unit.body.wounds > 0 do
unit.body.wounds:erase(#unit.body.wounds-1)
end
gets the layabout dwarf up and eating and drinking and sleeping, but due to her injuries she was still crawling around. An attempt to reinjure her by standing her on a raising bridge resulted in the old wounds vanishing and being replaced by the bruising caused by the bridge throw.
So, I'm guessing that that bit of code erases all wounds, but doesn't actually
do anything about the consequences of those wounds until a round of combat happens.
What I'm really trying for here is a script that either makes the dwarf take a Rest job, or gets another dwarf to rescue them. One thing I picked up on is that dwarves in this state have a negative unconsciousness count... I think.