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

[Sheet Worker] New line in error in my repeating sections

1507736983
PadRpg
Sheet Author
API Scripter
Hi, In my new sheet, I want to use the sheet worker to calculate the skill score in a repeating section. The calcul works but when the script is executed, a new line (a copy of the current line) appears in error : In the HTML, this is what I've got when I add 2 rows: You can find the files of the sheet in my Github: <a href="https://github.com/MrPadRpg/Roll20CharacterSheets/" rel="nofollow">https://github.com/MrPadRpg/Roll20CharacterSheets/</a>... Thanks,
1507737113
The Aaron
Pro
API Scripter
Context for discussion:&nbsp; <a href="https://app.roll20.net/forum/post/5632121/sheet-wo" rel="nofollow">https://app.roll20.net/forum/post/5632121/sheet-wo</a>...
1507888956
PadRpg
Sheet Author
API Scripter
FYI, when I'm not using Aaron's script, it works: on("change:repeating_advancedskills:advancedSkillChar1 change:repeating_advancedskills:advancedSkillChar2 change:repeating_advancedskills:advancedSkillMod", function(){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; getAttrs([ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "repeating_advancedskills_advancedSkillChar1", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "repeating_advancedskills_advancedSkillChar2", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "repeating_advancedskills_advancedSkillMod",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "str", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "con", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "dex", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "siz", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "int", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "pow", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "cha" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ], function (values) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var modVal=parseInt(values.repeating_advancedskills_advancedSkillMod); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var charVal1=parseInt(values[values.repeating_advancedskills_advancedSkillChar1])||0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var charVal2=parseInt(values[values.repeating_advancedskills_advancedSkillChar2])||0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setAttrs({ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'repeating_advancedskills_advancedSkillBase': charVal1 + charVal2, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'repeating_advancedskills_advancedSkill':charVal1 + charVal2 + modVal &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; &nbsp; });
1507898878
The Aaron
Pro
API Scripter
This is following a slightly different code path, it seems to be using an implied rowid to change only a single row, rather than iterating over all rows to change 1 or more rows. That's good info and should help with tracking down the iteration issue.
1507898957
The Aaron
Pro
API Scripter
For reference, the setAttrs from TAS was: setAttrs({ repeating_advancedSkills_-kwb0dpxthoa8rav9glm_advancedSkillBase: 11, repeating_advancedSkills_-kwb0dpxthoa8rav9glm_advancedSkill: 11 });