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

Clickable Macros in Chat

1490909023
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I know how to do API Buttons and Ability Buttons. Is there anything that will let you send a clickable link to the chat log that acts like an API button, but runs a regular macro? I have some macros that display rules info quickly and concisely, but I'd like to reduce the clutter in my macro bar and consolidate them into a roll template if possible. I've done that with API script commands, but I just can't see how to do it with macros, and searching is turning up nothing. Is this possible?
1490909169

Edited 1490909258
Andrew C
Marketplace Creator
I do it all the time. You load API Command Buttons into a template with layers of HTML replacement.
1490909349
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Example? Lets say I had a macro named Conditions. An ordinary API command button is [Conditions](!some_script_command) How do I do that with a macro? And do I have to be careful to save the original text elsewhere for editing because of HTML element conversion upon saving?
1490909616
Andrew C
Marketplace Creator
So anything in it that might trigger closing the table (&, { , [, (, etc) need to be replaced inside the API Command Button. When I get to a desktop I can drop one I did for incorporeal traits in 3.5E D&D
1490909658
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Actually here is the text of the macro in question, at it's earliest stage (only two options): /w gm &{template:5e-shaped} {{title=Rules}} {{text-big=[Weapons](#Weapons) | [Conditions](#Condition)}}
1490909820
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
See the part in the  wiki about "entering api buttons in chat'. Basically, it'd look like this: [Conditions](!
#Conditions) You can also call abilities this way, but unless you want the ability to run when you send the button, you need to html encode the % with % You can also have rolls performed when the chat button is sent (This is my preferred method for blind rolls): [Hidden Roll](![[
[[1d6]]) If you want a roll to roll when the button is clicked (and you aren't calling a global macro) you need to html encode the inline roll brackets: [Roll This](!
[[1d6]])
1490909888

Edited 1490910031
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
keithcurtis said: Actually here is the text of the macro in question, at it's earliest stage (only two options): /w gm &{template:5e-shaped} {{title=Rules}} {{text-big=[Weapons](#Weapons) | [Conditions](#Condition)}} yep, see my post that went up just after yours. Andrew (Halfling Gypsy) said: So anything in it that might trigger closing the table (&, { , [, (, etc) need to be replaced inside the API Command Button. When I get to a desktop I can drop one I did for incorporeal traits in 3.5E D&D This isn't quite true. There are characters that cause problems in API command buttons, but none of these are the problem. If you have colons in your macro, then those need to be replaced, or preceeded by a forward slash (/) on the same line. Inline rolls can also cause problems, see my post above with syntax for passing the result of a roll (as opposed to an expression to roll) via api command button.
1490910464

Edited 1490910540
Andrew C
Marketplace Creator
I have mine buried a few layers deep to start with because I use a macro to trigger the chat from a Bar on a token.
1490910606
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Brilliant! Thank you both! I believe I have the hang of this now. That's been bothering me for a while. I read the wiki but couldn't get the sense of it. Your examples helped.
1490911583
Andrew C
Marketplace Creator
/w gm &{template:DnD35StdRoll} {{name=Ghostsinger&amp;NewLine;Properties}} {{**Daylight Powerlessness**=In daylight a Ghostsinger is powerless and cannot manifest on the Material Plane to make attacks. If flees to the Ethereal Plane and will avoid such areas of light on both planes}} {{Incorporeal=[Incorporeal Traits Link](<a href="http://www.d20srd.org/srd/typesSubtypes.htm#incorporealSubtype" rel="nofollow">http://www.d20srd.org/srd/typesSubtypes.htm#incorporealSubtype</a>)}} {{Undead Traits=[Undead Traits](<a href="http://www.d20srd.org/srd/typesSubtypes.htm#undeadType" rel="nofollow">http://www.d20srd.org/srd/typesSubtypes.htm#undeadType</a>)}} And here's another example of something a bit more elaborate... /w gm **Antechamber** [Description](!&amp;NewLine;/desc This is an antechamber with two doors heading out. There are more scenes on the walls of the same warrior, beating tribesmen but clearly each battle is with different tribes because of the different clothing and colours. There seems to be eight different tribes all together.) [Right Door](!&amp;NewLine;/desc You try to open the door leaving this room, and it appears to be locked) [Left Door](!&amp;NewLine;/desc The door opens easily and leads into a corridor with similar murals to the room you just left.) [Open R Door](!&amp;NewLine;/w gm &amp;{template:DnD35StdRoll} {{name=Locked Door}} {{Open Lock DC = 18}} {{Stats = 10 HP &amp;NewLine;Toughness 4 }})
1490912052
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I like the hypertext links. Nice!
1490912570
Andrew C
Marketplace Creator
If you want to load things into the Command Buttons, just be careful. And sometimes wierd things happen with the symbols you want to use. You might find you have to drop 'rogue' characters to havethings like template tables show up properly and so on.
1490921490
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Is it possible to have a Command Button resolve to text? i.e. have a list of buttons that send strings of text to the chat? I have some things in macro queries now that would be better severed by a point and click interface. I assume it would be possible if I had a boatload of macros that it calls, but it would be nice to have it all in one place.
1490922396
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
sure, you can put anything in API command buttons, just put "!&amp;#13;" at the start of the url section: [Button Label](!&amp;#13;Whatever you want, be it macros, text, ability calls, or macro calls)
1490923334
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hawley Smoot! I got some typin' to do!
1490957410
Andrew C
Marketplace Creator
keithcurtis said: Is it possible to have a Command Button resolve to text? i.e. have a list of buttons that send strings of text to the chat? I have some things in macro queries now that would be better severed by a point and click interface. I assume it would be possible if I had a boatload of macros that it calls, but it would be nice to have it all in one place. You know how I said I do a bunch of these? Room descriptions Tables of info for GMs Notes about special rules Locked Doors Secret Doors Traps for GM and for Players (i.e. a description followed by damage rolls) ... and so on. Done a whole bunch of it.
Andrew, could you post a screen shot of one of your chat text menus?
1491081605

Edited 1491082017
Andrew C
Marketplace Creator
Code: /em fires a group of magic projectiles. **NOTE The code keeps reverting when I open and save this. After each ! should be &amp;NewLine; and all of the "@" after **the [3 Missiles] should be "&amp;commat;" /w @{selected|token_name}[3 Missiles](!&NewLine; / &{template:default} {{name=Magic Missile}} {{Damage = [[1d4+1]]}} {{Target 1 = @{target|Target 1|token_name} }}{{Target 2 = @{target|Target 2|token_name} }}{{Target 3 = @{target|Target 3|token_name} }} ) [4 Missiles](!&NewLine;&nbsp;/ &{template:default} {{name=Magic Missile}} {{subtags=*@{selected|token_name} fires a group of magic projectiles. * }} {{Damage=[[1d4+1]]}} {{Target 1 = @{target|Target1|token_name} }}{{Target 2 = @{target|Target 2|token_name} }}{{Target 3 = @{target|Target 3|token_name} }} {{Target 4 = @{target|Target4|token_name} }})[5 Missiles](!&NewLine; / &{template:default}{{name=Magic Missile}} {{subtags=*@{selected|token_name} firesa group of magic projectiles. * }} {{Damage = [[1d4+1]]}}{{Target 1 = @{target|Target 1|token_name} }}{{Target 2 = @{target|Target2|token_name} }}{{Target 3 = @{target|Target 3|token_name} }} {{Target4 = @{target|Target 4|token_name} }} {{Target 5 = @{target|Target5|token_name} }}) [6 Missiles](!&NewLine;&nbsp;/ &{template:default}{{name=Magic Missile}} {{subtags=*@{selected|token_name} fires a group of magic projectiles. * }} {{Damage = [[1d4+1]]}} {{Target 1 = @{target|Target 1|token_name} }}{{Target 2 = @{target|Target 2|token_name} }}{{Target 3 = @{target|Target 3|token_name} }} {{Target 4 = @{target|Target 4|token_name} }} {{Target 5 = @{target|Target4|token_name} }} {{Target 6 = @{target|Target 6|token_name} }}) [7Missiles](!&NewLine;&nbsp;/ &{template:default} {{name=Magic Missile}} {{subtags=*@{selected|token_name}fires a group of magic projectiles. * }} {{Damage =[[1d4+1]]}} {{Target 1 = @{target|Target1|token_name} }}{{Target 2 = @{target|Target 2|token_name} }}{{Target3 = @{target|Target 3|token_name} }} {{Target 4 = @{target|Target4|token_name} }} {{Target 5 = @{target|Target 5|token_name} }} {{Target6 = @{target|Target 6|token_name} }} {{Target 7 = @{target|Target7|token_name} }}) [8 Missiles](!&NewLine;&nbsp;/ &{template:default}{{name=Magic Missile}} {{subtags=*@{selected|token_name} firesa group of magic projectiles. * }} {{Damage = [[1d4+1]]}}{{Target 1 = @{target|Target 1|token_name} }}{{Target 2 = @{target|Target2|token_name} }}{{Target 3 = @{target|Target 3|token_name} }} {{Target4 = @{target|Target 4|token_name} }} {{Target 5 = @{target|Target5|token_name} }} {{Target 6 = @{target|Target 6|token_name} }} {{Target7 = @{target|Target 7|token_name} }}{{Target 8 = @{target|Target8|token_name} }}) EDIT: Damned parser converted the "@" from their HTML "@". I'll fix it in a bit. EDIT 2: Fixed This should be fine if you copy and paste it into the chat of your own game. It isn't 'game specific' in the sense that some templates are only available on games with the corresponding sheet. Then you can see it for yourself. They generally turn up as a bunch of pink buttons, and the pink buttons are labelled with the words between the initial set of square brackets [Button 1](Stuff button 1 does, which could include more buttons, tables, dice rolls, etc)
If that was in regards to my comment, I meant a screen shot of the actual output. You explained in the last few sentences what I was wondering: if it came out as the colored buttons or as the plain text buttons. thank you.
1491145915
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The nature of your buttons is determined a lot by your roll template. Without the template, they are pink buttons. In my examples above, they are text links because the [Shaped] roll template causes them to appear that way.
Going to have to look at the 5e shaped template code to add it to mine.
1491154335
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Another fun trick is to consider the occasional use of emojis in script buttons. Here is what I use for controlling music. It's easier for me to use than scrolling through the Jukebox.
keithcurtis said: Another fun trick is to consider the occasional use of emojis in script buttons. Here is what I use for controlling music. It's easier for me to use than scrolling through the Jukebox. can you post the macro you created?
1491328825
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'll do better than that. I'll clean it up, but the code is actually generated by a Google sheet, where all I do is put in track names. Then I copy the calculated column. I was kind of waiting for Scott C to have time to work out the bugs of the fade command, but I guess that's what version numbers are for, right? I'll put it into a new thread, though, so it can be more easily found, but I'll link it here.
1491329524
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yeah, It's still on my todo list, just ask me for anything but time. Gotta love that grad school life.
1491331387
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It doesn't get any better... :)
1491332182
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The link to the spreadsheet code generator is&nbsp; here .
1491342074
Andrew C
Marketplace Creator
OldSchoolChris said: If that was in regards to my comment, I meant a screen shot of the actual output. You explained in the last few sentences what I was wondering: if it came out as the colored buttons or as the plain text buttons. thank you. This is the chat output from my Magic Missile Macro above. &nbsp;I chose 3 missiles.
If you are using 5e then this is what I use. Copy Magic missile from the Compendium to your spells and change the setting as follows: Now go to the core and click on the setting for magic missiles and setup as follows: In the Description box add ?{spell slot|1, Bolt2[[1d4+1]] Bolt3[[1d4+1]]| 2,Bolt2[[1d4+1]] Bolt3[[1d4+1]] Bolt4[[1d4+1]] | 3,Bolt2[[1d4+1]] Bolt3[[1d4+1]] Bolt4[[1d4+1]] Bolt5[[1d4+1]] | 4,Bolt2[[1d4+1]] Bolt3[[1d4+1]] Bolt4[[1d4+1]] Bolt5[[1d4+1]] Bolt6[[1d4+1]] | 5,Bolt2[[1d4+1]] Bolt3[[1d4+1]] Bolt4[[1d4+1]] Bolt5[[1d4+1]] Bolt6[[1d4+1]] Bolt7[[1d4+1]] | 6,Bolt2[[1d4+1]] Bolt3[[1d4+1]] Bolt4[[1d4+1]] Bolt5[[1d4+1]] Bolt6[[1d4+1]] Bolt7[[1d4+1]] Bolt8[[1d4+1]] | 7,Bolt2[[1d4+1]] Bolt3[[1d4+1]] Bolt4[[1d4+1]] Bolt5[[1d4+1]] Bolt6[[1d4+1]] Bolt7[[1d4+1]] Bolt8[[1d4+1]] Bolt9[[1d4+1]] | 8,Bolt2[[1d4+1]] Bolt3[[1d4+1]] Bolt4[[1d4+1]] Bolt5[[1d4+1]] Bolt6[[1d4+1]] Bolt7[[1d4+1]] Bolt8[[1d4+1]] Bolt9[[1d4+1]] Bolt10[[1d4+1]] | 9,Bolt2[[1d4+1]] Bolt3[[1d4+1]] Bolt4[[1d4+1]] Bolt5[[1d4+1]] Bolt6[[1d4+1]] Bolt7[[1d4+1]] Bolt8[[1d4+1]] Bolt9[[1d4+1]] Bolt10[[1d4+1]] Bolt11[[1d4+1]]} and the output show look like&nbsp;
1491367714
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Very slick macro. Just to make sure you realize, magic missile damage die is rolled once and each bolt does that much damage. Very few tables run it that way in my experience (mine doesn't), but it is RAW.
1491367929

Edited 1491367947
Honestly it's more RAI than RAW, the one twitter comment was the only place I have seen it read that way. Besides rolling more dice is always more fun.&nbsp;
1491370986
Andrew C
Marketplace Creator
Ed S. said: Honestly it's more RAI than RAW, the one twitter comment was the only place I have seen it read that way. Besides rolling more dice is always more fun.&nbsp; As I understand that 'one twitter comment' was by the main editor of the system.
1491402162
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Yes, Jeremy Crawford. His claim is the one die roll is RAW, but that it wouldn't break anything to roll them individually. My suspicion is that the vast majority of tables roll individually.