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

Repeating Resource Boxes on 5e Character Sheet

I want to use macros/APIs to edit values in the boxes used for ammunition/class abilities, particularly so that I can deduct rations when long rest is used or potions when a powercard for potions of healing is used. The top two are called class_resource and other_resource and I have successfully managed to alter them but when you add another below row each additional row has the same name as the one above and I can't seem to edit them with SetChatAttr. Does anyone know how I can do this? Many thanks in Advance.
1611076537

Edited 1611076547
Oosh
Sheet Author
API Scripter
All the rows after the first one are part of a separate, repeating section. You can grab the first row with these: @{selected|repeating_resource_$0_resource_left} @{selected|repeating_resource_$0_resource_left_name} @{selected|repeating_resource_$0_resource_right} @{selected|repeating_resource_$0_resource_right_name} and increase the $0 index for each new row.
1611084255
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I would just like to add that programming any API for the D&D 5th Edition by Roll20 Sheet is a pain in the neck because of this arrangement. One, single repeating field would be sooooo much easier to manage.
1611114927
GiGs
Pro
Sheet Author
API Scripter
You'd also expect a By Roll20 sheet (especially the flagship D&D one) to know that you can split a repeating section into two columns, and so shouldnt need this naming approach anyway.
Thank you so much. I'll try these out straightaway :D