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

Saving the target in memory for reuse

Are there any API scripts that can save the token ID for reprocessing on call? The ability to perform an attack with animation is cool, but it is hard to choose one target each time "performing 5 attacks" be it a weapon or a spell. Honestly, I would implement this myself through a buffer table, so there will probably be fewer conflicts with other APIs. Sample scenario: 1) !SaveTarget @{target|token_id}  player-1-target-table 2) Rewriting table  player-1-target-table 3) In any other script we write: « --ids [[1t[player-1-target]]] », not « --ids @{target|token_id} » 4) Press 5 attacks without selecting a target over and over again
1734893382
timmaugh
Pro
API Scripter
The Metascript Toolbox will be your huckleberry. Muler is a part of the Toolbox, and you can save info on the fly using it. Muler uses character abilities as ad hoc tables, so you could have a "Target" ability on each character who would use this functionality: ========== Target ============== | | | TheTarget=-M1234567890abcdef | | | ================================== Or, you could have a centralized "Mule Character" that had a "Target" ability that had a set of Character=Target lines: ============= Target ================ | | | BobTarget=-M1234567890abcdef | | CalliopeTarget=-Nabc12345678fcdef | | | ======================================= Spaces matter for the left side of the equals, so we might have to get creative if, for the second option, your characters would have spaces in their names. Then you could have a "DesignateTarget" command that would overwrite this data with the new Target... !set.TheMule.Target.BobTarget = @{target|token_id}/set ...   and your other commands would just read the information: --ids get.TheMule.Target.BobTarget/get ...or... --ids get.TheMule.Target.@{selected|character_name}Target/get