So I put together the current incarnation of the 4e L5R sheet. Some time back, another author went in and edited the code to take out all the script tags I had separating the various sheet workers and place all the sheet workers inside a single open and close set of script tags. This broke the insight calculation code we worked so hard to get right here about a year back. I thought I had it working, but I guess I didn't. And then when I tried to push an update I added a typo and broke all the sheet workers, so I need to push a new update pronto, but I can't get that bugged fixed. Here's what happens. If I put open and closed script tags just around the insight calculation code, and I put a second set of open and closed script tags around all the other sheet workers, it works fine, but I understand from the notes of that other author, that isn't allowed anymore for some reason (not sure why, there was an update or something, I'm not in the loop on that.) But as soon as I take out that close tag and open in the middle so all the code is inside one set of tags all the insight code breaks. The other sheet workers, such as the one that calculate the stats the insight code uses, seem to work fine. Just not that insight code. I'll post the code in question below. Ideas? <script type="text/worker"> // Insight Calculation Worker on("sheet:opened change:Insight", function() { getAttrs(["foo_insight"], function(values) { setAttrs({ foo_rank: Math.max(1,Math.round((values.foo_insight - 112) / 25)) }); }); }); var elements = ['foo_air', 'foo_earth', 'foo_fire', 'foo_water', 'foo_void'], ranks = ['rank_acting', 'rank_artisan', 'rank_calligraphy', 'rank_courtier', 'rank_divination', 'rank_etiquette', 'rank_games', 'rank_investigation', 'rank_lore', 'rank_Lore2', 'rank_Lore3', 'rank_Medicine', 'rank_Meditation', 'rank_Perform', 'rank_Sincerity', 'rank_Spellcraft', 'rank_Tea_Ceremony', 'rank_rhigh', 'rank_Athletics', 'rank_Battle', 'rank_Defense', 'rank_Horsemanship', 'rank_Hunting', 'rank_Iaijutsu', 'rank_Jiujutsu', 'rank_Chain_Weapons', 'rank_Heavy_Weapons', 'rank_Kenjutsu', 'rank_Knives', 'rank_Kyujutsu', 'rank_Ninjutsu', 'rank_Polearms', 'rank_Spears', 'rank_Staves', 'rank_WarFan', 'rank_AnimalHandling', 'rank_Commerce', 'rank_Craft', 'rank_Engineering', 'rank_Sailing', 'rank_Forgery', 'rank_Intimidation', 'rank_SleightofHand', 'rank_Stealth', 'rank_Temptation', 'BCourtier', 'BEtiquette', 'add_insight'], eventString = [...elements, ...ranks].map(s => `change:${s}`).join(' ') + ' change:repeating_rehigh:rank_rehigh remove:repeating_rehigh' + ' change:repeating_rweap:rank_rweap remove:repeating_rweap' + ' change:repeating_rcraft:rank_rcraft remove:repeating_rcraft' + ' change:repeating_rlow:rank_rlow remove:repeating_rlow'; // This function does the actual calculation and attribute-setting after we have all the names var calcFooInsight = function (repeatingNames) { getAttrs([...elements, ...ranks, ...repeatingNames], function (values) { let sum = elements.reduce((s, k) => (s + (parseInt(values[k]) * 10 || 0)), 0) + ranks.reduce((s, k) => (s + (parseInt(values[k]) || 0)), 0) + repeatingNames.reduce((s, k) => (s + (parseFloat(values[k]) || 0)), 0); setAttrs({ foo_insight: Math.round(sum) }); }); }; // Collect necessary data for calculation on(eventString, function () { getSectionIDs('repeating_rehigh', function (idArrayRehigh) { getSectionIDs('repeating_rweap', function (idArrayRweap) { getSectionIDs('repeating_rcraft', function (idArrayRcraft) { getSectionIDs('repeating_rlow', function (idArrayRlow) { let attrNamesRehigh = idArrayRehigh.map(id => "repeating_rehigh_" + id + "_rank_rehigh"), attrNamesRweap = idArrayRweap.map(id => "repeating_rweap_" + id + "_rank_rweap"), attrNamesRcraft = idArrayRcraft.map(id => "repeating_rcraft_" + id + "_rank_rcraft"), attrNamesRlow = idArrayRlow.map(id => "repeating_rlow_" + id + "_rank_rlow"); calcFooInsight([...attrNamesRehigh, ...attrNamesRweap, ...attrNamesRcraft, ...attrNamesRlow]); }); }); }); }); }); </script>