Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "Script:SelectManager"

From Roll20 Wiki

Jump to: navigation, search
m
m (transclude from Tim)
Line 1: Line 1:
#REDIRECT [[User:5962076]]
+
<noinclude>{{revdate}} {{main|Meta-Toolbox}}</noinclude>
 +
'''{{fpl|10422879/ SelectManager}}''' helps [[API]]-generated messages remember what tokens are selected (they would otherwise not know), and lets you send commands to other scripts using the {{code|!forselected}}-handle. It also lets you "virtually" select [[tokens]] to ease interaction with the map.
 +
* {{fpl|9817678/ SelectManager}} older thread
 +
 
 +
'''Syntax:'''
 +
<pre style="overflow:auto;white-space:pre-wrap;">No direct call interaction                                    => SM can hand off tokens automatically
 +
!forselected spawn...                                          => iterates a spawn script over the selected tokens
 +
!forselected !spawn...                                        => same, including the exclamation point for downstream script
 +
!forselected(^) spawn @^(selected.token_id)                    => custom escape character for downstream script
 +
{& select Jax, Heretic}                                        => replace selected tokens with comma-separated list
 +
                                                                  (token ID, name,  or near name)
 +
{& inject Jax}                                                => Add Jax to the selected tokens, if not already included
 +
{& select get.TheParty}                                        => Use a Muled variable "TheParty" to retrieve comma-separated list
 +
                                                                  (requires Muler script)
 +
{& select get.?{Select...|Party,TheParty|Townies,TownNPCs|...  => Utilize Roll20 query to choose the selected token set at run time
 +
                                                                  (example requires Muler script)
 +
BONUS SYNTAX:
 +
!script --@forselected+|token-mod ...                          => forselected as downstream call, initiating downstream call
 +
                                                                  (scriptcards calling forselected calling token-mod)</pre>
 +
 
 +
{{ex}}
 +
 
 +
With a command line like:
 +
<pre style="overflow:auto;white-space:pre-wrap;">!forselected(^) somescript --tgt|@^(selected.token_id)</pre>
 +
 
 +
...what is sent to chat by <code>forselected</code> will be:
 +
<pre style="overflow:auto;white-space:pre-wrap;">!somescript --tgt|@(selected.token_id)</pre>
 +
<noinclude>
 +
==Meta-Toolbox Examples==
 +
{{:Meta-Toolbox/Examples}}
 +
==Other APIs==
 +
* [[ChatSetAttr]]
 +
* [[ScriptCards]]
 
[[Category:API Meta Scripts]]
 
[[Category:API Meta Scripts]]
 
[[Category:User API Scripts]]
 
[[Category:User API Scripts]]
 
[[Category:Tokens]]
 
[[Category:Tokens]]
[[Category:Macros]]
+
[[Category:Macros]]</noinclude>

Revision as of 08:05, 14 February 2022

Main Page: Meta-Toolbox

SelectManager(Forum) helps API-generated messages remember what tokens are selected (they would otherwise not know), and lets you send commands to other scripts using the !forselected-handle. It also lets you "virtually" select tokens to ease interaction with the map.

Syntax:

No direct call interaction                                     => SM can hand off tokens automatically
!forselected spawn...                                          => iterates a spawn script over the selected tokens
!forselected !spawn...                                         => same, including the exclamation point for downstream script
!forselected(^) spawn @^(selected.token_id)                    => custom escape character for downstream script
{& select Jax, Heretic}                                        => replace selected tokens with comma-separated list
                                                                  (token ID, name,  or near name)
{& inject Jax}                                                 => Add Jax to the selected tokens, if not already included
{& select get.TheParty}                                        => Use a Muled variable "TheParty" to retrieve comma-separated list
                                                                  (requires Muler script)
{& select get.?{Select...|Party,TheParty|Townies,TownNPCs|...  => Utilize Roll20 query to choose the selected token set at run time
                                                                  (example requires Muler script)
BONUS SYNTAX:
!script --@forselected+|token-mod ...                          => forselected as downstream call, initiating downstream call
                                                                  (scriptcards calling forselected calling token-mod)


Example:

With a command line like:

!forselected(^) somescript --tgt|@^(selected.token_id)

...what is sent to chat by forselected will be:

!somescript --tgt|@(selected.token_id)

Meta-Toolbox Examples

Examples using one or more Meta-Toolbox APIs

Other APIs