Recent Chat Activity (Main Lobby)
Join Chat

Loading Chat Log...

Prefer not to see ads? Become a Community Supporter.
View RSS Feed


Writing Macros

Rate this Entry
So you're playing a game in MapTool and constantly typing [1d20 + 4 + 3 + 2 + 3] when you need to make an attack. Its really annoying and it would be nice if the program would remember the roll and all of your bonuses for you, and maybe did the mass at the click of a button to save wear on your finger tips. Thats exactly where the macros come in, so lets start figuring out how to make those work for you.

It seems to me that the most useful macros are bound to the characters, so thats how we'll create them here.

To do that drop the token for the character onto the map, then select him. In the macro frame you should see the text "No Macros", right click that text and choose the "Add New Macro" option from the menu. That will replace the text with a "(new)" button. That button doesn't do anything yet, right click the button and choose the "Edit" menu option. That will take you to this form:

Here's where we'll be typing our macros. There's only three fields we need to worry about right now, the others can be left alone until later.

  • Label - This is where you set the caption of the button for this macro. Unless you want a bunch of macro buttons that say (new) you'll want to change this.
  • Group - You can group macros together by giving them all the same group name. This will allow you to put keep similar macros together so you can find them easier.
  • Command - This is the real meat of the macro, all of the stuff that its supposed to do will be in here.

Label and Group are pretty simple. So I'm just going to talk about what goes into the Command text box, since thats where all the interesting stuff happens.

Lets start simple, you attack roll is a 1d20 plus strength bonus of 4, a level bonus of 3, a weapon enchantment bonus of 2, and a weapon proficiency bonus of 3. So the whole roll would be typed into the chat as [1d20 + 4 + 3 + 2 + 3], so lets put that in as our command and click the OK button to save it. Now every time that button is clicked it will do that roll for you.

It looks kind of plain though, the output is just that roll. It might be nice to have the macro state the attack you are doing and maybe toss in a splash of color so it all stands out to the GM. This isn't as bad as it sounds, the macros support HTML so we can use that the spruce up the output. Lets change out macro to look like this:
<table style="width:100%;">
<tr style="background-color:Green">
<td><span style="color:white"><b>Longsword Swing</b></td></tr>
 [1d20 + 4 + 3 + 2 + 3]
That does the same roll, except it puts a label above it so it stands out. In the chat it will look like this:

You might think that roll output looks a little cumbersome. There's an awful lot of numbers in there; and really all you care about is the total at the end, the 20. So lets change our roll slightly, we can add some output flags right after the open square bracket to set how to display it. You can use H to hide the output, R to only show the results, and T to show the results but include a tooltip with all the details. The T flag works best since you can still see the values and perhaps checking for a critical hit is nice to be able to do. We'll add that to the macro making it look like this:
<table style="width:100%;">
<tr style="background-color:Green">
<td><span style="color:white"><b>Longsword Swing</b></td></tr>
 [t: 1d20 + 4 + 3 + 2 + 3]
When we use the macro it looks like this in the chat log:

The tooltip only shows when you hover the mouse over the result, in this case the 14, and it shows all the details of the roll.

These aren't particularly exciting macros, but they can be pretty handy since you don't have to worry about typing that roll over and over again. However, you will need to update the macro each and every time your bonuses change. If you have a macro for each of your attacks that can get pretty annoying. Next time I'll show a way of simplifying those updates.

Submit "Writing Macros" to Digg Submit "Writing Macros" to Submit "Writing Macros" to StumbleUpon Submit "Writing Macros" to Google

Updated 08-14-2009 at 11:47 AM by Q-man

Tags: None Add / Edit Tags


  1. michael's Avatar
    This is pretty useful stuff. Thanks for posting. Are you talking about the maptool on
    Updated 08-31-2009 at 07:40 AM by michael (to ask follow up question)
  2. Q-man's Avatar
    Yes I am, I just started working with MapTool program, so all the stuff that I figure out has been slowly finding its way into posts here. It helps me remember, and it just might be useful to someone else.

    You'll probably see me babbling about it more in subsequent posts.
  3. michael's Avatar