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

Is it possible to use the same query multiple time or store a value

1586301705
Marco M.
KS Backer
Sheet Author
API Scripter
Compendium Curator
I was trying to make a tool for the gm that allow them to select multiple characters and check their skill. This might be useful, for example, when you want to check certain PCs skills (like Alertness) without them being alerted. This is what I came up with: /w gm &{template:default} {{name= Skill}}{{@{target|target1|token_name} = ?{Skill1|  Accounting,@{target|target1|accounting}| Alertness,@{target|target1|alertness}| Anthropology,@{target|target1|anthropology}| Archeology,@{target|target1|archeology}| Art1,@{target|target1|art1}| Art2,@{target|target1|art2}| Bureaucracy,@{target|target1|bureaucracy}| Stealth,@{target|target1|stealth}| Search,@{target|target1|search}| Unnatural,@{target|target1|unnatural}}}}{{@{target|target2|token_name} = ?{Skill2|  Accounting,@{target|target2|accounting}| Alertness,@{target|target2|alertness}| Anthropology,@{target|target2|anthropology}| Archeology,@{target|target2|archeology}| Art1,@{target|target2|art1}| Art2,@{target|target2|art2}| Bureaucracy,@{target|target2|bureaucracy}| Stealth,@{target|target2|stealth}| Search,@{target|target2|search}| Unnatural,@{target|target2|unnatural}}}}{{@{target|target3|token_name} = ?{Skill3|  Accounting,@{target|target3|accounting}| Alertness,@{target|target3|alertness}| Anthropology,@{target|target3|anthropology}| Archeology,@{target|target3|archeology}| Art1,@{target|target3|art1}| Art2,@{target|target3|art2}| Bureaucracy,@{target|target3|bureaucracy}| Stealth,@{target|target3|stealth}| Search,@{target|target3|search}| Unnatural,@{target|target3|unnatural}}}}{{@{target|target4|token_name} = ?{Skill|  Accounting,@{target|target4|accounting}| Alertness,@{target|target4|alertness}| Anthropology,@{target|target4|anthropology}| Archeology,@{target|target4|archeology}| Art1,@{target|target4|art1}| Art2,@{target|target4|art2}| Bureaucracy,@{target|target4|bureaucracy}| Stealth,@{target|target4|stealth}| Search,@{target|target4|search}| Unnatural,@{target|target4|unnatural}}}} Now, obviously the problem is that the query skill is only called once, so it only stored one of the values and put the same for all of them  Now, I tried to embed the table inside the query, but the result is a nonsensical mess. Is there a way to do something similar using only macro. Something like ?{Skill| skill1, #table_of_all_targeted_players_for_skill1| skill2, #table_of_all_targeted_players_for_skill2|...} I know it's possible using the API, I'm just trying to write a macro everyone can use (even if the output is not targeted but the name of a character is fine). My problem is trying to embed a table inside the query :)
1586303454
The Aaron
Roll20 Production Team
API Scripter
There really isn't a way that I can think of to do that without the API.
1586317300
Marco M.
KS Backer
Sheet Author
API Scripter
Compendium Curator
Ok... I think I found a work around... It's not pretty (no table form but it works pretty well. /w gm ?{Skill|Accounting, **Accounting** **@{target|target1|token_name}**=@{target|target1|accounting} **@{target|target2|token_name}**=@{target|target2|accounting} **@{target|target3|token_name}**=@{target|target3|accounting}| Alertness, **Alertness** **@{target|target1|token_name}**=@{target|target1|alertness} **@{target|target2|token_name}**=@{target|target2|alertness} **@{target|target3|token_name}**=@{target|target3|alertness}| Search, **Search** **@{target|target1|token_name}**=@{target|target1|search} **@{target|target2|token_name}**=@{target|target2|search} **@{target|target3|token_name}**=@{target|target3|search}| Unnatural, **Unnatural** **@{target|target1|token_name}**=@{target|target1|unnatural} **@{target|target2|token_name}**=@{target|target2|unnatural} **@{target|target3|token_name}**=@{target|target3|unnatural}} Long to write for all the skills? Yes! But many times you are only interested to the "passive" skills so... it might come handy :)
1586317825

Edited 1586317871
Marco M.
KS Backer
Sheet Author
API Scripter
Compendium Curator
Also if someone just want to roll in secret for the characters here is another version: /w gm ?{Skill|Accounting, **Accounting** **@{target|target1|token_name}**=[[1d100<=@{target|target1|accounting}]] **@{target|target2|token_name}**=[[1d100<=@{target|target2|accounting}]] **@{target|target3|token_name}**=[[1d100<=@{target|target2|accounting}]]| Alertness, **Alertness** **@{target|target1|token_name}**=[[1d100<=@{target|target1|alertness}]] **@{target|target2|token_name}**=[[1d100<=@{target|target1|alertness}]] **@{target|target3|token_name}**=[[1d100<=@{target|target1|alertness}]]| Search, **Search** **@{target|target1|token_name}**=[[1d100<=@{target|target1|search}]] **@{target|target2|token_name}**=[[1d100<=@{target|target2|search}]] **@{target|target3|token_name}**=[[1d100<=@{target|target3|search}]]| Unnatural, **Unnatural** **@{target|target1|token_name}**=[[1d100<=@{target|target3|unnatural}]] **@{target|target2|token_name}**=[[1d100<=@{target|target3|unnatural}]] **@{target|target3|token_name}**=[[1d100<=@{target|target3|unnatural}]]} In which every 0 is a failure and every 1 is a success