I'm trying to use a sheet worker script to total up the value of a calculated attribute ("skilltotal") from the repeating fieldset below. Ideally, the total should update whenever the user updates the "skill-ap" attribute. The final result should be output to the "Skillstotal" attribute. <h3 align="left">Skills [<input type="text" name="attr_Skillstotal" style="width:50px" value="0" readonly/>]</h3>
<fieldset class="repeating_skills">
<div class="sheet-row" align="left" style="height:auto">
<div class="sheet-col" width="25px">
<button type='roll' style="width:15px; height:15px" value='!power {{ --name|@{character_name}: @{skillname} --leftsub|AV @{skill-ap}/EV ?{EV|Strength, @{tstrength}|Will, @{tintelligence}|Aura, @{taura}} --rightsub|OV ?{OV|11}/RV ?{RV|11} --TN|[[@{skill-ap}-?{OV}+11]] --Result|[[?{EV}-?{RV}+([[2d10!!cf0cs0]]-11+floor((?{EV})/6))]] RAPs}}' name='roll_skill'></button>
</div>
<div class="sheet-col" style="width:260px">
<textarea class="sheet-skillnames" type="text" name="attr_skillname" style="width:233px; height:13px; overflow:hidden;"/></textarea>
</div>
<div class="sheet-col" style="width:50px">
<input type="number" class="sheet-skills" name="attr_skill-ap" style="width:50px; height:23px" value="1"/>
</div>
<div class="sheet-col" style="width:50px">
<input type="number" class="sheet-skills" name="attr_skill-base" style="width:50px; height:23px" value="5"/>
</div>
<div class="sheet-col" style="width:50px">
<input type="number" class="sheet-skills" name="attr_skill-factor" style="width:50px; height:23px" value="1"/>
</div>
<div class="sheet-col" style="width:50px">
<input type="number" class="sheet-skills" name="attr_skilllevel" style="width:50px; height:23px" value="[[@{skill-base}+(@{skill-ap}*@{skill-factor})]]" disabled="disabled"/>
</div>
<div class="sheet-col">
<input type='checkbox' class='controller' name='attr_controller' value='1'>
<div class='container'>
<span class='sizer' name='attr_skilldesc'></span>
<textarea class='visible' name='attr_skilldesc' style='width:250px'></textarea>
</div>
</div>
</div>
</fieldset> Here is the sheet worker script code: on("change:repeating_skills:skill-ap remove:repeating_skills", function() {
getSectionIDs("repeating_skills", function(IDArray) {
let fieldNames = [];
for (var i=0; i < IDArray.length; i++) {
fieldNames.push("repeating_skills_" + IDArray[i] + "_skilllevel");
}
let total = 0;
getAttrs(fieldNames, function(values) {
for (var i=0; i < IDArray.length; i++) {
total += parseInt(values["repeating_skills_" + IDArray[i] + "_skilllevel"])||0;
}
setAttrs({
skillstotal:total
});
});
});
}); Thanks in advance for any suggestions or help anyone can give!