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

Randomly calling macro's or abilities via recursive tables

I have a set of abilities that I call from a query, but really the selection should be random.  I would like to replace the query with a random call.  I've tried putting the calls in rollable tables as entries, such as %{character|ability_a} %{character|ability_b} That didn't work.  I tried using recursive tables.  That worked, but my abilities had references to targets and queries.  Whenever either were encountered, RT produced an error.  I tried moving the targeting and queries outside of the called abilities, adding them to the same ability that called RT, but to no avail.  I saw that the abilities called by RT had the right values for the query or targeted value, but RT would report an error. I also tried something like %{character|ability_[[ [1t[ability_name] ]]} but that didn't call the ability or macro either. Is there a way to implement a query where the choice is random?  Or to randomly call abilities/macros? Thanks!
1676861769

Edited 1676861786
timmaugh
Pro
API Scripter
The only way to preserve the ability to have a targeting statement is to have it either in the original message, like you've tried, or to have the secondary ability be triggered from a button (starting a new "top level" message). If you've tried Recursive Tables, you have access to scripts. And if you have access to scripts, there is a trick with ZeroFrame where you can have a table return generate a button for you. Let me dig that up...
1676865194
timmaugh
Pro
API Scripter
Yeah... this is a pretty cool trick. So, if you have ZeroFrame installed, you can get a button out of the table. All of the basic chat button formations work: Ability [Button Label](~Character|Ability_Name) Macro [Button Label](!
#MacroName) Script [Button Label](!script --arg1 --arg2) So you could have table entries of: [Roll](~character|ability_a) [Roll](~character|ability_b) [Roll](~character|ability_c) ...etc. Then, with ZeroFrame installed, you could do a command like: ![[1t[TableName]]]{&simple} That will give you a button in chat, which you can then click. Since you're dispatching a new message, your targeting statements can stay in the triggered abilities, and they will prompt you to designate targets when you click the button.
You might take a look at ScriptCards API/Mod.  I bet it could be implemented within it.
I'll give it a try!  Thank you very much for your response!