
Hey everyone! I have no clue how to code/use javascript. My ask is this: I have already imported 3 different wild magic tables into their own and which one gets rolled on is based off of a d20 roll. 1-3 rolls on one table, 4-9 on the second table, 10+ on the last. I'm looking for an API script that could use a macro's resulting d20 roll to roll on the proper table and give the result.
As of right now, I gave the players 3 different macros to use (cleaner than table results):
&{template:npcaction} {{rname= Wild Magic}} {{name= 1-3}} {{description= [[1t[Wild-Magic-1-3]]] }}
&{template:npcaction} {{rname= Wild Magic}} {{name= 4-9}} {{description= [[1t[Wild-Magic-4-9]]] }}
&{template:npcaction} {{rname= Wild Magic}} {{name= 10+}} {{description= [[1t[Wild-Magic-10+]]] }}
The first action the player has to take though is roll a d20 to determine which macro to use.
So to summarize, I'd like the API to roll a d20, then roll on the proper table based on the result. I'm pretty sure this is possible, I just don't know how.
Thanks in advance!