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

Two+ API calls in a macro is unreliable

Spent 5 hours today crafting a dungeon with beautiful automation and multimedia and it works fantastically ...  80% of the time. The other 20% of the time? Some of the API calls will choose to go through and the others just mysteriously vanish. Is it consistent? Of course not! Take this little macro:  Move some bad guy tokens from the GM Layer to the Token Layer. Pull up the Combat Master Menu. Play a spooky sound effect. Play some epic music. All in one click. Sweet, right? Except a fifth of the time at least one of the calls gets ignored. !token-mod --ids -NL3a4WTWoUEurUere99 -NL3agtHxpd96agv2Ssn --ignore-selected --set layer|objects !cmaster --main !splay bones-and-flesh-movement-98677 !splay hall-of-the-slain-norse-viking-background-music-110366 Super anti-climactic when only half of it works. Am I doing something wrong, or am I right to be salty? It looks like I'm not the only one, according to this post from two years ago.
1672979208
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
HI snuh! This is a known issue, but it is unusual for it to drop calls to that degree. Have you tried switching the order? CMaster can be a complex script to run on a busy map. Simple Sound is pretty barebones, but the jukebox itself can sometimes be... quirky. Token-mod is typical the Aaron nigh-bulletproof. Try  !token-mod --ids -NL3a4WTWoUEurUere99 -NL3agtHxpd96agv2Ssn --ignore-selected --set layer|objects !splay bones-and-flesh-movement-98677 !splay hall-of-the-slain-norse-viking-background-music-110366 !cmaster --main
Thanks, Keith! I'll give that a go. It's working fine now but I'll retest during peak demand.
1673032125

Edited 1673037796
timmaugh
Pro
API Scripter
Another option is to wrap each individual command in Plugger EVAL blocks. That would make each command a discrete plugger dispatch, but they could be embedded in the base macro: !splay hall-of-the-slain-norse-viking-background-music-110366 {&eval}token-mod --ids -NL3a4WTWoUEurUere99 -NL3agtHxpd96agv2Ssn --ignore-selected --set layer|objects {&/eval} {&eval} cmaster --main {&/eval} {&eval} splay bones-and-flesh-movement-98677 {&/eval} Once you've converted them all this way, you're left with a single message (which means there are no "extra" messages for Roll20 to drop). I rolled all of your commands into your FINAL command (as the outer wrapper) since the order of dispatch will go: embedded commands detected left-to-right, followed by the outer/housing command (what's left). Can't promise the order of resolution (that will depend on the complexity of what you're using/doing), but that's little different than the original setup you were using before noticing Roll20 was dropping commands.
I've had success with inserting a blank line between API calls.
Hey folks! Sorry for the long delay but here's the follow-up: I set up my macros to test different configurations. Insert blanks lines between API calls - still have dropped calls at the same rate Change the call order so bigger scripts are later - still have dropped calls at the same rate (issue even occurs even with macros that have only minor calls, too) Plugger - seems to work perfectly! Still not a huge sample size (maybe a few dozen calls made during 2 test sessions and 1 game session), but it's promising. Thanks for the tips, y'all!