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

Macro assistance for automatic creature action buttons

I have been working on learning macros today for the first time, and came across some helpful ones by AndruRC on reddit  here . On his github was a macro for making chat menus that would automatically populate with the actions listed for the creature. However. His original macro only had one button written in it for the first ability ($0), and he simply states that one can "increment" to include more. Not exactly sure what that means, but I figured out the addition of more buttons. My problem is that I can't find a way to allow for the automatic adding of enough buttons to creatures with many actions without errors getting thrown for creatures with fewer actions than the number of buttons. Any ideas? My current macro: @{selected|wtype}&{template:default}{{name=@{selected|character_name} Actions}} {{ Actions =[@{selected|repeating_npcaction_$0_name}](~selected|repeating_npcaction_$0_npc_action)[@{selected|repeating_npcaction_$1_name}](~selected|repeating_npcaction_$1_npc_action) }} Etc.
Also, any pages that really teach macro creation would be nice, rather than a wiki that doesn't really list many commands and syntaxes options
1717546538

Edited 1717546660
Gauss
Forum Champion
Hi Zelfinit,  Which character sheet are you using? If this is the D&D 5e by Roll20 character sheet I suggest using Jarren's macro for this.  As for information the Roll20 wiki and the forums are the primary sources of information.  Specifically you are after Chat Menus , Templates , and Repeating sections. I'd link the repeating sections but that is character sheet dependent.  There is no way to (short of an API Script) automaticaly add more buttons. What most of us do is add a ton of buttons and then use various techniques for hiding the ones that aren't active. 
1717551808

Edited 1717553972
Based on the attribute names I’m going to assume you’re playing D&D 5th edition using the ‘D&D 5E by Roll20’ sheet.  As Gauss recommended, I also suggest using my Statblock MacroMule to do exactly what you’re trying to do, plus more.  If you’re not the GM for the game, you can ask them to create a generic MacroMule character that can be used by everyone in the game, or you can put all of the MacroMule attributes directly on your own character’s sheet for your own use.  The good news is that it’s available to all subscription levels. There are options for Pro and Plus users to make it easier to create the MacroMule character, but even free users can simply cut and paste and get the exact same thing as paid users.  Or you can also use my initial Universal NPC Statblock Chat Menu version , which are simpler static menus that don't have as much information.
I am indeed playing 5e with the 5e by roll20 sheet. I am also the GM. Thank you guys so much! Will look soon, currently replying on mobile. I figured that I needed some form of error suppression, just didn't know how to do it.