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

[Script] Dealer -- Is there a way to deal to a player, even if that player's token is not selected?

I use the "Dealer" Script (thanks, @keithcurtis) to hand out "bennies" in our Savage World campaign. A benny is akin to an Inspiration in D&D. I have a Deck labeled "Bennies" (really just a deck of single sided tokens) and use the "Dealer" script, and this macro: !deal --give ?{Bennies|1} --Bennies @{selected|token_name} gets ?{Bennies} bennies! /fx burst-water I select a player token, click the macro button, and enter the # of bennies to be awarded at the prompt. The players all see that bennies have been awarded, along with a little glowy FX around the player token.  This works great, but I'm trying to automate the start of the night where players and GM start with a set # of bennies at the start of the play session -- so I just need to press a "Start-Bennies" button, and the macro will auto-deal each player a set number of bennies. I'd love a feature like this: !deal --give 3 --Bennies --ids <token id> [<token id> ...]  But the deal script doesn't support dealing deck cards to a token (yet). Is there another script that selects named tokens, that I could perhaps combine with using the Deal macro?
1630944402
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'll page the Metamancer. :) Hold on.
1630965205
timmaugh
Pro
API Scripter
There are some who call me... ...Tim? You can do what you want with metascripts. As I understand it, Dealer is expecting you to have one token selected, which it then translates into a character. If you grab SelectManager, you can: 1) virtually select your tokens (optional, you could manually select them, too) 2) iterate over them, and 3) give that information, one at a time, to the Dealer command line. If you chose to manually select all the tokens before running it, the command would look like this: !forselected deal --give 3 --Bennies If you wanted to virtually select them (meaning you don't have to click on them on the board -- you could have other things selected but act on the tokens you designate), you would add that onto the backend of that command line: {& select -M1234567890abcdef, Bob, Hoocha Man} The {&select} tag takes a comma-separated list of token names, ids, or character names. You could store that as a list and get it at the time the command was run. If you wanted to keep it in an attribute, for example, you could do: {& select @{MuleCharacter|BenniesResetList} }