
Recently decided to brave the Sheet Worker as its very versatile, I've familiarised myself with its parts and the terminology (thank you w3schools), played with the examples and got it working! Great! ...problem, I then tried to write my own, and it's refusing to function. What have I missed here? <div class='sheet-mod-grid'>
<label class='sheet-extra-attack-title'>EXTRA ACTION</label><input type="number" name="attr_extra_action"><br />
<label class='sheet-joint-title'>JOINT (DUAL WIELD)</label><input type="number" name="attr_joint">
</div>
<div class='sheet-grid-item'>
<input name='attr_mod_total' class='sheet-mod-total' type="number" value='@{mod_total}' disabled='true'>
</div>
<!-- SHEET WORKER -->
<script type="text/worker">
on("sheet:opened change:extra_action change:joint", function() {
getAttrs(["extra_action", "joint"], function(values) {
var extra_action = parseInt(values["extra_action"],10)||0;
var joint = parseInt(values["joint"],10)||0;
var output = extra_action + joint;
setAttrs({
"mod_total": output
});
});
});
</script>
<!-- END OF SHEET WORKER -->