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

Reusing the text of a Roll Table to be clickable and trigger another macro

I have a series of rollable tables to help generate weather information. I have a macro (held as an attribute in the Weatherman character sheet) to create a weather report for just the GM by rolling on several of these tables. Everything works fine. Except, I want to now take the output from the Precipitation Type randomized roll (e.g., Hailstorm, Fog-Heavy, Fog-Light, and so on) and have the ability to click on the word "Hailstorm" to fire another macro (aptly named Hailstorm - also held as an attribute in Weatherman) that reports to the GM what happens when that precipitation type happens. The "Hailstorm" macro works great when used by itself. But I can't get the Precipitation Type roll (let's again say it rolled Hailstorm) to access the Hailstorm description macro. Running the following macro produces the output in this picture. /w gm &{template:default} {{name=Weather Effects}} {{Precipitation Type=[[1t[Geoff-Precipitation-1]]]}} {{[Wx](~Geoff Weather|$[[0]])}} The $[[0]] variable recognizes and stores the output from the rollable table [Geoff-Precipitation-1], but clicking the button won't run the macro and gives the error in the picture. Changing the tilde (~) to a percent sign (%) or copying the text of the working macro (%{Geoff Weather|Hailstorm}) causes the Chat Menu button [Wx] to disappear. I do have access to API if anyone knows of a script that can do what I need. Rollable Table Macros script didn't seem to have what I am looking for.
Following up - I do have a Chat Menu with all the weather effects descriptions as a temporary solution. It works fine, but I'm wondering if there is a more elegant solution.
Forum Champion
Marketplace Creator
API Scripter
Hi, Sir Choklet! Look up RecursiveTable by the Aaron (One Click install). I don't use it myself, but I think it might be what you are looking for.

Edited 1669294321
Thanks keithcurtis. I explored RecursiveTables as well. If I rebuilt the last macro to be another rollable table instead of a macro, that script might be helpful. But I don’t want the weather effects description to be random. I want to display exactly what happens when the Hailstorm or Heavy Fog is the random output. That’s a fixed description not another rollable table.  Any other suggestions? Is this a job for Script Cards because I’m actually passing a variable??
API Scripter
With ZeroFrame installed, you should be able to add a few syntax doo-dads to that to make it work. !/w gm &{template:default} {{name=Weather Effects}} {{Precipitation Type=[[1t[Geoff-Precipitation-1]]]}} {{[Wx](~Geoff Weather|$[[0]].value)}}{&simple} To make it clear what I added: ! .value {&simple} /w gm &{template:default} {{name=Weather Effects}} {{Precipitation Type=[[1t[Geoff-Precipitation-1]]]}} {{[Wx](~Geoff Weather|$[[0]] )}} I just tested that in my setup and it worked.