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

Universal Macro / Script to Print All Monster Attacks in Chat Table

April 17 (3 years ago)

Edited April 18 (3 years ago)

Been learning how to do some basic macros the last week or so, trying to make one to list all of the attacks and special attacks that a Monster has in a Pathfinder 1st Game.

Currently I have this, it will list a number of attacks for as many buttons as I put in:

&{template:default} {{name=@{selected|character_name} Actions}} {{ Actions=[@{selected|repeating_npcatk-melee_$0_atkname}](~selected|repeating_npcatk-melee_$0_attack) [@{selected|repeating_npcatk-melee_$1_atkname}](~selected|repeating_npcatk-melee_$1_attack)}}

The problem is that if I have more buttons in this macro than a creature has attacks then it will start printing bits of code into buttons on my chat menu which is not much good. Is there a way to make this detect how many attacks a creature has and print all them in a format similar to this chat menu without printing odd looking boxes?

I have never touched the API but I can start to learn if needed, though macro would be preferred.... just dont think this is possible in macro form. 

April 18 (3 years ago)

Maybe you want this?

NPC Statblock Chat Menu for D&D 5e sheet — No API required!

April 18 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter


Eponymous said:

Maybe you want this?

NPC Statblock Chat Menu for D&D 5e sheet — No API required!


Jarren K took that idea and improved it tremendously:

Universal NPC Statblock Abilities and Spells Chat Menus for D&D 5e sheet — No API or Stylus required!


If only there was a PC version.  

April 18 (3 years ago)

Edited April 18 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

I thought Jarren said somewhere recently he wanted to work on one?

April 18 (3 years ago)

i do apologise to all of you, forgot to put Pathfinder 1st in the title / op - amending that now!

Are there Pathfinder Equivalents of the above suggestions 


Jaevwyn said:

i do apologise to all of you, forgot to put Pathfinder 1st in the title / op - amending that now!

Are there Pathfinder Equivalents of the above suggestions 


He gives a longwinded syntax instruction that I think allowed some folks to make ones for other sheets, go to Jarren K's actual post link above and look through it in all the replies, I think I saw someone sharing stuff.  

April 18 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

A quick solution, not nearly as nice as Jerren's, is to put ?{noerror} directly after your roll template. It won't hide blank fields, but it will suppress the accompanying error messages.

April 20 (3 years ago)

sorry for the delay, busy easter time! I was hoping to eliminate the "dead" buttons but i feel like thats going to be a deep venture into the API world, which im open to but it'd need to be baby steps lol.

Is there a macro friendly way to do that?