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 to simply "click" defined attacks

January 08 (4 years ago)

Okay, so I have scoured the forums to the best of my ability, but feel free to point me to where I need to go if this has already been answered...

In short, what I want to do is setup a macro so that it will simply perform the same as a "click" on the first two attacks of a PC. They have a Bite and Claw attack (Barbarians, who knew?) and while I can certainly write out the whole macro in detail, is there a way to have a macro setup to do the same as "click the bite" (attack 1) and then "click the claw" (attack 2)?

I am using Pathfinder sheet, and have found things from 4+ years past stating to use "@{selected|repeating_weapon_$0_attack-roll}" but I always get an error of "You tried to use the repeating section row at index 0 for repeating_weapon, but there doesn't seem to be a row at that index. No attribute was found for @{selected|repeating_weapon_$0_attack-roll}". This doesn't surprise me as I am sure things have changed since then.

So is there a way to make a macro just click your first attack and then the second? I want to pass this on to my players who are not programmers so they can setup their own as well, so any help is welcome!

January 08 (4 years ago)

To make a roll call instead of an ability call, you need to use a % instead of @:

%{selected|repeating_weapon_$0_attack-roll}
%{selected|repeating_weapon_$1_attack-roll}

I'm using the D&D 5e by Roll20 sheet, not the Pathfinder sheet, so the syntax may be a little different.


D&D 5e by Roll20 repeating action calls:

%{selected|repeating_npcaction_$0_npc_action}
%{selected|repeating_npcaction_$1_npc_action}
January 09 (4 years ago)
F P.
Pro

I'm not sure this is what you're looking for but here are what my macros do.  I use them as token macros on 5e character sheet but, for us, just adding the second attack after the first attack works just fine.  The carriage return between the message and the roll separates the roll into the blue section while no carriage return keeps it all in the beige/orange. 

Bite:

/em Guk goes CHOMP CHOMP CHOMP at an enemy
rolls [[1d20+@{Guk Damu|strength_mod}+@{Guk Damu|pb}]] for [[1d4+@{Guk Damu|strength_mod}]] piercing damage!

In chat dialogue it looks like this :



Claw:

/em Guk clawed at an enemy
rolls [[1d20+@{Guk Damu|strength_mod}+@{Guk Damu|pb}]] for [[1d4+@{Guk Damu|strength_mod}]] Slashing damage!

Looks like this:


Combined:

/em Guk bites and claws an enemy rolls [[1d20+@{Guk Damu|strength_mod}+@{Guk Damu|pb}]] for [[1d4+@{Guk Damu|strength_mod}]] piercing damage! rolls [[1d20+@{Guk Damu|strength_mod}+@{Guk Damu|pb}]] for [[1d4+@{Guk Damu|strength_mod}]] Slashing damage!

Looks like this:


February 08 (4 years ago)

Well, I tried this using the pathfinder specifics as defined by this page: https://wiki.roll20.net/Macros/Pathfinder_Examples

And used the details from the "Roll First Attack from sheet" section, which is EXACTLY what I want... however I always get an error on the page of "No ability was found for %{selected|repeating_weapon_attack-roll}" and then the chat just spits out the text within the curly brackets. Is that page out of date for what the syntax is for the pathfinder sheet or am I just having issued with my cut and paste? And yes, I am selecting someone before testing the "ability" I am defining.

I should note that I am not setting up a macro - my bad. I am defining an ability for a character to pull off the bite/claw/claw attack as a single click.


Jarren K. said:

To make a roll call instead of an ability call, you need to use a % instead of @:

%{selected|repeating_weapon_$0_attack-roll}
%{selected|repeating_weapon_$1_attack-roll}

I'm using the D&D 5e by Roll20 sheet, not the Pathfinder sheet, so the syntax may be a little different.


D&D 5e by Roll20 repeating action calls:

%{selected|repeating_npcaction_$0_npc_action}
%{selected|repeating_npcaction_$1_npc_action}




February 08 (4 years ago)

MazeusXenon said:

Well, I tried this using the pathfinder specifics as defined by this page: https://wiki.roll20.net/Macros/Pathfinder_Examples

And used the details from the "Roll First Attack from sheet" section, which is EXACTLY what I want... however I always get an error on the page of "No ability was found for %{selected|repeating_weapon_attack-roll}" and then the chat just spits out the text within the curly brackets. Is that page out of date for what the syntax is for the pathfinder sheet or am I just having issued with my cut and paste? And yes, I am selecting someone before testing the "ability" I am defining.

I should note that I am not setting up a macro - my bad. I am defining an ability for a character to pull off the bite/claw/claw attack as a single click.

What is the full code you are using? 


%{selected|repeating_weapon_$0_attack-roll}

This should function exactly the same as clicking on the first listed attack on the character sheet.  If you just want to replicate the output of that roll, you'll have to use the longer section that is listed below on the Pathfinder Macro examples page you linked above.


I'm curious: what is the output from this:

%{selected|repeating_weapon_$0_attack-roll}
%{selected|repeating_weapon_$1_attack-roll}
%{selected|repeating_weapon_$2_attack-roll}
%{selected|repeating_weapon_$3_attack-roll}
%{selected|repeating_weapon_$4_attack-roll}
%{selected|repeating_weapon_$5_attack-roll}
%{selected|repeating_weapon_$6_attack-roll}
%{selected|repeating_weapon_$7_attack-roll}
%{selected|repeating_weapon_$8_attack-roll}
%{selected|repeating_weapon_$9_attack-roll}

There's a bug that I've run into before on the D&D 5e by Roll20 sheet where repeating sections can get mis-numbered, so if you're not getting a roll from using the $0 attack roll, it could be that your attack rolls are mis-numbered and you'll see it show up with a different number.


February 09 (4 years ago)

Edited February 09 (4 years ago)
vÍnce
Pro
Sheet Author

Hi MazeusXenon,
Just for clarity, which Pathfinder sheet are you using? The PF Community sheet, Pathfinder by Roll20, or..?  Each sheet on roll20 has specific attribute names and macros written for one sheet often do not work on another without changing the attribute names to match the sheet you are using.

February 10 (4 years ago)

@∇ince:

Pathfinder by Roll20, not the community sheet. I think what everyone is suggesting is for the community sheet...

Is there a list somewhere for all the syntax of a sheet? And again, It should NOT be for a macro; I am trying to write out an ability that will click the bite and the claw attacks through a single click. This is not to make a macro

∇ince said:

Hi MazeusXenon,
Just for clarity, which Pathfinder sheet are you using? The PF Community sheet, Pathfinder by Roll20, or..?  Each sheet on roll20 has specific attribute names and macros written for one sheet often do not work on another without changing the attribute names to match the sheet you are using.

@Jarren K: Everything gives me the same error no matter how many I try to iterate through. As I say above, this is probably code that works on the community sheet but I am using the Pathfinder by Roll20 sheet.

Jarren K. said:

MazeusXenon said:

Well, I tried this using the pathfinder specifics as defined by this page: https://wiki.roll20.net/Macros/Pathfinder_Examples

And used the details from the "Roll First Attack from sheet" section, which is EXACTLY what I want... however I always get an error on the page of "No ability was found for %{selected|repeating_weapon_attack-roll}" and then the chat just spits out the text within the curly brackets. Is that page out of date for what the syntax is for the pathfinder sheet or am I just having issued with my cut and paste? And yes, I am selecting someone before testing the "ability" I am defining.

I should note that I am not setting up a macro - my bad. I am defining an ability for a character to pull off the bite/claw/claw attack as a single click.

What is the full code you are using? 


%{selected|repeating_weapon_$0_attack-roll}

This should function exactly the same as clicking on the first listed attack on the character sheet.  If you just want to replicate the output of that roll, you'll have to use the longer section that is listed below on the Pathfinder Macro examples page you linked above.


I'm curious: what is the output from this:

%{selected|repeating_weapon_$0_attack-roll}
%{selected|repeating_weapon_$1_attack-roll}
%{selected|repeating_weapon_$2_attack-roll}
%{selected|repeating_weapon_$3_attack-roll}
%{selected|repeating_weapon_$4_attack-roll}
%{selected|repeating_weapon_$5_attack-roll}
%{selected|repeating_weapon_$6_attack-roll}
%{selected|repeating_weapon_$7_attack-roll}
%{selected|repeating_weapon_$8_attack-roll}
%{selected|repeating_weapon_$9_attack-roll}

There's a bug that I've run into before on the D&D 5e by Roll20 sheet where repeating sections can get mis-numbered, so if you're not getting a roll from using the $0 attack roll, it could be that your attack rolls are mis-numbered and you'll see it show up with a different number.







February 10 (4 years ago)

Edited February 10 (4 years ago)
vÍnce
Pro
Sheet Author


MazeusXenon said:

@∇ince:

Pathfinder by Roll20, not the community sheet. I think what everyone is suggesting is for the community sheet...

Is there a list somewhere for all the syntax of a sheet? And again, It should NOT be for a macro; I am trying to write out an ability that will click the bite and the claw attacks through a single click. This is not to make a macro

One suggestion; enable the macro bar if it isn't already (sidebar|collection), then try and drag each attack button to the macro bar.(this is temporary, you can delete them later...) Execute one of the attacks from the quickbar.  Now place your cursor in the chat window and use the UP arrow.  This will show the macro's name that was executed.  Copy/paste that command into a new "multi-attack" macro.  Repeat this for the other attacks, pasting them as a new line in your "multi-attack" macro.  They must each be on their own line.  When you execute the "multi-attack" macro, all attacks will be rolled. Delete the attacks you dragged to the quickbar(just drag/release them off the macro bar).

quick example; bite and 2 claw attack. I would probably enable this as a token macro for easy access;


February 11 (4 years ago)

Hallelujah!! It worked! I knew I had found it somehow before... so simple I missed it.

That being said, the "macro" fired off this: %{name|repeating_attacks_-M53sIDdfWoBIKwdtt6g_fullattack}, however I then used the index reference I used in other abilities and this worked: %{name|repeating_attacks_$0_fullattack}.

So, my bite/claw/claw looks like this:
%{name|repeating_attacks_$0_fullattack}
%{name|repeating_attacks_$1_fullattack}
%{name|repeating_attacks_$1_fullattack}

So much thanks - I knew there was a way!

Of course, now I am thinking about how to have it so only a single attack when not doing a full attack works... hmmm...