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

Script run only once each two triggers

1727107092

Edited 1727108439
I'm going to go mad, but this script only executes once every two attempts to run it. I can't figure out what the problem is... I've changed the sandbox, I've changed the whole script to isolate only this part, imagining that it could be something else from the same sheet. But no, it only works once, out of two... if you have any idea what's not working...? PS : Strange update, when I interact with another input between the try, it work everytime...             < script type = "text/worker" >                 on('change:frame-crew1-pattern', function() {                     getAttrs(['frame-crew1-pattern'], function(values) {                         const patternValue = parseInt(values['frame-crew1-pattern']) || 0;                                     if (patternValue > 0) {                             getSectionIDs('repeating_crewfamiliy', function(ids) {                                 if (patternValue <= ids.length) {                                     const selectedRowID = ids[patternValue - 1];                                     const attributesToFetch = [                                         `repeating_crewfamiliy_${selectedRowID}_crew-name`,                                         `repeating_crewfamiliy_${selectedRowID}_crew-repair`                                     ];                                                 getAttrs(attributesToFetch, function(rowValues) {                                         const crewName = rowValues[`repeating_crewfamiliy_${selectedRowID}_crew-name`] || 'Unnamed';                                         const crewRepair = parseInt(rowValues[`repeating_crewfamiliy_${selectedRowID}_crew-repair`]) || 0;                                                     setAttrs({                                             'frame-crew1-name': crewName,                                             'frame-crew1-repair': crewRepair                                         });                                     });                                 }                             });                         }                     });                 });             </ script >
Hello ! Your problem might be related to a bug discussed here : <a href="https://app.roll20.net/forum/post/12054927/sheet-triggers-seem-buggy-today/?pageforid=12062051#post-12062051" rel="nofollow">https://app.roll20.net/forum/post/12054927/sheet-triggers-seem-buggy-today/?pageforid=12062051#post-12062051</a> If it's the case, your code is not guilty 🙂
1727120054
vÍnce
Pro
Sheet Author
Please post to the help desk to get attention on a bug that fails to trigger some on(change) events.&nbsp; This started with Jumpgate but it looks like it's now an issue for sheets in non-jump games as well.&nbsp; ;-(
I'll read that, but I've disabled Jumpgate earlier in the process for another bugs happening with it. Now the sheet ask me "Try Jumpgate", so unfortunatly. I'll ready anyway ! Thx !
1727122087

Edited 1727122124
vÍnce
Pro
Sheet Author
This bug started with Jumpgate but seems to also be affecting non-jump games as of last week. ;-(