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

Help with a macro (Request)

So I recently bought a module that had some premade creatures, this creatures already had some macros integrated as a token action for each one, I would like to take said macro and be able to put it in my macro bar so I can use it with any token I have selected and not have to go into Abilities and add it in there individually, however I have no knowledge on how to macro at all. Could anyone help? Its a saving throw token action with drop down menu @{selected|wtype} &{template:simple}{{always=1}}?{Saving Throw|STR,{{rname=Strength Save}}{{mod=@{npc_str_save}}} {{r1=[[1d20+@{npc_str_save}]]}}{{r2=[[1d20+@{npc_str_save}]]}}|DEX,{{rname=Dexterity Save}}{{mod=@{npc_dex_save}}} {{r1=[[1d20+@{npc_dex_save}]]}}{{r2=[[1d20+@{npc_dex_save}]]}}|CON,{{rname=Constitution Save}}{{mod=@{npc_con_save}}} {{r1=[[1d20+@{npc_con_save}]]}}{{r2=[[1d20+@{npc_con_save}]]}}|INT,{{rname=Intelligence Save}}{{mod=@{npc_int_save}}} {{r1=[[1d20+@{npc_int_save}]]}}{{r2=[[1d20+@{npc_int_save}]]}}|WIS,{{rname=Wisdom Save}}{{mod=@{npc_wis_save}}} {{r1=[[1d20+@{npc_wis_save}]]}}{{r2=[[1d20+@{npc_wis_save}]]}}|CHA,{{rname=Charisma Save}}{{mod=@{npc_cha_save}}} {{r1=[[1d20+@{npc_cha_save}]]}}{{r2=[[1d20+@{npc_cha_save}]]}}}{{charname=@{character_name}}}
As an alternative to creating this Collections Macro (which requires those html replacements and they will be parsed as soon as you open the macro), you can use Chat Menus instead.  It appears that you are playing D&D 5th edition using the D&D 5E by Roll20 sheet, and you have a Plus subscription, so you could import my  Universal Macro Mule  and have it ready in just a couple minutes.  
1709866896

Edited 1709866931
Gauss
Forum Champion
I have to agree with Jarren, this macro will not do well as a Collection Macro. It will break the moment you reopen it.  Create a Macro Mule, put it in the Mule Abilities, then checkmark the Macro Bar box instead of the Token Action box.  The other change  you will need to make is to put "selected|" in every attribute.  Example: @{npc_str_save} becomes @{selected|npc_str_save}
1709868903
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The macro Gauss suggests would become: @{selected|wtype} &{template:simple}{{always=1}}?{Saving Throw|STR,{{rname=Strength Save}}{{mod=@{selected|npc_str_save}}} {{r1=[[1d20+@{selected|npc_str_save}]]}}{{r2=[[1d20+@{selected|npc_str_save}]]}}|DEX,{{rname=Dexterity Save}}{{mod=@{selected|npc_dex_save}}} {{r1=[[1d20+@{selected|npc_dex_save}]]}}{{r2=[[1d20+@{selected|npc_dex_save}]]}}|CON,{{rname=Constitution Save}}{{mod=@{selected|npc_con_save}}} {{r1=[[1d20+@{selected|npc_con_save}]]}}{{r2=[[1d20+@{selected|npc_con_save}]]}}|INT,{{rname=Intelligence Save}}{{mod=@{selected|npc_int_save}}} {{r1=[[1d20+@{selected|npc_int_save}]]}}{{r2=[[1d20+@{selected|npc_int_save}]]}}|WIS,{{rname=Wisdom Save}}{{mod=@{selected|npc_wis_save}}} {{r1=[[1d20+@{selected|npc_wis_save}]]}}{{r2=[[1d20+@{selected|npc_wis_save}]]}}|CHA,{{rname=Charisma Save}}{{mod=@{selected|npc_cha_save}}} {{r1=[[1d20+@{selected|npc_cha_save}]]}}{{r2=[[1d20+@{selected|npc_cha_save}]]}}}{{charname=@{selected|character_name}}} Also, note that the syntax is different for PCs and NPCs. You would need to do something similar for PCs: @{selected|wtype}&{template:simple}  @{selected|rtype}?{Saving Throw|Strength, +@{selected|Strength_save_bonus}@{selected|pbd_safe}[STR SAVE]]]}} {{rname=Strength Save}&#125 {{mod=@{selected|Strength_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|Strength_save_bonus}@{selected|pbd_safe}[STR SAVE]]]|Dexterity, +@{selected|Dexterity_save_bonus}@{selected|pbd_safe}[DEX SAVE]]]}} {{rname=Dexterity Save}&#125 {{mod=@{selected|Dexterity_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|Dexterity_save_bonus}@{selected|pbd_safe}[DEX SAVE]]]|Constitution, +@{selected|Constitution_save_bonus}@{selected|pbd_safe}[CON SAVE]]]}} {{rname=Constitution Save}&#125 {{mod=@{selected|Constitution_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|Constitution_save_bonus}@{selected|pbd_safe}[CON SAVE]]]|Intelligence, +@{selected|Intelligence_save_bonus}@{selected|pbd_safe}[INT SAVE]]]}} {{rname=Intelligence Save}&#125 {{mod=@{selected|Intelligence_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|Intelligence_save_bonus}@{selected|pbd_safe}[INT SAVE]]]|Wisdom, +@{selected|Wisdom_save_bonus}@{selected|pbd_safe}[WIS SAVE]]]}} {{rname=Wisdom Save}&#125 {{mod=@{selected|Wisdom_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|Wisdom_save_bonus}@{selected|pbd_safe}[WIS SAVE]]]|Charisma, +@{selected|Charisma_save_bonus}@{selected|pbd_safe}[CHA SAVE]]]}} {{rname=Charisma Save}&#125 {{mod=@{selected|Charisma_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|Charisma_save_bonus}@{selected|pbd_safe}[CHA SAVE]]]}}} {{global=@{selected|global_save_mod}}} {{type=Save}} {{typec=Save}} @{selected|charname_output} But if you want a full suite of generic macros (actually called abilities, when they are on a sheet, rather than in collections) to use for all characters, Jarren's system is excellent and easy to read. The only drawback is that not everyone like  Chat Menus . If you do ever decide to upgrade to a Pro subscription, the script that makes the macros you see in Roll20-produced modules is Token Action Maker.
Okay so if Im understanding correctly I have to use the Chat Menus thing, I already have a macro that throws up a similar looking table with all the saves at the same time, either that or upgrade to Pro so I can use a script? Im sorry if I got it wrong, I really have no idea how any of this works
If you’re interested in using the MacroMule I’ve already done the heavy lifting.  It will only take a couple of minutes: 1. Join my  'Macro Mule Character Vault' game 2. Launch Game 3. Select the 'MacroMule' token in the middle of the page and click on the 'MacroMule Script' token action button to display a chat menu with three buttons. 4. Click on the three buttons in the chat window: 'Change MacroMule name', ' Create/Refresh Macro Mule', and ' Create/Refresh Collection Macros' 5. Go to your  Characters page  and click on the 'Import' button and import the MacroMule character into your Characters "vault" 6. On the same Characters page, click on the small plus (+) button on the MacroMule character to add it to your regular game. 7. Enter your regular game and open the character sheet for the MacroMule character.  Set the 'Can Be Edited and Controlled By' to 'All' Players. (But do not  set 'In Players Journals' to 'All Players'.) 8.  Create the Collections macros  to call the Macro Mule chat menus. You can either create them as Collections Macros, or as individual token actions on each PC sheet. If you want to play around with just a single macro at first, then just create this one as a Collections Macro (make sure the 'MM' is changed to whatever your MacroMule character is named): Menu %{MM|Menu} &{noerror} That's it!   You and your players just have to press the relevant token action buttons to see all the stats, rolls, spells, etc. from a character. 9. (Optional, but I would recommend it)  Adjust the Whisper settings  so that the menus are whispered directly to the player, instead of anyone who controls the character.  This is especially useful if more than one player controls a PC for any reason, or if you want players to control any NPCs.
1709881534
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Carlos G. said: Okay so if Im understanding correctly I have to use the Chat Menus thing, I already have a macro that throws up a similar looking table with all the saves at the same time, either that or upgrade to Pro so I can use a script? Im sorry if I got it wrong, I really have no idea how any of this works Hah! I remember how that felt when I first started Roll20. The thing is that each "problem" can have a dozen different solutions. The choices shown so far are: 1. Adapt your existing macro. Pros: Easily done. The code is up above and Gauss has described how to place it on a macro mule for any token to use. Cons: Only does saves. May throw an error if no token is selected. 2. Jarren's Macro Mule Pros: Fully developed suite of macros that work with all characters. Easy to use once set up. Cons: Looks intimidating if you are not sure what you are doing. Following the instructions methodically should get you there, though. Some people don't like a lot of "clutter" in the chat. 3. Use a script (Token Action Maker) Pros: Matches all of the provided characters in a module. Very easy to set up (select any token and type !ta in chat). Only requires API to set up, and then runs in any game. Cons: Requires Pro subscription to use.  Some people don't like a lot of button "clutter" on screen.   There are even more ways, and variations on the above ways to accomplish these goals, but since you are new, I'd suggest to just pick one and see how it works out: what you like and dislike about the approach.
1709905517

Edited 1709908832
GiGs
Pro
Sheet Author
API Scripter
If you do really want to go the macro collection route (and I agree with the previous posts about better ways, I'm just being complete), here's how to do it: Take the macro text @{selected|wtype} &{template:simple}{{always=1}}?{Saving Throw|STR,{{rname=Strength Save}}{{mod=@{npc_str_save}}} {{r1=[[1d20+@{npc_str_save}]]}}{{r2=[[1d20+@{npc_str_save}]]}}|DEX,{{rname=Dexterity Save}}{{mod=@{npc_dex_save}}} {{r1=[[1d20+@{npc_dex_save}]]}}{{r2=[[1d20+@{npc_dex_save}]]}}|CON,{{rname=Constitution Save}}{{mod=@{npc_con_save}}} {{r1=[[1d20+@{npc_con_save}]]}}{{r2=[[1d20+@{npc_con_save}]]}}|INT,{{rname=Intelligence Save}}{{mod=@{npc_int_save}}} {{r1=[[1d20+@{npc_int_save}]]}}{{r2=[[1d20+@{npc_int_save}]]}}|WIS,{{rname=Wisdom Save}}{{mod=@{npc_wis_save}}} {{r1=[[1d20+@{npc_wis_save}]]}}{{r2=[[1d20+@{npc_wis_save}]]}}|CHA,{{rname=Charisma Save}}{{mod=@{npc_cha_save}}} {{r1=[[1d20+@{npc_cha_save}]]}}{{r2=[[1d20+@{npc_cha_save}]]}}}{{charname=@{character_name}}} Paste it into notepad or another text editor, do a Find/Replace: Find: @{ Replace: @{selected| Replace All, then paste the new text into a new macro, close it and this is really important: never reopen it . Using the macro: Now, you can select any token, and if that token is linked to a character, you can run the macro and it will work. Caveats The previous suggested methods are better, for various reasons, but might be more hassle. If you create a macro in this way, you must never reopen it. If you do, all the structures like this: }} will become something else, and the macro will stop working. So if you use this method, make sure you have a copy of the original or modified macro saved somewhere so you can reproduce the macro quickly and easily.
1709909711
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Additional steps to the above: Make sure the macro permissions are set for "All Players", if you want your players to use it. This has to be done while you are creating the macro, because as GiGs says, you can't re-open it. Once the Macro is saved, click "Token Action". This will ensure that it will only appear when a token is selected, saving you from accidentally using it when it would produce an error.
Okay Im setting up Macro Mule, but what is this Collections Macro thingy, how do I set it up?
1709914720
Gauss
Forum Champion
Carlos G. said: Okay Im setting up Macro Mule, but what is this Collections Macro thingy, how do I set it up? Collections Macros are the regular macros in the Collections tab (top right hand corner of the game).  Collections macros have some quirks that Character's Abilities macros do not have. Such as not playing nice with HTML Entities. 
Okay I got Macro Mule working! Is there a way to integrate it with dark mode? I notice the text colors are meant for light mode
Carlos G. said: Okay I got Macro Mule working! Is there a way to integrate it with dark mode? I notice the text colors are meant for light mode It's a very long thread to read through, but there's a post on exactly that. :)  Step 3: Customization      Instructions on how to customize the appearance ( important for Dark Mode! ).      Instructions on how to customize Whisper Settings.