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 Update] Ammo - Automated ammunition management script

February 16 (8 years ago)

Edited February 16 (8 years ago)
John D.
Sheet Author
API Scripter
It suddenly worked now for some reason???
Praise the Omnissiah!
February 16 (8 years ago)
The Aaron
Pro
API Scripter
Great!!!
February 16 (8 years ago)
The Aaron
Pro
API Scripter
A few minor corrections. First, I told you wrong on the hidden field, should be:
<input type="hidden" name="attr_my_hidden_row_id" />
That will prevent it from showing up.

Second, you can make the sheet worker run less often by only targeting the specific hidden field:
<script type="text/worker">
on("change:repeating_rangedweapons:my_hidden_row_id", function() {
getSectionIDs("repeating_rangedweapons", function(idarray) {
let setOps={};
for(var i=0; i < idarray.length; i++) {
setOps['repeating_rangedweapons_'+idarray[i]+'_my_hidden_row_id']=idarray[i];
}
setAttrs(setOps);
});
});
</script>

Happy Rolling!


February 17 (8 years ago)
John D.
Sheet Author
API Scripter
Aye thanks for that! Happy Rolling!