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

Finding repeating section attributes by row number

1469868071
Jakob
Sheet Author
API Scripter
How can I make findObj to find a repeating section attribute by its row number, i.e. repeating_action_$0_damage? Just naively passing it as the name doesn't seem to find the right attribute.
1469903486

Edited 1469903523
Lithl
Pro
Sheet Author
API Scripter
If the repitems haven't been reordered, then the array returned by findObjs or filterObjs ought to be the order of the items. (Assuming you limit the result set to a single character, of course.) You may be able to use the callback parameter to sendChat to get the indexed value of a repeating item, as well.
1469948120

Edited 1469948164
It used to work like this before the API/Character sheet reworking : getAttrByName(originchar_id, "repeating_meleeweapons_$0_WeaponType"); (it still works with macros) A topic has been created in the Bug reports and technical issues : Can't access attributes of repeating section with getAttrByName and $X It still doesn't work, feel free to join the topic
1469951342
Jakob
Sheet Author
API Scripter
It's not exactly my case, alas: I need findObjs, not getAttrByName, since I want to get the attribute object in order to modify the attribute. I'll post in the other thread anyway and see what kind of response I get.
Ok, i didn't see that. Hopefully it is related to the same API/Charsheet issue.