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

macro with multiple API commands only sometimes works

I have a macro that is supposed to do the following four things: !xp challenge @{selected|npc_xp} !token-mod --set layer|map !token-mod --set tint_color|rgb(0,0,0) !token-mod --set statusmarkers|dead It uses easy xp and token mod to award xp, move the token to the map layer, darken it, and slap the red "X" across it. Works like a charm. Except when it doesn't. XP part always works. The usual mode of failure is none of the TokenMod commands executing, but sometimes the first two will work and the last one will not. No error messages in chat or the API output console. Fails on multiple different tokens. Sometimes a 2nd click of the macro on the hotbar will execute the TokenMod commands, but other times I have to hit it a 3rd or a 4th time. I always give it about 5-10 seconds to work before I hit it again. Executing the macro by clicking on the d20 in the macro tab seems to fail slightly less often than clicking the button. Anyone ever experienced similar issues? Wouldn't be THAT annoying except for the fact that since the XP part always works, I have to go back and subtract XP from the session total when I end up having to hit the macro like 3 or 4 times to get it to "take"
1560759918
Ziechael
Forum Champion
Sheet Author
API Scripter
There shouldn't be a need to run 3 tokenMod calls, this would potentially prevent failures: !xp challenge @{selected|npc_xp} !token-mod --set layer|map tint_color|rgb(0,0,0) statusmarkers|dead
Ziechael said: There shouldn't be a need to run 3 tokenMod calls, this would potentially prevent failures: !xp challenge @{selected|npc_xp} !token-mod --set layer|map tint_color|rgb(0,0,0) statusmarkers|dead Looks like this solved the issue. Thanks for the tip!!
1560844474
Ziechael
Forum Champion
Sheet Author
API Scripter
No problem :) My guess would have been that the multiple commands were sometimes trying to fire at the same time and stumbling over one-another... pretty sure I've fallen afoul of that myself a time or two. Happy rolling!!