[RPG] In Roll20, how to program a macro that mimics the built-in attack function

dnd-5eroll20tools

In R20, when you make an attack roll using the built-in char sheet for 5E, it outputs 2 results (with modifiers and everything) in a single line. I'd like to do this with a Macro, so that I can access this functionality quickly through the Toolbar (I read the Macro section and the Dice reference from the R20 wiki, and no luck).

Alternatively, if there's a way to add the Attack and damage buttons from the character sheet to the Macro toolbar, that would be even easier.

Best Answer

If you roll from the character sheet, you should be able to hit the 'up' key in the chat box to see what the character sheet macro actually entered automatically for you (hitting 'up' in the chatbox refills the chatbox with the previous submission). You can copy and paste that into a custom-made macro to create a macro with the same effect, and can then check the option to put it in your macro bar.

For example, after rolling a melee weapon attack and hitting up, I see:

/em uses @{Eausreph Sliicoe|meleeweaponname1} to attack

[[1d20 + @{Eausreph Sliicoe|meleetohit1} [To Hit] + @{Eausreph Sliicoe|global_melee_attack_bonus} [Active Melee Attack Bonus] ]] | [[1d20 + @{Eausreph Sliicoe|meleetohit1} [To Hit] + @{Eausreph Sliicoe|global_melee_attack_bonus} [Active Melee Attack Bonus] ]] vs AC

When I put that in a macro, I get the same output as hitting the character sheet button.

In addition to that workaround, due to a roll20 update since the original question, you can now just drag the button onto the macro bar and it will create a macro for that roll for you.