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/ability inside an API Command Button

I'm trying to insert a macro or an ability that my players will activate by clicking on a API Command Button that I put into chat. I'm hoping i can create a miniature mock choose your own adventure minigame for my players by linking buttons and descriptions behind each command. The problem I'm having is that it doesn't seem to want to recognize the macro or ability. I can get the command button to do something simple like make a roll but not actually link to a macro. Here is what I have, with the first line being the working roll button and the second trying to call an ability (also tried as a macro) called "HELLO". I also tried with an exclamation mark modeled after the example in the API Command Button wiki page but to no avail. Any tips or advice is appreciated. [Roll This](!
[[1d20]]) [Hello](!
#HELLO)
1524647110

Edited 1524647136
Finderski
Pro
Sheet Author
Compendium Curator
The exclamation point is trying to trigger an API command, but what you want is an Ability Command button.  Try this format: [Hello](~#HELLO)
If you want an API button that triggers a macro inside another macro so it will drop in chat, you have to replace the prefix with !
# An API button in a macro to call on a Hit Point macro named "NPC-HP" would like like this: [Roll NPC HP](!
#NPC-HP) I hope this helps
1524671608
Finderski
Pro
Sheet Author
Compendium Curator
Since Nathaniel isn't a Pro subscriber and won't have access to the API Command button (at least as I understand it, unless there's a different GM who is a Pro subscriber who's hosting this game); instead they'll need to use the  Ability Command Button syntax, which replaces the "!" with a "~".
1524677981
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I would strongly advise using Ability Command Buttons, and building your macros in a  Macro Character Sheet . It will make the syntax much, much simpler, especially if you are putting ability command buttons into roll templates.
Thanks for all the help everyone. The final iteration that worked for me is: [Hello](~GM|HELLO) With "GM" being the character sheet "HELLO" is on. I'm also going to be taking Kieth's advice and moving all my macro's into a macro Character Sheet. Thanks again!