I'm building a character sheet (and this isn't my first question), where I have radios disguised as checkboxes that fill from left to right. Works pretty well, unless I try to use the same attribute twice (or more) on the sheet (since I want to have the bloodpool ressource in different places). I figured that it could be possible to have the pools in different places save in different Attributes (e.g. bloodpool1 and bloodpool2) and then use a sheetworker whenever one changes, to change the other one as well as the "right" bloodpool linked to a hidden input (for use with tokens). I'm not a good programmer and have only a little experience with Java from years ago, but I wrote (copied together) simple sheetworker scripts. So I tried my idea and came up to this: const bloodlist = ["bloodpool1, bloodpool2"];
bloodlist.forEach(pool => {
on(`change:${pool}`, function() {
getAttr([pool], function(values) {
let bp = values[pool];
bloodlist.forEach(function(bpool) {
setAttr({
bpool: bp
});
});
setAttr({
bloodpool: bp
});
});
});
}); (yeah I'm not happy with variable names either, but it isn't so long...) And.. it doesn't work. Since I have almost no experience in webdevelopment, my debugging skills are also almost nonexistant for this application. Since I know here are wizards and mighty geniuses, I'm bothering you, so please help! P.S.: I'm not quite sure, but might it be that this little script creates an endless loop? If so there must be a failsafe since my browser didn't implode