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 : Here's the HTML (the interesting part): <input name="attr_str" type="number" title="@{str}" />
<input name="attr_con" type="number" title="@{con}" />
<input name="attr_dex" type="number" title="@{dex}" />
<input name="attr_siz" type="number" title="@{siz}" />
<input name="attr_int" type="number" title="@{int}" />
<input name="attr_pow" type="number" title="@{pow}" />
<input name="attr_cha" type="number" title="@{cha}" />
<fieldset class="repeating_advancedSkills">
<input name="attr_advancedSkillName" type="text" data-i18n-place="advanced-skill-name-place" placeholder="Advanced Skill Name" />
<select name="attr_advancedSkillChar1" data-i18n-title="advanced-skill-characteristics-1-title" title="First Characteristics for Advanced Skill">
<option value="0" selected></option>
<option value="str" data-i18n="STR">STR</option>
<option value="con" data-i18n="CON">CON</option>
<option value="dex" data-i18n="DEX">DEX</option>
<option value="siz" data-i18n="SIZ">SIZ</option>
<option value="int" data-i18n="INT">INT</option>
<option value="pow" data-i18n="POW">POW</option>
<option value="cha" data-i18n="CHA">CHA</option>
</select>
<select name="attr_advancedSkillChar2" data-i18n-title="advanced-skill-characteristics-2-title" title="First Characteristics for Advanced Skill">
<option value="0" selected></option>
<option value="str" data-i18n="STR">STR</option>
<option value="con" data-i18n="CON">CON</option>
<option value="dex" data-i18n="DEX">DEX</option>
<option value="siz" data-i18n="SIZ">SIZ</option>
<option value="int" data-i18n="INT">INT</option>
<option value="pow" data-i18n="POW">POW</option>
<option value="cha" data-i18n="CHA">CHA</option>
</select>
<input name="attr_advancedSkillBase" readonly="readonly" type="number" title="@{advancedSkillBase}" />
<input name="attr_advancedSkillMod" type="number" title="@{advancedSkillMod}" value="0" />
<input name="attr_advancedSkill" readonly="readonly" type="number" title="@{advancedSkill}" />
</fieldset> And here's the script part : on("change:repeating_advancedskills", function() {
TAS.repeating('advancedSkills')
.attrs('str','con','dex','siz','int','pow','cha')
.fields('advancedSkillChar1','advancedSkillChar2','advancedSkillMod','advancedSkillBase','advancedSkill')
.each(function(r,f){
var charVal1=0;
var charVal2=0;
if(r.advancedSkillChar1=='str'){
charVal1=parseInt(f.F["str"]);
}
if(r.advancedSkillChar1=='con'){
charVal1=parseInt(f.F["con"]);
}
if(r.advancedSkillChar1=='dex'){
charVal1=parseInt(f.F["dex"]);
}
if(r.advancedSkillChar1=='siz'){
charVal1=parseInt(f.F["siz"]);
}
if(r.advancedSkillChar1=='int'){
charVal1=parseInt(f.F["int"]);
}
if(r.advancedSkillChar1=='pow'){
charVal1=parseInt(f.F["pow"]);
}
if(r.advancedSkillChar1=='cha'){
charVal1=parseInt(f.F["cha"]);
}
if(r.advancedSkillChar2=='str'){
charVal2=parseInt(f.F["str"]);
}
if(r.advancedSkillChar2=='con'){
charVal2=parseInt(f.F["con"]);
}
if(r.advancedSkillChar2=='dex'){
charVal2=parseInt(f.F["dex"]);
}
if(r.advancedSkillChar2=='siz'){
charVal2=parseInt(f.F["siz"]);
}
if(r.advancedSkillChar2=='int'){
charVal2=parseInt(f.F["int"]);
}
if(r.advancedSkillChar2=='pow'){
charVal2=parseInt(f.F["pow"]);
}
if(r.advancedSkillChar2=='cha'){
charVal2=parseInt(f.F["cha"]);
}
r.advancedSkillBase=charVal1 + charVal2;
r.advancedSkill=charVal1 + charVal2 + parseInt(r.advancedSkillMod);
})
.execute();
});
I'm using the script "TheAaronSheet" script to manage the repeating sections. Thanks for the future help !