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

Token macro button that references a roll button inside a repeating row, Custom Character Sheet

1612302266

Edited 1612302349
Daniel S.
Pro
Sheet Author
I must've looked through a dozen forum threads to figure this out and tried a number of things already.&nbsp; Is someone perhaps able to help out clarifying this? &nbsp; I'm trying to make a macro in the sidebar and then check the 'show as token action' so that I can easily roll the button for the first few equipped weapons for any selected token, without opening the sheet. The buttons are nested inside a repeating row on the custom character sheet. The example table in question has: &lt;fieldset class="repeating_weapons"&gt; button... name="roll_weaponrepeatingbutton" If you need to see more of the example code, the relevant code for the table starts at line 260, and the button is on line 301.&nbsp; <a href="https://github.com/danimagaming/ForgeofSteelRoll20beta/blob/main/DODASbeta.html" rel="nofollow">https://github.com/danimagaming/ForgeofSteelRoll20beta/blob/main/DODASbeta.html</a> Thank you for any help.
1612302565

Edited 1612302601
GiGs
Pro
Sheet Author
API Scripter
You should be able to get the roll using: If youre making a macro in the sidebar, you'll need to supply some way of identifying which character to roll from. If the character has a token, you can use selected. &nbsp;The following will launch the first weapon, as long as you have the token selected: %{selected|repeating_weapons_$0_weaponrepeatingbutton} See the $0 in the middle? $0 gives the first item in the repeating section, $1 gives the second, $2 gives the 3rd, and so on.
1612303625
Daniel S.
Pro
Sheet Author
Awesome thank you. Works now. Dang I was so close. I had that almost identical, but had an @ in the front instead of %, and accidentally typed weapon instead of weapons. Comes up with an error with the @ instead of %. Still trying to figure out what exactly that % means compared to @. Trying to peruse the 'Macros' guide on Roll20 but it's a bit hard to decipher.
1612304081
Kraynic
Pro
Sheet Author
@ is the beginning of the call for an attribute, which is "attr_attributenamehere" in the character sheet html.&nbsp; % is the beginning of the call for a roll which is "roll_buttonnamehere" in the character sheet html.
1612304429

Edited 1612304537
Daniel S.
Pro
Sheet Author
Okay, I think that helps. So if I want to make a different macro that references attributes within a repeating row, I'd be using @ instead? % is exclusively for buttons? Edit: yeah that seems to be how it works. Thanks!!
1612305014
Kraynic
Pro
Sheet Author
Yes, basically the % will only be used if you are trying to trigger a roll button that exists on the sheet.&nbsp; Everything else will be an attribute whether it is a number or a text area.&nbsp; Everything you (or sheet workers) can edit on a sheet is an attribute.&nbsp; Attributes are where information is stored.&nbsp; Rolls contain macro formulas that usually also contain calls for attributes for use in the formula.
1612310339
GiGs
Pro
Sheet Author
API Scripter
Also, see the Attributes &amp; Abilities tab - the right pane is for Abilities, which are basically macros connected to that character. You can use % to activate them the same way you activate roll buttons.