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

TheAaronSheet help

Hi, I've gone over the examples multiple times now and still get nada. No result, no anything, so I'm having a bit of a heyday trying to figure out where I went wrong. I'll post what I have so far, and I know it's screwed up, I just can't for the life of me figure out how though. I'm under the impression I need a attribute line, but I have no idea what to put in it :/ on('change:repeating_gear', function () {               TAS.repeatingSimpleSum('gear', 'gearweigh', 'gearweighttotal')         .fields('gearweigh', 'gearweighttotal', 'gearqty')         .reduce(function(m,r){             m.gearweigh+=(r.F.gearweigh*r.I.gearqty);             r.D[2].gearweighttotal=(r.F.gearweigh*r.I.gearqty);             return m;         }, {weight:0},function(m,a){             a.D[2].gearweighttotal=m.gearweigh;         })         .execute(); I've checked it over for spelling and consistency, but, beyond that, I'm lost.
well... was kind of hoping for at least a response telling me to do it myself by now... on('change:repeating_gear', function () {     TAS.repeating('gear')         .attrs('gearweighttotal')         .fields('gearweight', 'gearqty')         .reduce(function(m,r){             m.gearweight+=(r.F.gearweight*r.I.gearqty);             r.D[2].gearweighttotal=(r.F.gearweight*r.I.gearqty);             return m;         },{gearweight:0},function(m,r,a){             a.D[2].gearweighttotal=m.gearweight;         })         .execute(); }); I cleaned up some of the phrasing in the names and figured out what to do with the attrs row. Still no dice though, and not sure what I'm doing wrong still. Anyone?
1466275435
chris b.
Pro
Sheet Author
API Scripter
try this on('change:repeating_gear', function () {     TAS.repeating('gear')         .attrs('gearweighttotal')         .fields('gearweight', 'gearqty')         .reduce(function(m,r){             m.gearweight+=(r.F.gearweight*r.I.gearqty);             // r.D[2].gearweighttotal=(r.F.gearweight*r.I.gearqty);             return m;         } , {gearweight=0} //have to add initial values here. ,{gearweight:0},function(m,r,a){             a.D[2].gearweighttotal=m.gearweight;         })         .execute(); });
Hmm... no effect, but definitely not something I would have thought of. If it helps any with isolating the problem, this is the area I am working with: <fieldset name="repeating_gear" class="repeating_gear"><table style='border-collapse: collapse; border-spacing: 0;'>     <tr>             <td><input type="text" name="attr_geardesc" title="@{geardesc}" placeholder="Item Name"></td>             <td><input type="text" name="attr_gearweight" title="@{gearweight}" class="sheet-short" placeholder="lbs."></td>             <td><input type="number" name="attr_gearqty" title="@{gearqty}" class="sheet-short" value="0"></td>             <td><input type="text" name="attr_gearloc" title="@{gearloc}" placeholder="Location"></td>     </tr> </table></fieldset>