Difference between revisions of "Script:SelectManager"
From Roll20 Wiki
Andreas J. (Talk | contribs) m |
Andreas J. (Talk | contribs) m (TokenMod example) |
||
(5 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | + | <noinclude>{{revdate}} {{main|Meta-Toolbox}} | |
− | [[ | + | =Script:SelectManager= |
− | [[ | + | {{Meta-ToolboxNav}}</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 | ||
+ | <noinclude>__TOC__</noinclude> | ||
+ | <noinclude>==</noinclude>'''Syntax'''<noinclude>==</noinclude> | ||
+ | <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> | ||
+ | |||
+ | <noinclude>==</noinclude>'''Example'''<noinclude>==</noinclude> | ||
+ | |||
+ | Calling tokens by name with [[TokenMod]](normally you can't reference tokens by name): | ||
+ | <pre>!token-mod --ids {& select Charlie, Dino} --current-page --move =90|1g</pre> | ||
+ | |||
+ | With a command line like: | ||
+ | <pre>!forselected(^) somescript --tgt|@^(selected.token_id)</pre> | ||
+ | |||
+ | ...what is sent to chat by <code>forselected</code> will be: | ||
+ | <pre>!somescript --tgt|@(selected.token_id)</pre> | ||
+ | <noinclude> | ||
+ | ==Meta-Toolbox Examples== | ||
+ | {{:Meta-Toolbox/Examples}} | ||
+ | =Other APIs= | ||
+ | * [[ChatSetAttr]] | ||
+ | * [[ScriptCards]] | ||
+ | [[Category:API Meta Scripts]] | ||
+ | [[Category:User API Scripts]] | ||
+ | [[Category:Tokens]] | ||
+ | [[Category:Macros]]</noinclude> |
Latest revision as of 14:06, 12 March 2022
Page Updated: 2022-03-12 |
[edit] Script:SelectManager
API:Meta-Toolbox
APIs to patch other API commands
Meta-Toolbox Scripts
created by Timmaugh
Related APIs
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.
- SelectManager(Forum) older thread
Contents |
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
Calling tokens by name with TokenMod(normally you can't reference tokens by name):
!token-mod --ids {& select Charlie, Dino} --current-page --move =90|1g
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)
[edit] Meta-Toolbox Examples
Examples using one or more Meta-Toolbox APIs
- Managing PathFinder Sizes with TokenMod and Metascripts (Muler + TokenMod, extra stuff w/ ZeroFrame, SelectManager, Fetch)
- Using TokenMod to update multiple token tooltips (TokenMod + SelectManager + Fetch + ZeroFrame)
- Macro to read current face of Rollable Token
- Repeating Sections & ChatSetAttr(Forum)
- First example: Plugger and SelectManager; Second example: Plugger, Muler, SelectManager, and ZeroFrame.
- Using MathOps standalone, more details(Forum)
- API Logic and Libinline(Forum)
- selectmanager example(Forum)
- ZeroFrame example with ColorEmote(Forum)
- Table example with Muler & ZeroFrame(Forum)
- Muler + more example(Forum)
- Dealer -- Is there a way to deal to a player, even if that player's token is not selected?(Forum) - Selectmanager example
- Audio Master API(Forum) - fixes with MathOps & Muler
- Fix "It's a Trap" with selectmanager(Forum)
- Search Attributes(Forum) - InsertArg example
- Is there an API that can roll saves for groups then apply a condition to the tokens that failed?(Forum) - selectmanager example
- TokenMod API - how to select token without clicking it(Forum) selectmanager fix TokenMod limitation
- default token size fix(Forum) Muler & Fetch examples
- Multi-step table resolution (Pacesetter system)(Forum) - Muler with ZeroFrame example
- Creating a HUD(Forum) - ZeroFrame, Fetch example working with TokenMod
- Retrieving next item in list(Forum) - Muler, ZeroFrame, and APILogic example
- Retrieving or assigning individual data to/from many tokens with deferred inline rolls(Forum) - examples of SelectManager's forselected handle using various metascripts with TokenMod