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

Trying to build a macro that automatically lists a character's attacks in a dropdown list

Good afternoon, all. I am running a D&D 5e game, using the built-in 5e character sheets. I have beginner to intermediate knowledge of the macros. I would like to create a macro that incorporates all of a character's attacks. I know that I can click on an attack from the character sheet, and copy the macro code from the chat. I can create individual token buttons for the characters using this method. What I would like to do is create a macro that will incorporate all of a character's attacks (for example, a dagger attack, a shortbow attack, and a firebolt spell) into a dropdown list, so that the player can click on the dropdown, choose the attack. One way that I think I can do this is to create a dropdown list manually. But the downside to that approach is that I would have to do that for each weapon or spell, and I would also have to update the macro every time the player changes equipment. Is there a way to create a macro that would automatically read from the "Attacks and Spellcasting" section of the character sheet, so that the player can quickly press one button, and choose the attack, versus flipping back and forth to the character sheet? Thanks for any assistance, and apologies if this has been addressed in a previous post.
1581447758
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Use the scripts Universal Chat Menus or Menu Maker. There are examples of how to do what you are describing in each thread. I use a macro that reports basically the entire sheet, but you can make ones that only output spells or attacks, or just about anything:
Thanks, Keith. I appreciate the quick response. I'm trying to read through everything now. I can make the first part of what you sent appear (the ability checks and saves) but I'm not successful with the rest. I'm sure the error is on my end. I'll keep at it. Thanks again.
1581457207
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The complete code for those macros is in this thread , but I have pasted the direct links below. Keep in mind that due to the way the Roll20 sheet is factored, there are two different macros, depending on whether you are selecting a PC or an NPC. NPC Code PC Code
1581514708

Edited 1581515016
Wow! I never knew...thanks Keith. We're migrating over from the shaped sheet but the built-in statblock macro for NPCs was one of my most used token macros so I don't have to open the sheet.
1581517358
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Yeah, I moved from the Shaped Sheet last year. The reporting macros and the spell management of the script were hard to say good-bye to. If you need the technique to change the buttons into inline links, you can find that here . (Auto install link is in the top post)
Thanks again, Keith. I'll try those links later on. I was trying to read through everything. Do I have to import an API script in order to take advantage of those macros? For example, I tried the macro for the Menu Maker script, by first importing the API script, and then trying the macro, but that didn't seem to work for me. Again, I'm sure I either misread something or am not just fully understanding.