Okay, if it's ruby code that'd explain the differences (I was pretty damned sure it wasn't vanilla C++, but I really have no experience with other languages)
Also, this should be my last question for a while: I'm trying to heal a nerve injury caused by my earlier lack of gloves, and have found this code:
local unit=dfhack.gui.getSelectedUnit()
if unit then
print("Erasing wounds...")
while #unit.body.wounds > 0 do
unit.body.wounds:erase(#unit.body.wounds-1)
end
unit.body.wound_next_id=1
print("Refilling blood...")
unit.body.blood_count=unit.body.blood_max
print("Resetting status flags...")
unit.status2.limbs_stand_count=unit.status2.limbs_stand_max
unit.status2.limbs_grasp_count=unit.status2.limbs_grasp_max
unit.flags2.has_breaks=false
unit.flags2.gutted=false
unit.flags2.circulatory_spray=false
unit.flags2.vision_good=true
unit.flags2.vision_damaged=false
unit.flags2.vision_missing=false
unit.flags2.breathing_good=true
unit.flags2.breathing_problem=false
unit.flags2.calculated_nerves=false
unit.flags2.calculated_bodyparts=false
print("Resetting counters...")
unit.counters.winded=0
unit.counters.stunned=0
unit.counters.unconscious=0
unit.counters.webbed=0
unit.counters.pain=0
unit.counters.nausea=0
unit.counters.dizziness=0
unit.counters2.paralysis=0
unit.counters2.fever=0
unit.counters2.exhaustion=0
unit.counters2.hunger_timer=0
unit.counters2.thirst_timer=0
unit.counters2.sleepiness_timer=0
unit.counters2.vomit_timeout=0
end
It seems fine, but when I try to run it, I get:
E: SyntaxError: (eval):4:in 'load': ./hack/scripts/healunit.rb:5: syntax error, unexpected '(', expecting kDO_COND or ':' or '\n' or ';'
unit.body.wounds:erase(#unit.body.wounds-1)
^
I've tried removing the hash symbol, changing the hash symbol to a colon, changing the bracket to a colon, and placing a colon in front of the bracket, nothing worked. What exactly do I need to do here?