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

help workers

I need help to make it disappear value="@{for0}+@{for2}+@{for3}+@{for4}+@{tec0}+@{tec2}+@{tec3}+@{tec4} +@{sa0}+@{sa2}+@{sa3}+@{sa4}+@{Prt0}+@{Prt2}+@{Prt3}+@{Prt4}+@{Con0}+@{Con2}+@{Con3}+@{Con4}+@{mp0}+@{mp2}+@{mp3}+@{mp4}+@{pdf0}+@{pdf2}+@{pdf3}+@{ pdf4}+@{pokefor0}+@{pokefor2}+@{pokefor3}+@{pokefor4}+@{poketec0}+@{poketec2}+@{poketec3}+@{poketec4}+@{pokesa0}+@{pokesa2}+@{pokesa3}+@{pokesa4}+ @{pokePrt0}+@{pokePrt2}+@{pokePrt3}+@{pokePrt4}+@{pokeCon0}+@{pokeCon2}+@{pokeCon3}+@{pokeCon4}+@{pokemp0}+@{pokemp2}+@{pokemp3}+@{pokemp4}+@{pokepdf0}+@{pokepdf2}+ @{pokepdf3}+@{pokepdf4}+@{atributo_total}"  and then throw the value according to the workers below, automatically    <div class = "rowflex nowrap">       <label> atributo </label>      <input name = "attr_str" type = "number" value = "" placeholder = "120">      <input name = "attr_atributogarra_total" type = "number" value = "(@ {for0} + @ {for2} + @ {for3} + @ {for4} + @ {tec0} + @ {tec2} + @ {tec3} + @ {tec4} + @ {sa0} + @ {sa2} + @ {sa3} + @ {sa4} + @ {Prt0} + @ {Prt2} + @ {Prt3} + @ {Prt4} + @ {Con0} + @ {Con2} + @ {Con3} + @ {Con4} + @ {mp0} + @ {mp2} + @ {mp3} + @ {mp4} + @ {pdf0} + @ {pdf2} + @ {pdf3} + @ {pdf4} + @ {pokefor0} + @ {pokefor2} + @ {pokefor3} + @ {pokefor4} + @ {poketec0} + @ {poketec2} + @ {poketec3} + @ {poketec4} + @ {pokesa0} + @ {pokesa2} + @ {pokesa3} + @ {pokesa4} + @ {pokePrt0} + @ {pokePrt2} + @ {pokePrt3} + @ {pokePrt4} + @ {pokeCon0} + @ {pokeCon2} + @ {pokeCon3} + @ {pokeCon4} + @ {pokemp0} + @ {pokemp2} + @ {pokemp3} + @ {pokemp4} + @ {pokepdf0} + @ {pokepdf2} + @ {pokepdf3} + @ {pokepdf4} + @ {atributo_total} ) "disabled placeholder =" 10 ">     <span name = "attr_atributogarra_total_mod"> </span>    </div> <! - ---------------------------------------------- ----------------------------------- -> <! - --------------------------- trabalhadores ------------------ --------------------- -> <! - ---------------------------------------------- ----------------------------------- -> <input name = "attr_atributogarra_total_mod" type = "hidden" value = "0"> <input name = "attr_rest" type = "hidden" value = "0"> <script type = "text / worker"> const int = score => parseInt (pontuação, 10) || 0; const stats = ["atributogarra_total"]; stats.forEach (stat => {     on (`alterar: $ {stat}`, () => {         getAttrs ([stat], values ​​=> {             const stat_base = int (valores [stat]);             //console.log(stat_base);             deixe stat_mod = 0;             if (stat_base> = 94) stat_mod = "9";             else if (stat_base> = 87) stat_mod = "8,5";             else if (stat_base> = 78) stat_mod = "8";             else if (stat_base> = 71) stat_mod = "7,5";             else if (stat_base> = 63) stat_mod = "7";             else if (stat_base> = 58) stat_mod = "6,5";             else if (stat_base> = 51) stat_mod = "6";             else if (stat_base> = 48) stat_mod = "5,5";             else if (stat_base> = 43) stat_mod = "5";             else if (stat_base> = 40) stat_mod = "4.5";             else if (stat_base> = 35) stat_mod = "4";             else if (stat_base> = 32) stat_mod = "3,5";             else if (stat_base> = 27) stat_mod = "3";             else if (stat_base> = 23) stat_mod = "2,5";             else if (stat_base> = 18) stat_mod = "2";             else if (stat_base> = 15) stat_mod = "1,5";             else if (stat_base> = 10) stat_mod = "1";             senão stat_mod = "0,5";                          setAttrs ({                 [`$ {stat} _mod`]: stat_mod             });         });     }); }); </script>
1630342116
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You are currently using a disabled input. Sheetworkers can't affect disabled inputs. Switch to a readonly input like so: <div class = "rowflex nowrap">       <label> atributo </label>      <input name = "attr_str" type = "number" value = "" placeholder = "120">      <input name = "attr_atributogarra_total" type = "number" value = "10" readonly="true">     <span name = "attr_atributogarra_total_mod"> </span>    </div> Additionally, there's a few typos in your javascript: deixe stat_mod and senao stat_mod I think these need to be let stat_mod and else stat_mod  respectively. Unfortunately, as far as I know, JS won't accept non-english system words. Your numbers I'm assuming that you are wanting to add these numbers to something else to then put in your total_mod field. They'll need to be decimal notation and regular numbers instead of comma notation. E.g. 2.5 instead of "2,5".
sorry my translator translated himself   <div class="rowflex nowrap">       <label>Strength</label>      <input name="attr_str" type="number" value="" placeholder="120">      <input name="attr_atributogarra_total" type="number" value="(@{for0}+@{for2}+@{for3}+@{for4}+@{tec0}+@{tec2}+@{tec3}+@{tec4}+@{sa0}+@{sa2}+@{sa3}+@{sa4}+@{Prt0}+@{Prt2}+@{Prt3}+@{Prt4}+@{Con0}+@{Con2}+@{Con3}+@{Con4}+@{mp0}+@{mp2}+@{mp3}+@{mp4}+@{pdf0}+@{pdf2}+@{pdf3}+@{pdf4}+@{pokefor0}+@{pokefor2}+@{pokefor3}+@{pokefor4}+@{poketec0}+@{poketec2}+@{poketec3}+@{poketec4}+@{pokesa0}+@{pokesa2}+@{pokesa3}+@{pokesa4}+@{pokePrt0}+@{pokePrt2}+@{pokePrt3}+@{pokePrt4}+@{pokeCon0}+@{pokeCon2}+@{pokeCon3}+@{pokeCon4}+@{pokemp0}+@{pokemp2}+@{pokemp3}+@{pokemp4}+@{pokepdf0}+@{pokepdf2}+@{pokepdf3}+@{pokepdf4}+@{atributo_total})" disabled placeholder="10">      <input type="number" name="attr_StrMod" value="(@{for0}+@{for2}+@{for3})" disabled="true" />      <span name="attr_atributogarra_total_mod"></span>    </div> <!--  --------------------------------------------------------------------------------- --> <!--  --------------------------- Sheet workers --------------------------------------- --> <!--  --------------------------------------------------------------------------------- --> <input name="attr_atributogarra_total_mod" type="hidden" value="0"> <input name="attr_rest" type="hidden" value="0"> <script type="text/worker"> const int = score => parseInt(score, 10) || 0; const stats = ["atributogarra_total"]; stats.forEach(stat => {     on(`change:${stat}`, () => {         getAttrs([stat], values => {             const stat_base = int(values[stat]);             //console.log(stat_base);             let stat_mod = 0;             if (stat_base >= 94) stat_mod = "9";             else if (stat_base >= 87) stat_mod = "8.5";             else if (stat_base >= 78) stat_mod = "8";             else if (stat_base >= 71) stat_mod = "7.5";             else if (stat_base >= 63) stat_mod = "7";             else if (stat_base >= 58) stat_mod = "6.5";             else if (stat_base >= 51) stat_mod = "6";             else if (stat_base >= 48) stat_mod = "5.5";             else if (stat_base >= 43) stat_mod = "5";             else if (stat_base >= 40) stat_mod = "4.5";             else if (stat_base >= 35) stat_mod = "4";             else if (stat_base >= 32) stat_mod = "3.5";             else if (stat_base >= 27) stat_mod = "3";             else if (stat_base >= 23) stat_mod = "2.5";             else if (stat_base >= 18) stat_mod = "2";             else if (stat_base >= 15) stat_mod = "1.5";             else if (stat_base >= 10) stat_mod = "1";             else stat_mod = "0.5";                          setAttrs({                 [`${stat}_mod`]: stat_mod             });         });     }); });
more how could I let it add the value="@{for0}+@{for2}+@{for3}" because if I leave it disabled it adds automatically and if I don't leave it it doesn't add
1630346686

Edited 1630346694
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, sorry, I misread the first post and thought you were trying to set atributogarra_total in the sheetworker. So, what's your end goal for atributogarra_total ? You just want it to show the total of each of the for  attributes? or are you going to use the value elsewhere?
and that I need it to add the attributes like the example:      <input name="attr_atributogarra1_total" type="number" value="(@{for0}+@{for2}+@{for3}+@{for4}+@{tec0}+@{tec2}+@{tec3}+@{tec4}+@{sa0}+@{sa2}+@{sa3}+@{sa4}+@{Prt0}+@{Prt2}+@{Prt3}+@{Prt4}+@{Con0}+@{Con2}+@{Con3}+@{Con4}+@{mp0}+@{mp2}+@{mp3}+@{mp4}+@{pdf0}+@{pdf2}+@{pdf3}+@{pdf4}+@{pokefor0}+@{pokefor2}+@{pokefor3}+@{pokefor4}+@{poketec0}+@{poketec2}+@{poketec3}+@{poketec4}+@{pokesa0}+@{pokesa2}+@{pokesa3}+@{pokesa4}+@{pokePrt0}+@{pokePrt2}+@{pokePrt3}+@{pokePrt4}+@{pokeCon0}+@{pokeCon2}+@{pokeCon3}+@{pokeCon4}+@{pokemp0}+@{pokemp2}+@{pokemp3}+@{pokemp4}+@{pokepdf0}+@{pokepdf2}+@{pokepdf3}+@{pokepdf4}+@{atributo_total})" disabled placeholder="10"> and then throw in Sheet workers to convert the value according to the table
1630348322
GiGs
Pro
Sheet Author
API Scripter
You can't use disabled attributes with a sheet worker.
and how could I do to self-calculate the value adding the attributes and play the Workers in Sheet style, which I sent?