Tome of Tips: Macros

September 13, 2020
tome of tips

Welcome back to the Tome of Tips! Today, we’re tackling a big topic in the world of Roll20. It’s macros!

If you’re not particularly well-versed in macros, you might find them intimidating. In fact, you might have started shaking in your boots of striding at the very mention of the name. Never fear; the Tome is here to help.

We have a couple simple macros at the bottom of this post to get you started. Once you see how powerful and easy-to-use macros really are, you’ll never go back!

But before we get into that, let’s talk a little bit about what a macro actually is.

What are Macros?

Macros are, quite simply, user-defined shortcuts. They help you quickly and easily input commands you want to regularly repeat. Instead of having to type multiple commands over and over, you can type just one short command and cover the whole of what you want to accomplish.

In the most basic terms, macros are just saved rolls and commands.

Once you’ve set a macro up, you can then save it to the Macro Quick Bar or Token Actions for quicker access during play. That’s it!

How Do I Set a Macro Up?

Head to the Collections tab in the Sidebar.

Name your macro, then put in the command. A command could be typed text, a roll, or an emote; it’s whatever you want the macro to accomplish.

Click Save Changes, and just like that–your macro is saved and ready to go.

When you want to call a macro and use it, type # followed by the name you set up for the command into the chat and press enter.

Setting up macros is the easy part. Getting your macro to do what you want is the real trick.

It helps to think of macros as their own sort of language. Like any kind of language, there are grammatical rules to consider when writing.

Let’s break down a simple macro to see what that grammar looks like.

/r 1d20 + @{selected|perception_bonus}

This is a very, very basic macro–so basic, in fact, that it’s essentially built into the 5E character sheet. Let’s break down the components!

/r–this is the command. It tells us the platform what we’re doing. In this case, we’re rolling dice–1d20, to be exact. Then, we want to add the value of the dice roll to something else, so we connect it with a +.

That “something else” happens to be the perception bonus of the token we have selected. The “@” sign tells the system who to look to, and the “{}” set off the rest of the variable. “Selected” notes that we want to check for the value associated with whatever token we have selected at the time we use the macro, and finally, that “perception_bonus” tells it what trait we want to look for.

We can name the macro something like “#per,” and then when we want to make a perception roll for the selected token, we just type #per into chat. It’s that simple!

If you’re looking at the example above and feel your mind start to overflow with a bounty of possibilities, welcome to the wonderful world of macros! There are tons of great resources on how to get the most out of them–on the forums, YouTube, and elsewhere in the Roll20 community. Check out our Help Center to get started and go from there.

If not, hopefully this simple example shows you just how easy setting up quick macros can be, and how much time they can save you in the long run. Like anything, setting up macros takes practice, and you’ll get better as you go along.

Use Macros to... Roll Initiative and send the result to the Turn Tracker

If you roll initiative with a token selected, your roll will automatically be sent to the Turn Tracker (see the Turn Tracker Tome of Tips entry to learn more).

If you want to include that process as part of a macro, just use the command below:

/roll 1d20 + 5 &{tracker}

In this case, “1d20+5” represents the character’s initiative roll. That __&{tracker} __will ensure the roll is automatically sent to the turn tracker.

You can also add or subtract the value of the roll from the current turn value by using __&{tracker:+} __or &{tracker:-}, which is useful for global countdowns.

Execute multiple actions with a single command

This is one of the most common uses for a macro.

Let’s say I’m playing a fighter, and I want to set up a simple macro to make an attack with my broadsword. First, we think about the individual actions we want to accomplish. To swing the broadsword, we need to:

  1. Describe what’s happening

  2. Roll to see if we hit

  3. Roll for Damage

Let’s name this macro #smash.

So, we need three commands.

1. Describe what’s happening

This is pretty simple. We want to send a message to chat. We can do that with the following:

__/me swings the vicious blade __

__2. Roll to see if we hit __

We’ll want to roll our attack to see if we hit. To do so:

__/roll 1d20+10 vs AC __

This will make the roll and automatically add our modifier to it.

3. Roll for Damage

Finally, we want to roll damage.

__/roll 1d10+2 Damage __

This is a really simple take on damage, of course; this is just the baseline for our broadsword with a proficiency added. You’d probably have other modifiers you might like to add to it, and the broadsword is a particularly interesting example, since it’s versatile.

You might want to set up two separate macros; one for a one-handed swing, and one for a two-handed swing, or, if you’re feeling particularly advanced, you could set up a drop-down prompt for the macro–we won’t cover that here today, but know that it’s possible.

Put it all together, and we’ve got:

__ /me swings the vicious blade __

__/roll 1d20+10 vs AC __

__/roll 1d10+2 Damage __

Now, when we type #smash into the chat, this is what we see executed:

It’s that easy!

Add flavor text to the rolls you send to chat

In the example above, we added a little descriptor to bring the attack roll together. Macros are a great way to add some flavor to your rolls–especially with the /em command. Consider the following:

/em @{selected|token_name} pauses, soaking in the surroundings. Then...

/roll 1d20 + @{selected|perception_bonus}

This is another very basic addition to our perception roll, but it adds a lot to a text-only game. You might also do something similar to set up a warlock invoking their patron, or a barbarian screeching a signature catchphrase as they cleave a greataxe through the air.

Whew! That was indeed an exhaustive entry, but hopefully, you have more confidence in the macro-magic just waiting to be unlocked in your heart. This is just the beginning; there’s a whole world of possibilities out there, and the Roll20 community can help you master macros like the best of them. Take a look at the forums to learn more!

Have any topics you’d like to see the Tome tackle? Tweet at us and let us know!

The Roll20 Team

The Roll20 Team

ROLL20 Roll20 is the all-in-one solution for organizing and playing tabletop games online, allowing you to play your games anywhere and share them with anyone virtually. With the ability to choose from a number of popular titles built ready for your virtual tabletop, your adventures are limitless and you can get started playing with little to no prep. Dive into advanced features like Dynamic Lighting or explore macros and APIs to add some extra depth to your game. Roll20 lets you play your tabletop games, your way. YouTube Instagram