My stupid question of the day: I am trying to change some autocalc on a sheet to using sheetworkers read the wiki however still not getting it to work, First we have .json file for translations Translation json "total-hitpoint": "Total Hitpoint",
"temporary-hitpoint": "Temp. Hitpoint",
"permanent-hitpoint": "Perm. Hitpoint", The code from our html HTML <tr>
<td><span class="label" data-i18n="total-hitpoint">Total Hitpoint</span></td>
<td colspan="2"><input type="number" name="attr_total_hitpoint" class="sheet-center" value="@{permanent_hitpoint}+@{temporary_hitpoint}" disabled="true"></td>
</tr>
<tr>
<td><span class="label" data-i18n="temporary-hitpoint">Temp. Hitpoint</span></td>
<td colspan="2"><input type="number" name="attr_temporary_hitpoint" value="0" class="sheet-center"></td>
</tr>
<tr>
<td><span class="label" data-i18n="permanent-hitpoint">Perm. Hitpoint</span></td>
<td colspan="2"><input type="number" name="attr_permanent_hitpoint" value="0" class="sheet-center"></td>
</tr> Now to change it from a autocalc to sheetworker from my understanding if I read things right. I change HTML <tr>
<td><span class="label" data-i18n="total-hitpoint">Total Hitpoint</span></td>
<td colspan="2"><input type="number" name="attr_total_hitpoint" class="sheet-center" value="0" readonly="true"></td>
</tr>
<tr>
<td><span class="label" data-i18n="temporary-hitpoint">Temp. Hitpoint</span></td>
<td colspan="2"><input type="number" name="attr_temporary_hitpoint" value="0" class="sheet-center"></td>
</tr>
<tr>
<td><span class="label" data-i18n="permanent-hitpoint">Perm. Hitpoint</span></td>
<td colspan="2"><input type="number" name="attr_permanent_hitpoint" value="0" class="sheet-center"></td>
</tr> < script type = " text/worker " > on("change:th change:ph sheet:opened", function() {
getAttrs(["temporary_hitpoint","permanent_hitpoint"], function(values) {
let th = parseInt(values.temporary_hitpoint,10)||0;
let ph = parseInt(values.permanent_hitpoint,10)||0;
let thp = th + ph;
setAttrs({
total_hitpoint: tsp
});
});
}); </ script > but so far thats not working ( I can change the values on the character sheet of temporary _hitpoint and permanent _hitpoint but total_hitpoint is remaining 0 and of course I cant change because it is now readonly but should be updating by sheetworkers if i was correct so what am I doing wrong please.