Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Trouble updating To Hit Chart on multiply tabs.

I have the same to hit chart on the character tab and the journal tab but it only updates on the character tab. Can someone explain how to get it to update on both tabs. Thanks in advance.  (not full code removed the repeating section.) <script type="text/worker"> const buttonlist = ["character","journal","configuration"]; buttonlist.forEach(button => { on(`clicked:${button}`, function() { setAttrs({ sheetTab: button }); }); }); </script> <script type="text/worker"> //Set Active Defense, Movement, and Description according to the Maneuver value on("sheet:opened change:WeaponSkill", function() { getAttrs(["WeaponSkill", "thws1", "thws2", "thws3", "thws4", "thws5", "thws6", "thws7", "thws8", "thws9", "thws10"], function(value) { if (value.WeaponSkill === " ") { console.log("Setting Archetype and Feature to blank"); setAttrs({thws1: "", thws2: "", thws3: "", thws4: "", thws5: "", thws6: "", thws7: "", thws8: "", thws9: "", thws10: ""}); } else if (value.WeaponSkill === "1") { console.log("Updating To Hit based on weapon skill of 1"); setAttrs({thws1: "4", thws2: "4", thws3: "5", thws4: "6", thws5: "6", thws6: "6", thws7: "6", thws8: "6", thws9: "6", thws10: "6"}); }
1719527989

Edited 1719528106
GiGs
Pro
Sheet Author
API Scripter
I dont see the tabs being used by those workers, so it wouldnt make a difference. Have you tried creating a completely new character and seeing if the same thing is happening there? Also, is there any CSS - you have multiple tabs, is everything visible in each tab? PS: you don't need - and generally shouldnt have - more than one script block. That code can be <script type="text/worker"> const buttonlist = ["character","journal","configuration"]; buttonlist.forEach(button => { on(`clicked:${button}`, function() { setAttrs({ sheetTab: button }); }); }); //Set Active Defense, Movement, and Description according to the Maneuver value on("sheet:opened change:WeaponSkill", function() { getAttrs(["WeaponSkill", "thws1", "thws2", "thws3", "thws4", "thws5", "thws6", "thws7", "thws8", "thws9", "thws10"], function(value) { if (value.WeaponSkill === " ") { console.log("Setting Archetype and Feature to blank"); setAttrs({thws1: "", thws2: "", thws3: "", thws4: "", thws5: "", thws6: "", thws7: "", thws8: "", thws9: "", thws10: ""}); } else if (value.WeaponSkill === "1") { console.log("Updating To Hit based on weapon skill of 1"); setAttrs({thws1: "4", thws2: "4", thws3: "5", thws4: "6", thws5: "6", thws6: "6", thws7: "6", thws8: "6", thws9: "6", thws10: "6" }); } }); }); </script>