I am using the OneClick ChatSetAttr and I have useWorkers enabled, but my sheetworkers do not get triggered. I can see that the value is updated in the sheet, but dependent attributes do not change. If I manually change the value in the sheet, the workers trigger and work as expected.
What kind of things can make ChatSetAttr not trigger sheetworkers? I am using a custom character sheet, and while I am not asking you to troubleshoot my code, I don't think I am doing anything too egregiously wrong.
As an example, I add some coins to a character, and I see the coin value change on the sheet, but the coin_weight attribute does not update.
ChatSetAttr command
!modattr --fb-public --sel --gold_carried|50
HTML
<span class="tablecell w055">
<input type="text" class="inputbox w051" name="attr_gold_carried" title="gold_carried" maxlength="5" value="0">
</span>
<span class="tablecell w094">
<input type="text" class="inputbox w072 readonly" name="attr_coin_weight" title="coin_weight" value="0" readonly>
</span>
Sheetworker Code
on("sheet:opened change:copper_carried change:silver_carried change:gold_carried change:platinum_carried", function() {
var coins = 0;
getAttrs(["copper_carried", "silver_carried", "gold_carried", "platinum_carried"], function(values) {
let cp = parseInt(values["copper_carried"],10) || 0;
let sp = parseInt(values["silver_carried"],10) || 0;
let gp = parseInt(values["gold_carried"],10) || 0;
let pp = parseInt(values["platinum_carried"],10) || 0;
coins = (coins + ((cp + sp + gp + pp) / 50)).toFixed(2);
setAttrs({
coin_weight: coins
});
});
});
I do have many other sheetworkers, but the above is the only one related to the gold_carried attribute. Any suggestions for things to look for in the console? Thanks for any advice!