Hello! I'm relatively new to most of this stuff, having only hopped on board with online play on Roll20 in March due to COVID-19. That being said, I feel I've learned a lot there is to know about macros, calling for abilities/attributes, rolls, templates, queries, etc. What I still struggle with is the black box known as the API. I understand the commands for the scripts I have installed, but I'm having trouble with the following (Scripts involved—ChatSetAttr, Token-Mod, CombatMaster). Sheet = D&D 5e by Roll20: !token-mod --set statusmarkers|-Marked --ids @{Vesper|mark_id}
@{Vesper|wtype}&{template:spell} {{level=UA CFV: Favored Foe}} {{name=Hunter's Mark}} {{castingtime=1 bonus action}} {{range=90 feet}} {{target=A creature that you can see within range}} {{v=1}} 0 0 {{material=}} {{duration=Up to 1 hour}} {{description=You choose a creature you can see within range and mystically mark it as your quarry. Until the spell ends, you **deal an extra 1d6 damage to the target** whenever you hit it with a weapon attack, and you have **advantage on any Wisdom (Perception) or Wisdom (Survival) check you make to find it.** If the target drops to 0 hit points before this spell ends, **you can use a bonus action on a subsequent turn of yours to mark a new creature.**}} 0 {{innate=@{Vesper|wisdom_mod}/Long Rest}} {{concentration=0}} @{Vesper|charname_output}
!setattr --name Vesper --mark_id|@{target|Target|token_id}
!token-mod {{ --set statusmarkers|+Marked --ids @{target|Target|token_id} }} Here's the setup: I have CombatMaster installed and set up so that when the "Marked" marker is applied to a token, it toggles PC Vesper's global damage modifier $1 (hunter's mark; 1d6 piercing) ON. Upon removing said marker from any token, it does the opposite. This works great. What I'm trying to accomplish here is the following: 1. Remove "Marked" from @{Vesper|mark_id} (an attribute created to store the token ID of the marked creature) using TokenMod !token-mod --set statusmarkers|-Marked --ids @{Vesper|mark_id} This should "clear" the mark from the previous marked target so that there aren't multiple marks accumulating. Important that this fires off first, because when the "Marked" marker is removed from any token, it sets Vesper's global damage mod $1 to "off." 2. Spell description posted to chat 3. Set Vesper's @{mark_id} attribute equal to the new marked target's @{token_id} for storage. !setattr --name Vesper --mark_id|@{target|Target|token_id} No function except to prepare for step 1 should Vesper decide to move his mark to a new target. 4. Apply the "Marked" marker to the targeted token !token-mod {{ --set statusmarkers|+Marked --ids @{target|Target|token_id} }} This re-enables the global damage mod $1 (CMaster sees when "Marked" is added and turns Vesper's damage mod "on" again). The macro kind of works. It doesn't seem to work if I use it several times quickly, and sometimes randomly doesn't work. I've tried a few variations of this, but from what I've learned per these forums and TheAaron's wisdom, it seems like multiple API requests in a macro aren't guaranteed to process in order. This is where I could use help solving this problem: 1. Is there a way I could make a one-click macro that is GUARANTEED to fire the above API commands off in order? If not . . . 2. Is there a simpler way I could achieve this effect such that it's guaranteed to work? With these scripts? Some other scripts? In short: apply "Marked" to new token, clear it from previous token (or all other tokens—we only use this marker for Hunter's Mark and Vesper is the only character with said spell). 3. Could this be solved with a custom script that calls these scripts? I don't know how to write scripts . . . If options 1 and 2 are exhausted, could someone help me with this possibility? Keeping it as simple as possible. 4. Though I hope it wouldn't come to this, perhaps a bottom-up script creation would be needed (rather than having a tiny script calling other big, mean scripts). Please, oh scripting Wizards, give me your counsel on this matter.