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

Selecting Which Macro within a Macro

Saw this earlier somewhere but I couldn't quite figure it out. I have this macro below, and I want so that if someone typed an ! in the dialogue box, it would run test2. Otherwise, it would run test1. Right now of course, both are running at no ! and none are running at an !. ?{Confirm}#test1 ?{Confirm}#test2
1435957299
Gen Kitty
Forum Champion
This is a bit of a hack and takes advantage of the system-parser interpreting any line starting with ! as a call to an installed API script, and if it can't find a script that makes it happy it silently discards the line. ?{Macro 1?|!} #test1 ?{Macro 2?|!} #test2 I use this for non-API variable multi-targeting. Here's a simple proof of concept macro anyone can immediately try: /me bops ?{Number of targets?|1} target(s) on the nose! Target 1: @{target|Target1|token_name} ?{target2|!} Target 2: @{target|Target2|token_name} ?{target3|!} Target 3: @{target|Target3|token_name} This macro will ask you to select three targets, as that is the maximum number of targets this macro handles. It will then ask you how many targets, for the benefit of the emote. And then it will bring up prompts for target2 and target3: If you wish to bop them on the nose, remove the ! and leave the box blank. If you do not wish to bop them on the nose, leave the ! in the box. And you must be asking, "But what if I want to only bop 1 person? Who do I click for targets 2 and 3?" and my answer is, "Click on your own token to pad out the list." Try it out a few times and you'll quickly get the hang of it.
1435970667

Edited 1435970865
Wooooooow~ holy crap, thats awesome. o.o Thanks Gen, that helps an absolute lot, I can see some new macros working out because of this. ^^ Essentially it allows us to hide lines we don't need right? Does this work with templates, I don't think so right?
1435977078
Gen Kitty
Forum Champion
Yeah, you could use the same approach for more complex 'runtime' options. I know nozink about templates, NOZINK! ^_^
Runtime options? Wut? I know nozink about that. xD
1435981971
Gen Kitty
Forum Champion
?{Normal attack?|!} #standard ?{Full Attack?|!} #full ?{Sneak 1?|!} #sneak1 ?{Sneak 2?|!} #sneak2 'Runtime options' is computer geek speak for 'options chosen at runtime (execution) rather than written into the software'. This sort of macro asks you what options you wish to run from this arrangement. It's very useful for someone who doesn't wish to clutter their token or macro bar, but also doesn't want to write long and complicated single macros.