It looks like you're new here. If you want to get involved, click one of these buttons!
It appears that the order of my waves is somewhat random when I go to send? Obviously I want the clear wave first but I just setup and send and it landed 2nd instead of 1st. Is there a way to prevent?
The only way to prevent is to wait for the server response, but that can delay the waves very long.
The script send the waves in order, but it cannot guarantee when each request is sent by the browser, received or processed by the server. If the interval between waves is shorter, problems like you describe can appear and are also influenced by the computer processing power and internet speed/latency.
The same is problem appears for the server response confirmation order. Some server response can be processed first, but the response can be received later, so the sending order response can appear sometime like 1,3,2,4, even if the waves were processed in the order 1,2,3,4.
A check for the clean wave can't be made, because someone can send some fakes before, or send only fakes.