
If you have multiple API commands in a single chat message (as from a macro or ability), Roll20 will fairly consistently drop a non-zero number of them. This problem was noted in the APILogic thread , but it seems likely that it is causing similar, otherwise inexplicable "why isn't this part of my macro working?" problems for others.
The Aaron and I spent some time last night chasing this to ground, and have a fairly short repro script to prove the problem:
on('ready', () => {
on('chat:message',(msg) => {
if('API' !==msg.playerid) {
sendChat('',`Msg: ${msg.content}`);
}
});
});
Repro Steps:
1) Install the above script (a new game with no other scripts works best to show the problem is not from the interaction/interference of other scripts)
2) Send a multi-line API Chat Command:
!test 0
!test 1
!test 2
!test 3
!test 4
!test 5
!test 6
!test 7
!test 8
!test 9
!test 10 !test 11
3) Repeat as necessary to produce the issue
4) Observe the output to see that some API Chat Command output messages get dropped (which ones get dropped varies from one test to the next)
Example Output:
Msg: !test 0
Msg: !test 1
Msg: !test 2
Msg: !test 3
Msg: !test 7 // no !test 4, 5, or 6 output
Msg: !test 9 // no !test 8 output
Msg: !test 10
Msg: !test 11
I know Aaron has screenshots he could add...