
I have been altering a sheet for my own use for some time now, and I finally got around to thinking about sheet workers. I don't have a lot of things I would like to automate, and most of them are really simple mathematically. However, I just can't seem to wrap my head around the sheetworker examples on the wiki.
As an example, I would like to take the Physical Strength stat, multiply that stat by 20, and have the result entered as Lift. I have been fiddling with the universal sheetworker code from the wiki. The attribute for Physical Strength is "ps", and the attribute for Lift is "lift".
on("change:ps sheet:opened", function () { getAttrs(['ps'], function (values) { const ps = parseInt(values['ps'], 10)||0; // this extracts the stat, and assumes a stat score of 0 the stat is not recognised as a number. const modifier = Math.(ps*20); setAttrs({ lift: modifier }); }); });
But that doesn't seem to be working for me. I expect I am missing something really simple, but have no idea what it may be. Help?