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

Check for missing repeating section rows and auto delete?

Hey, I'm trying to create a global macro for a barbarian/druid where the player can click on any normal beast token given to him and select actions from a menu. The problem is that if a creature has not enough actions it creates error messages and nonsense buttons. Is there anyway to have the macro detect missing errors and delete them? Like Excel's iferror then blank kind of thing? Here is my current code: &{template:default}{{name=@{selected|character_name} Attacks}} {{ Actions =[@{selected|repeating_npcaction_$0_name}](~selected|repeating_npcaction_$0_npc_action) [@{selected|repeating_npcaction_$1_name}](~selected|repeating_npcaction_$1_npc_action) [@{selected|repeating_npcaction_$2_name}](~selected|repeating_npcaction_$2_npc_action) [@{selected|repeating_npcaction_$3_name}](~selected|repeating_npcaction_$3_npc_action)}} {{Bonus=@{Eddie|global_damage_mod_roll}}}
1586719629
GiGs
Pro
Sheet Author
API Scripter
As you're a Pro user, let me suggest my script:&nbsp; <a href="https://app.roll20.net/forum/post/7474530/script-call-for-testers-universal-chat-menus/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/7474530/script-call-for-testers-universal-chat-menus/?pagenum=1</a> Install it and create this macro !chatmenu&nbsp;@{selected|character_id}&nbsp;{template:pc}{{name=@{selected|character_name} Attacks}} {{Actions=CHATMENU }}&nbsp;{{Bonus=@{Eddie|global_damage_mod_roll}}}&nbsp;--repeating_npcaction|name|npc_action&nbsp; At least i think this is what the macro would be. It'll create the correct number of buttons for whichever creature is selected. Note: the missing &amp; before {template is deliberate. That's just how the script works with rolltemplates, for now.
Thank you I'll try it out :)
1586719993
GiGs
Pro
Sheet Author
API Scripter
I just noticed your bonus section uses @{Eddie| while the rest uses @{selected|, so you might want to change that.
Yeah, it's to remind that specific character to not forget to add rage damage
Hey @GiGs Just wanted to say thank you for the script. It works perfectly and helped me beyond my original goal. It's great
1586853703
GiGs
Pro
Sheet Author
API Scripter
Thats great to hear :)