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 Menu

Hi Everyone I have been struggling with creating a very basic menu option. I have multiple macros but I have been trying to create a basic menu to select the macro and launch it as opposed to have multiple macros in the bar. I have searched multiple threads and tried different examples but cant get them to work. Does anyone have a basic format that I can use?  Tks David
1606955575

Edited 1607031170
Maybe this thread will help? <a href="https://app.roll20.net/forum/post/9008605/pop-up-menu-for-conditions-not-for-tokens#post-9028394" rel="nofollow">https://app.roll20.net/forum/post/9008605/pop-up-menu-for-conditions-not-for-tokens#post-9028394</a>
1606957918
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It sounds like you are describing a&nbsp; Chat Menu ?
I tried this&nbsp; ?{Select A Macro| Door, #Door| Trick/Trap, #Trick-Trap| Side Passage, #SidePassage} But when i select the different options is just displays the script name in the chat box even though the above macro matches the name Tks David
Here is the updated macro - am I thinking correctly that I need to enter the code to ensure that the called macro (example #Percheck) is called as a new macro? ?{Macro|| Periodic Check, #Percheck| Door, #Door| Side Passage; #SidePassage| Passage Width; #PassageWidth| Special Passage; #SpecialPassage| Turns; #Turns| Chamber and Rooms; #Chamber-room| Unusual Shape; #UnusualShape| Unusual Size; #Unusual Size| Exits; #Exits| Exit Location; #ExitLocation| Exit Direction; #ExitDirection| Chamber/Room Contents; #RoomContents| Treasure Container; #TreasureContainer| Treasure Guardian; #TreasureGuardian| Treasure Hidden; #TreasureHidden| Stairs; #Stairs| Trick/Trap; #Trick-Trap| Gas; #Gas| Wandering Monster; #Monster|}
You've got spaces in the wrong spot (no spaces after the comma before the #), and you're using semicolons instead of commas for some of the listed items: ?{Macro||Periodic Check ,#Percheck|Door ,#Door|Side Passage ,#SidePassage|Passage Width ,#PassageWidth|Special Passage ,#SpecialPassage|Turns ,#Turns|Chamber and Rooms ,#Chamber-room|Unusual Shape ,#UnusualShape|Unusual Size ,#Unusual Size|Exits ,#Exits|Exit Location ,#ExitLocation|Exit Direction ,#ExitDirection|Chamber/Room Contents; #RoomContents|Treasure Container ,#TreasureContainer|Treasure Guardian ,#TreasureGuardian|Treasure Hidden ,#TreasureHidden|Stairs ,#Stairs|Trick/Trap ,#Trick-Trap|Gas ,#Gas|Wandering Monster ,#Monster|}
Jarrenk, thanks I just tried but the above and it has the same results :(
1607020631
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Calling a macro is very problematic in drop down menus, due to HTML replacements if nothing else. I would suggest looking the&nbsp; Chat Menu &nbsp;link I posted above. Combine that with a&nbsp; Macro Character Sheet &nbsp;and the syntax becomes very simple indeed (and portable, to boot).
Dungeon Master said: Jarrenk, thanks I just tried but the above and it has the same results :( Right, you can't call a macro from a drop-down list directly.&nbsp; You could create a button that would need to be clicked for each item though. Here's an example of the first two items: ?{Macro||Periodic Check ,[Periodic Check](!&amp;#13;#Percheck)|Door ,[Door](!&amp;#13;#Door)} You would need to recreate that format for each item.
Hey Keith / Jarren&nbsp; - thanks Keith -if I am understanding correctly is the chat menu creating a character sheet and adding a macro via the attributes and abilities? If yes how do you add that link / button to the character sheet?
1607043677
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
A Chat Menu is a way of running macros or commands from a button-based menu in chat. It can work with Collections Macros or Character Abilities (Macros). A Macro Character Sheet (repository for abilities is not essential, but recommended). Abilities are added on the attributes and abilities tabs. The links describe the syntax, but basically, if you have a character named ex. "Automation" and an Ability on it called "Rollem" (where Rollem is the command&nbsp; /roll 3d6 &nbsp;, then create a macro or ability that can call that using the command&nbsp; [Roll those dice](~Automation|Rollem) The exact syntax will be determined by where you have the abilities stored and where you are calling them from, but the linked posts go through all that.
1607048202

Edited 1607048220
Oosh
Sheet Author
API Scripter
Another option - you can use the drop-down inside a button if you don't mind the extra click (I prefer the full chat menu as suggested above, but some people don't like the chat spam): [?{Macro|PeriodicCheck|Door|SidePassage|PassageWidth|SpecialPassage|Turns}](!&amp;#13;#?{Macro}) Your macros would need to be renamed to match each Query option exactly though.
1607051123
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This is one of those cases where you have to be mindful of HTML replacements of course. Roll20 will parse out that code upon saving. It will work unless you open it again to edit. So if you go that route, be sure to save a pristine copy somewhere safe.
Although for Ability buttons you can avoid the html entity problems by using a backtick&nbsp; ` &nbsp; instead of !&amp;#13; &nbsp;
1607068558
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
In a roll button? I did not know that.
1607090246
Oosh
Sheet Author
API Scripter
Yeah, that's a new one on me.
1607099202
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I just tested it, and it does work for buttons in dropdown queries. I'm not sure what a use case would be, though. If you are choosing a button to send to chat, why not send the menu and make your choice there?
1607140661
Oosh
Sheet Author
API Scripter
I agree, I prefer chat menus - there's been a few people say they don't like the chat spam though. And one case I remember where someone said the GM gets antsy when they constantly see the "player 2 is typing..." message in the chat log, so they didn't want to use chat menus. And also... just exploiting the order of operations, instead of being hamstrung by it, is fun :)
1607141954
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
For anyone following the thread, I thought it might be handy to post a specific example solution. Create a character, we can name it anything, but let's use "Macros" just because. On this character in the Attributes and Abilities tab, create your macros (abilities). We have three, named "Door", "Trick-Trap", and "SidePassage". Then we make a chat menu. This is another ability on the same sheet. We'll call it "Menu". Here is a way to construct it: /w gm &amp;{template:npcaction} {{rname=Menu}} {{description=[Door](~Door) [Trick or Trap](~Trick-Trap) [Side Passage](~SidePassage)}} This will generate a menu of buttons in chat, whispered to the GM that looks like this: Or if you use the Stylus style&nbsp; here , looks like this: Clicking on one of the buttons will run the corresponding macro. To make the macro easy to call, you can click the "show on macro bar" button. If you prefer it to be in your collections sidebar, create a macro with the contents: %{Macros|Menu} and it will call the "Menu" Ability on the character "Macros"
1607556066

Edited 1607556499
Many thanks - you are all excellent. I must be daft because its not working for me and sure I am missing something. I created the abilities I entered your menu script in the attribute. I am not sure if I need to enter the macro directly for each one into the above filed. I launch the menu chat and click on one of the options and have this error TypeError: Cannot read property 'substring' of undefined Tks david
1607629532
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Dungeon Master said: Many thanks - you are all excellent. I must be daft because its not working for me and sure I am missing something. I created the abilities I entered your menu script in the attribute. Just to make sure, you are adding everything in Abilities (right hand side) not Attributes (left hand side) correct? Attributes are for holding values, Abilities are for holding instructions. Nothing I posted should go into an attribute.
Well&nbsp; I am an idiot! I missed that! Excellent work thanks
1607650961
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Great! I was on here for months before I even realized what the Abilities Tab was for.