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 chat menu.

I have been playing with chat menus and read in this old post(quoted below)   that it is possible to post a simple Roll Command to the API button but am having trouble with the syntax. The code below navigates me out of the Roll twenty App [Roll a D12]([[1d12]]) Note also, that you can embed a Roll Command into the API button instead of a macro, if you simply have a bit of code you use over and over, but a better practice (at least I have found) is to keep as much code in macros as possible, so that if you use the same command in different places, you only have to edit the original if you later decide to change how something works. If it's just an API call (a script call, beginning with "!"), it's pretty safe to pop in as-is.
1601442304
Kraynic
Pro
Sheet Author
I'm not an expert in setting up a chat menu that way.&nbsp; I always host the macro on the Attributes &amp; Abilities tab of a character sheet/journal.&nbsp; For the example, we will pretend I made a "character" named Macros.&nbsp; As an ability, I entered the following macro named "D12": &amp;{template:default} {{name=D12}} {{Roll=[[1d12]]}} Then the chat menu button would look like this: [Roll a D12](~Macros|D12) The advantage to doing things this way is that you can use this button anywhere and it will roll that D12 ability on the Macros sheet.&nbsp; If you are using more complicated macros, that gives you a single instance to edit if you ever need to change anything, rather than hunting down all instances that you may have used in global macros, description areas of attacks, etc. What I have just described is the "macro mule" concept from the Stupid Tricks thread that is pinned at the top of this forum (the first post is an index). <a href="https://app.roll20.net/forum/permalink/7605679/" rel="nofollow">https://app.roll20.net/forum/permalink/7605679/</a>
1601448589

Edited 1601448934
Oosh
Sheet Author
API Scripter
Kraynic's advice is the best way to go - if you're setting up a whole heap of macros, using the systematic approach is best. Having said that, for academic and/or fun value, you can do some quick &amp; dirty roll buttons like this: [Roll a D12](!&amp;#13;/r 1d12) Or if you want inline rolls, you need to use some HTML substitution to stop it from rolling the dice before creating the button: [Roll a D12](!&amp;#13;[&amp;lsqb;1d12&amp;rsqb;]) And you can even hide a Query in there, as long as you go full entity on it: [Roll some D12](!&amp;#13;[&amp;lsqb;&amp;quest;&amp;#123;How many dice?&amp;#124;3&amp;#125;d12&amp;rsqb;]) All of the above will lose their entities if saved as a Collection macro and reopened at any point. Of course, you can get even sillier: [Roll some D12](!&amp;#13;[&amp;lsqb;&amp;quest;&amp;#123;How many dice?&amp;#124;3&amp;#125;d12&amp;rsqb;]" style="font-size:30px;border:1px solid;border-radius:10px;padding:15px;background-color:black) Buttons are fun! I'll stop now...
Oosh and Kraynic,&nbsp; Thanks for your help. I have used the "macro mule" for so many things, I am not sure why I got lazy about making simple roll macros... I was probably in denial about the necessary HTML substitution work :) Y'all are great!